#include using namespace std; using ll = long long; using ld = long double; #define rep(i,n) for(int i=0;i<(int)(n);i++) #define reps(i,s,n) for(int i=(int)(s);i<(int)(n);i++) const ll mod = 1e9 + 7; const int INF = 1e9; int main() { cin.sync_with_stdio(false); string s; cin >> s; sort(s.begin(), s.end()); int c[26] = {}; rep(i, s.size()) { if (s[i] == s[i + 1]) { c[s[i] - 'a']++; if (c[s[i] - 'a'] > 1) { cout << "Impossible" << endl; return 0; } s[i] = '0'; s[i + 1] = '0'; i++; } } cout << s << endl; int cnt = 0; char ans; rep(i, s.size()) { if (s[i] != '0') { cnt++; ans = s[i]; if (c[ans - 'a'] != 0) { cout << "Impossible" << endl; return 0; } } } if (cnt != 1)cout << "Impossible" << endl; else cout << ans << endl; return 0; }