#include <bits/stdc++.h>
using namespace std;
string S;
char tablica[2][14];
int t1, t2;
bool check() {
  for (int i = 0; i < 27; i++) {
    for (int j = i + 1; j < 27; j++) {
      if (S[i] == S[j]) {
        t1 = i;
        t2 = j;
      }
    }
  }
  if (abs(t1 - t2) == 1)
    return true;
  else
    return false;
}
int main(void) {
  cin >> S;
  if (check()) {
    printf("Impossible");
  } else {
    tablica[0][(t2 - t1 - 1) / 2] = S[t1];
    int it = (t2 - t1 - 1) / 2 - 1, x = t1 + 1;
    for (; x < S.size() && it >= 0; it--, x++) {
      tablica[0][it] = S[x];
    }
    it = 0, x = (t1 + t2 + 1) / 2;
    for (; x < t2; x++, it++) {
      tablica[1][it] = S[x];
    }
    int k = 1;
    x = t2 + 1;
    for (; x < S.size() && it < 13; it++, x++) {
      tablica[k][it] = S[x];
    }
    if (it == 13) {
      it--;
      k = 0;
    }
    for (; x < S.size() && it >= 0; x++, it--) {
      tablica[k][it] = S[x];
    }
    x = 0;
    if (k == 1) {
      for (; x < t1 && it < 13; it++, x++) {
        tablica[k][it] = S[x];
      }
      it--;
      k = 0;
    }
    for (; it >= 0 && x < t1; it--, x++) {
      tablica[k][it] = S[x];
    }
    for (int i = 0; i < 2; i++) {
      for (int j = 0; j < 13; j++) {
        cout << tablica[i][j];
      }
      cout << "\n";
    }
  }
  return 0;
}
