#include <bits/stdc++.h>
using namespace std;
string s, t;
int main() {
cin >> s >> t;
int ls = s.length(), lt = t.length();
if (ls > lt) {
for (int i = 0; i <= ls - lt; i++) {
for (int j = 0; j < lt; j++) {
if (s[j] != t[j]) {
break;
}
}
cout << t << ' ' << "is substring of" << ' ' << s;
return 0;
}
cout << "No substring";
return 0;
} else if (ls < lt) {
for (int i = 0; i <= lt - ls; i++) {
for (int j = 0; j < ls; j++) {
if (s[j] != t[j]) {
break;
}
}
cout << s << ' ' << "is substring of" << ' ' << t;
return 0;
}
cout << "No substring";
return 0;
} else if (ls == lt) {
for (int j = 0; j < ls; j++) {
if (s[j] != t[j]) {
break;
}
cout << s << ' ' << "is substring of" << ' ' << t;
return 0;
}
cout << "No substring";
return 0;
}
}