#include#define DBG(x) cerr << #x << " = " << x << endltypedef long long LL;using namespace std;int main(int argc, char **argv) { string str; while(cin >> str) { unordered_map vis; int ans = INT_MAX; int l = 0, r = 0; ++vis[str[r]]; int num = 1; while(l <= r && r < str.size()) { if(num == 26) { ans = min(ans, r - l + 1); if(--vis[str[l++]] == 0) --num; } else { if(vis[str[++r]]++ == 0) ++num; } } if(ans == INT_MAX) cout << "No Solution" << endl; else cout << ans << endl; } return 0;}/**BVCABCDEFFGHIJKLMMNOPQRSTUVWXZYZZ28*/