#include <bits/stdc++.h>
char o[28];
int chk[27];
char ans[2][13];
int main() {
  int i, j, n = 27;
  char d;
  bool sw = false;
  int st, ed;
  int x, y;
  int x2, y2;
  int m;
  int tmp;
  scanf("%s", o);
  for (i = 0; i < n; i++) {
    chk[o[i] - 'A']++;
  }
  for (i = 0; i < n; i++) {
    if (chk[o[i] - 'A'] == 2) {
      d = o[i];
      if (sw)
        ed = i;
      else
        st = i;
      sw = !sw;
    }
  }
  if (ed - st == 1) {
    printf("Impossible\n");
    return 0;
  }
  if ((ed - st) & 1) {
    m = ed - st;
    x = m / 2;
    ans[1][x] = d;
    tmp = ed;
    for (i = x - 1; i >= 0; i--) ans[1][i] = o[--tmp];
    for (i = 0; i < x; i++) ans[0][i] = o[--tmp];
    y = x;
    x = 1;
    y2 = y - 1;
    x2 = 0;
  } else {
    m = ed - st;
    x = m / 2;
    ans[1][x - 1] = d;
    tmp = ed;
    for (i = x - 2; i >= 0; i--) ans[1][i] = o[--tmp];
    for (i = 0; i < x; i++) ans[0][i] = o[--tmp];
    y = x - 1;
    x = 1;
    y2 = y;
    x2 = 0;
  }
  sw = false;
  for (i = st - 1; i >= 0; i--) {
    if (sw)
      y--;
    else
      y++;
    if (y == 13) {
      y--;
      x--;
      sw = true;
    }
    ans[x][y] = o[i];
  }
  sw = false;
  for (i = ed + 1; i < n; i++) {
    if (sw)
      y2--;
    else
      y2++;
    if (y2 == 13) {
      x2++;
      y2--;
      sw = true;
    }
    ans[x2][y2] = o[i];
  }
  for (i = 0; i < 2; i++) {
    for (j = 0; j < 13; j++) printf("%c", ans[i][j]);
    printf("\n");
  }
  return 0;
}
