#include using namespace std; long long gcd(long long x, long long y) { if (y == 0) return x; return gcd(y, x % y); } long long lcm(long long x, long long y) { if (x == 0 || y == 0) return 0; return x / gcd(x, y) * y; } int main() { string s; cin >> s; map mp; for (int i = 0; i < 13; i++) { mp[s[i]]++; } string ans = ""; for (int i = 0; i < 13; i++) { if (mp[s[i]] > 2) { ans = "Impossible"; break; } else if (mp[s[i]] == 1) { if (ans != "") { ans = "Impossible"; break; } else { ans = s[i]; } } } cout << ans << endl; }