#include <bits/stdc++.h>
using namespace std;
string s;
int mp[300];
int main() {
  cin >> s;
  int l, r;
  for (int i = 0; i <= 26; i++) {
    if (mp[s[i]]) {
      l = mp[s[i]];
      r = i + 1;
      break;
    }
    mp[s[i]] = i + 1;
  }
  if (l + 1 == r) {
    puts("Impossible");
    return 0;
  }
  l--;
  r--;
  string q = "", w = "";
  int y = r - l - 1;
  q = q + s[l];
  for (int i = 1; i <= y / 2; i++) {
    q = q + s[l + i];
  }
  for (int i = y / 2 + 1; i <= y; i++) {
    w = s[l + i] + w;
  }
  string t;
  for (int i = r + 1; i <= 26; i++) {
    t += s[i];
  }
  for (int i = 0; i <= l - 1; i++) {
    t += s[i];
  }
  string t1 = t.substr(0, 12 - y / 2);
  string t2 = t.substr(12 - y / 2, t.size() - (12 - y / 2));
  reverse(t1.begin(), t1.end());
  q = t1 + q;
  w = t2 + w;
  cout << q << endl;
  cout << w << endl;
  return 0;
}
