#include <bits/stdc++.h>
using namespace std;
vector<string> v(2);
string s;
bool b = false;
void rec(int fi, int fj, int d) {
  if (d == 26) {
    b = true;
  }
  ++d;
  char c = s[d];
  if (fi == 1 && v[0][fj] == c) {
    rec(0, fj, d);
  }
  if (fi == 0 && v[1][fj] == c) {
    rec(1, fj, d);
  }
  if (fj < 12 && v[fi][fj + 1] == c) {
    rec(fi, fj + 1, d);
  }
  if (fj > 0 && v[fi][fj - 1] == c) {
    rec(fi, fj - 1, d);
  }
  if (fi == 1 && fj < 12 && v[0][fj + 1] == c) {
    rec(0, fj + 1, d);
  }
  if (fi == 1 && fj > 0 && v[0][fj - 1] == c) {
    rec(0, fj - 1, d);
  }
  if (fi == 0 && fj < 12 && v[1][fj + 1] == c) {
    rec(1, fj + 1, d);
  }
  if (fi == 0 && fj > 0 && v[1][fj - 1] == c) {
    rec(1, fj - 1, d);
  }
}
bool ckeck() {
  char c = s[0];
  int fi, fj;
  for (int i = 0; i < 2; ++i)
    for (int j = 0; j < 13; ++j)
      if (v[i][j] == c) {
        fi = i;
        fj = j;
        break;
      }
  b = false;
  rec(fi, fj, 0);
  return b;
}
void rotate() {
  char c1 = v[0][0];
  char c2 = v[1][12];
  v[0] = v[0].substr(1, 12) + c2;
  v[1] = c1 + v[1].substr(0, 12);
}
int main() {
  cin >> s;
  string y = "";
  vector<char> t(26);
  for (int i = 0; i < 27; ++i) {
    if (!t[s[i] - 'A']) y += s[i];
    ++t[s[i] - 'A'];
  }
  v[0] = y.substr(0, 13);
  string sub = y.substr(13, 13);
  reverse(sub.begin(), sub.end());
  v[1] = sub;
  for (int i = 0; i < 26; ++i) {
    if (ckeck()) {
      cout << v[0] << endl << v[1];
      return 0;
    }
    rotate();
  }
  cout << "Impossible";
}
