#include <bits/stdc++.h>
using namespace std;
int movi[] = {0, -1, 0, 1};
int movj[] = {1, 0, -1, 0};
int visto[26];
int posicion[26];
char sol[2][13];
int main() {
  string s;
  cin >> s;
  int repe;
  int dist;
  int pos2repe;
  for (int i = 0; i < int(s.size()); i++) {
    int c = s[i] - 'A';
    if (visto[c]) {
      repe = c;
      dist = i - posicion[c];
      pos2repe = i;
      if (dist == 1) {
        cout << "Impossible" << endl;
        exit(0);
      }
      break;
    }
    visto[c] = 1;
    posicion[c] = i;
  }
  int i = 0;
  int j = (dist - 1) / 2;
  int d = 2;
  int pos = posicion[repe];
  for (int pas = 0; pas < 27; pas++) {
    if (pos == pos2repe)
      pos = (pos + 1) % 27;
    else {
      sol[i][j] = s[pos];
      pos = (pos + 1) % 27;
      for (;;) {
        int nexti = i + movi[d];
        int nextj = j + movj[d];
        if (nexti < 0 or nexti >= 2 or nextj < 0 or nextj >= 13) {
          d = (d + 1) % 4;
          continue;
        }
        i = nexti;
        j = nextj;
        break;
      }
    }
  }
  for (int i = 0; i < 2; i++) {
    for (int j = 0; j < 13; j++) cout << sol[i][j];
    cout << endl;
  }
}
