#include #define all(r) r.begin(),r.end() using namespace std; 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()); if (t.size() == 7) { 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; }