#include <bits/stdc++.h>
using namespace std;
string S;
int X, Y;
vector<char> ans[2];
signed main() {
  ios::sync_with_stdio(0);
  cin >> S;
  for (int i = 0; i < S.size(); ++i) {
    for (int j = i + 1; j < S.size(); ++j) {
      if (S[i] == S[j]) {
        X = i, Y = j;
        break;
      }
    }
  }
  if (X + 1 == Y) cout << "Impossible\n", exit(0);
  ans[0].assign(13, '$');
  ans[1].assign(13, '$');
  S += S;
  ans[0][(Y - X) / 2 - 1 + (Y - X & 1)] = S[X];
  ans[1][(Y - X) / 2 - 1] = S[Y];
  for (int i = X + 1; i < Y; ++i) {
    static int ap = 0, bp = (Y - X) / 2 - 1 + (Y - X & 1) - 1;
    if (bp < 0) ++ap, bp = 0;
    ans[ap][bp] = S[i];
    if (ap == 0)
      --bp;
    else
      ++bp;
  }
  for (int i = Y + 1; i < 27 + X; ++i) {
    static int ap = 1, bp = (Y - X) / 2 - 1 + 1;
    if (bp == 13) --ap, bp = 12;
    ans[ap][bp] = S[i];
    if (ap == 0)
      --bp;
    else
      ++bp;
  }
  for (int i = 0; i < 2; ++i) {
    for (int j = 0; j < 13; ++j) {
      cout << ans[i][j];
    }
    cout << endl;
  }
  return 0;
}
