#include #define rep(i,a,b) for(int i=a;i=b;i--) #define fore(i,a) for(auto &i:a) #pragma GCC optimize ("-O3") using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); } //--------------------------------------------------------------------------------------------------- /*---------------------------------------------------------------------------------------------------             ∧_∧       ∧_∧  (´<_` )  Welcome to My Coding Space!      ( ´_ゝ`) /  ⌒i     /   \    | |     /   / ̄ ̄ ̄ ̄/  |   __(__ニつ/  _/ .| .|____      \/____/ (u ⊃ ---------------------------------------------------------------------------------------------------*/ string S; //--------------------------------------------------------------------------------------------------- #define NO "Impossible" string solve() { map cnt; fore(c, S) cnt[c]++; int one = 0, two = 0; char one_c; fore(p, cnt) { if (p.second == 1) one++, one_c = p.first; else if (p.second == 2) two++; else return NO; } if (one == 1 and two == 6) { string ans = "a"; ans[0] = one_c; return ans; } return NO; } //--------------------------------------------------------------------------------------------------- void _main() { cin >> S; cout << solve() << endl; }