#include #include #include #include using namespace std; int main(){ string S; cin >> S; char ans = '#'; for (int i = 0; i < 26; i++){ string T = S + (char) ('a' + i); vector cnt(26, 0); for (int j = 0; j < 14; j++){ cnt[T[j] - 'a']++; } sort(cnt.rbegin(), cnt.rend()); if (cnt[6] == 2){ ans = 'a' + i; } } if (ans == '#'){ cout << "Impossible" << endl; } else { cout << ans << endl; } }