#include<bits/stdc++.h>

#define fast ios_base::sync_with_stdio(false); cin.tie(nullptr); cin.tie(nullptr);
#define int long long
#define inf (int)1e15
#define pii pair<int,int>
#define ff first
#define ss second

using namespace std;

string s, t;
unordered_map<char, int> req, freq;

bool isFind() {
    for (pii i : req)
        if (freq[i.ff] < i.ss) return false;
    return true;
}

string stringWindow() {

    int j = 0, st = 0, n = s.length();
    int ans = inf;

    for (int i = 0; i < n; i++) {
        freq[s[i]]++;

        while (isFind()) {
            int curLen = i - j + 1;
            if (curLen < ans)
                ans = curLen, st = j;
            freq[s[j]]--, j++;
        }
    }

    if (ans == inf) return "No string";
    else return s.substr(st, ans);
}

int32_t main() {
    fast
    int t_c = 1;
//	cin >> t_c;
    while (t_c--) {
        getline(cin, s), getline(cin, t);
        for (char c : t)
            req[c]++;
        cout << stringWindow() << endl;
    }
}