#include <bits/stdc++.h>
using namespace std;
int num[66], gg;
char s[30];
char ans[3][30];
int main() {
  scanf("%s", s);
  for (int i = 0; i <= 26; i++) {
    if (num[s[i] - 'A'])
      gg = i;
    else
      num[s[i] - 'A'] = i + 1;
    if (s[i] == s[i + 1]) {
      cout << "Impossible" << endl;
      return 0;
    }
  }
  int a = num[s[gg] - 'A'] - 1, b = gg - a - 1, c = 27 - gg - 1;
  int t1 = b / 2, t2 = 1;
  ans[t2][t1] = s[gg];
  for (int i = a + 1; i < gg; i++) {
    if (t1 == 0 && t2 == 1)
      t2 = 2;
    else {
      if (t2 == 1)
        t1--;
      else
        t1++;
    }
    ans[t2][t1] = s[i];
  }
  t1 = b / 2, t2 = 1;
  for (int i = a - 1; i >= 0; i--) {
    if (t1 == 12 && t2 == 1)
      t2 = 2;
    else {
      if (t2 == 1)
        t1++;
      else
        t1--;
    }
    ans[t2][t1] = s[i];
  }
  for (int i = 26; i > gg; i--) {
    if (t1 == 12 && t2 == 1)
      t2 = 2;
    else {
      if (t2 == 1)
        t1++;
      else
        t1--;
    }
    ans[t2][t1] = s[i];
  }
  for (int i = 1; i <= 2; i++) printf("%s\n", ans[i]);
  return 0;
}
