#include <bits/stdc++.h>
using namespace std;
string s;
char res[3][14];
int vt['Z' + 1], kc;
char rep;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> s;
  for (int i = 0; i + 1 < s.size(); i++)
    if (s[i] == s[i + 1]) {
      cout << "Impossible";
      return 0;
    }
  memset(vt, -1, sizeof(vt));
  for (int i = 0; i < s.size(); i++)
    if (vt[s[i]] == -1)
      vt[s[i]] = i;
    else {
      kc = i - vt[s[i]];
      rep = s[i];
    }
  if (s[0] == s[s.size() - 1]) {
    for (int i = 0; i < 13; i++) res[1][i + 1] = s[i];
    for (int i = 13; i < s.size(); i++) res[2][13 - (i - 13)] = s[i];
  } else if (kc == 2) {
    res[2][13] = rep;
    res[1][13] = s[vt[rep] + 1];
    int x = 1, y = 12;
    for (int i = vt[rep] + 3; i < s.size(); i++) {
      res[x][y] = s[i];
      if (x == 1)
        y--;
      else
        y++;
      if (y == 0) {
        x = 2;
        y = 1;
      }
    }
    for (int i = 0; i < vt[rep]; i++) {
      res[x][y] = s[i];
      if (x == 1)
        y--;
      else
        y++;
      if (y == 0) {
        x = 2;
        y = 1;
      }
    }
  } else {
    int x = 2, y = (13 - kc / 2) + (kc % 2 == 0);
    for (int i = vt[rep]; i < vt[rep] + kc; i++) {
      res[x][y] = s[i];
      if (x == 2)
        y++;
      else
        y--;
      if (y > 13) {
        y = 13;
        x = 1;
      }
    }
    for (int i = vt[rep] + kc + 1; i < s.size(); i++) {
      res[x][y] = s[i];
      if (x == 2)
        y++;
      else
        y--;
      if (y == 0) {
        y = 1;
        x = 2;
      }
    }
    for (int i = 0; i < vt[rep]; i++) {
      res[x][y] = s[i];
      if (x == 2)
        y++;
      else
        y--;
      if (y == 0) {
        y = 1;
        x = 2;
      }
    }
  }
  for (int i = 1; i <= 2; i++) {
    for (int j = 1; j <= 13; j++) cout << res[i][j];
    cout << '\n';
  }
  return 0;
}
