#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main()
{
string str1;
string str2;
getline(cin , str1);
getline(cin , str2);
ll n2 = str2.length();
ll n1 = str1.length();
unordered_map<char , ll> mp;
for(auto c : str2)
mp[c]++;
ll i = 0;
while(i < n1 && mp[str1[i]] == 0)
i++;
ll j = n1 - 1;
while(j >= 0 && mp[str1[j]] == 0)
j--;
unordered_map<char , ll> fre;
ll sum = 0;
for(ll k = i ; k <= j ; k++)
{
if(mp[str1[k]] != 0)
{
fre[str1[k]]++;
sum++;
}
}
while(i < n1 && i <= j)
{
if(fre[str1[i]] == 0 || (fre[str1[i]] > mp[str1[i]]))
{
if(fre[str1[i]] != 0)
fre[str1[i]]--;
i++;
}
else
break;
}
while(j >= 0 && i <= j)
{
if(fre[str1[j]] == 0 || (fre[str1[j]] > mp[str1[j]]))
{
if(fre[str1[j]] != 0)
fre[str1[j]]--;
j--;
}
else
break;
}
if(sum < n2)
cout << "No String";
else
cout << str1.substr(i , j - i + 1);
}