#include <bits/stdc++.h>
using namespace std;
const int INF = 2e9;
const long long INFL = 2e18;
string s;
int p, v;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> s;
  s = '~' + s;
  for (int i = (1), _b = (26); i <= _b; ++i)
    for (int j = (i + 1), _b = (27); j <= _b; ++j)
      if (s[i] == s[j]) {
        p = i;
        v = j;
      }
  if (v - p == 1) return cout << "Impossible" << '\n', 0;
  string t = "";
  for (int i = (1), _b = (p + (v - p - 1) / 2); i <= _b; ++i) t = s[i] + t;
  s.erase(v, 1);
  string l = s.substr(p + (v - p - 1) / 2 + 1, 26);
  while (((int)(l).size()) > 13) {
    t += l[((int)(l).size()) - 1];
    l.erase(((int)(l).size()) - 1, 1);
  }
  while (((int)(t).size()) > 13) {
    l += t[((int)(t).size()) - 1];
    t.erase(((int)(t).size()) - 1, 1);
  }
  cout << t << '\n';
  cout << l << '\n';
  return 0;
}
