#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int i, j;
  int x = -1;
  int y = -1;
  for (i = 0; i < 27; i++) {
    for (j = i + 1; j < 27; j++) {
      if (s[i] == s[j]) {
        x = i;
        y = j;
      }
    }
  }
  char b1[13], b2[13];
  if (x + 1 == y) {
    cout << "Impossible";
    return 0;
  }
  int k;
  k = 12 - (y - x - 1) / 2;
  b1[k] = s[x];
  int l;
  l = k;
  if ((y - x) % 2 == 1) l = k + 1;
  i = x + 1;
  while (l < 13) {
    b2[l] = s[i];
    i += 1;
    l += 1;
  }
  l = 12;
  while (i < y) {
    b1[l] = s[i];
    l -= 1;
    i += 1;
  }
  string s1, s2, sx;
  s1 = s.substr(0, x);
  reverse(s1.begin(), s1.end());
  s2 = s.substr(y + 1, s.size() - y - 1);
  reverse(s2.begin(), s2.end());
  sx = s1 + s2;
  i = 0;
  l = k - 1;
  while (l >= 0 && i < sx.size()) {
    b1[l] = sx[i];
    i += 1;
    l -= 1;
  }
  if (l == -1) {
    l = 0;
    while (i < sx.size()) {
      b2[l] = sx[i];
      i += 1;
      l += 1;
    }
  }
  for (i = 0; i < 13; i++) cout << b1[i];
  cout << endl;
  for (i = 0; i < 13; i++) cout << b2[i];
  return 0;
}
