#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
string s, ss = "";
map<char, long long> mp;
long long id = 0;
long long fx[] = {-1, 0, 1, 1, 1, 0, -1, -1},
          fy[] = {1, 1, 1, 0, -1, -1, -1, 0};
long long check(long long id, long long ll) {
  string so[2];
  for (long long i = id; i < ss.size(); i++) {
    if (so[0].size() < 13)
      so[0] += ss[i];
    else
      so[1] = ss[i] + so[1];
  }
  if (ll) {
    cout << so[0] << endl;
    cout << so[1] << endl;
    return 1;
  }
  long long x, y;
  for (long long i = 0; i < 2; i++) {
    for (long long j = 0; j < 13; j++) {
      if (so[i][j] == s[0]) {
        x = i;
        y = j;
      }
    }
  }
  id = 1;
  while (id < s.size()) {
    long long f = 0;
    for (long long i = 0; i < 8; i++) {
      long long xx = x + fx[i], yy = y + fy[i];
      if (xx >= 0 && xx <= 1 && yy >= 0 && yy < 13) {
        if (so[xx][yy] == s[id]) {
          x = xx;
          y = yy;
          f = 1;
          break;
        }
      }
    }
    if (!f) return 0;
    id++;
  }
  return 1;
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> s;
  long long fl = 0;
  for (long long i = 0; i < 27; i++) {
    if (mp[s[i]] == 0) {
      ss += s[i];
      mp[s[i]] = 1;
    }
  }
  for (long long i = 0; i < 26; i++) {
    long long x = check(id, 0);
    if (x) {
      check(id, 1);
      fl = 1;
      break;
    }
    ss += ss[id];
    id++;
  }
  if (!fl) cout << "Impossible" << endl;
}
