#include #define all(r) r.begin(),r.end() using namespace std; typedef int64_t ll; struct Solution { void solve(std::istream& in, std::ostream& out) { string s, t; in >> s; sort(all(s)); t = s; t.erase(unique(all(t)), t.end()); int alpha[26] = {}; for (int i = 0; i < 13; i++) { alpha[s[i] - 'a']++; } ll len = 0; for (int i = 0; i < 26; i++) { len += alpha[i] == 2; } if (len == 6) { string ans = ""; for (int i = 0; i < 13; i++) { if (s[i] != t[i / 2]) { ans = t[i / 2]; break; } } out << ans << '\n'; } else { out << "Impossible" << '\n'; } } }; void solve(std::istream& in, std::ostream& out) { out << std::setprecision(12); Solution solution; solution.solve(in, out); } #include #include int main() { ios_base::sync_with_stdio(0); cin.tie(0); istream& in = cin; ostream& out = cout; solve(in, out); return 0; }