#include <bits/stdc++.h>
using namespace std;
int a, b, c, n, t[30], cnt = 0;
char str[60], f[2][20];
int main() {
  scanf("%s", str + 1);
  for (a = 1; a < 27; a++) {
    if (str[a] == str[a + 1]) break;
    str[a + 27] = str[a];
  }
  if (a < 27)
    puts("Impossible");
  else {
    for (a = 1; a < 28; a++) {
      if (t[str[a] - 'A'] > 0) break;
      t[str[a] - 'A'] = a;
    }
    n = (a - t[str[a] - 'A'] + 1) / 2;
    for (b = a, a = t[str[a] - 'A']; n > 0; a++, n--) f[0][n] = str[a];
    for (n = 1; n < 14; a++, n++) {
      if (str[a] == str[b])
        n--;
      else
        f[1][n] = str[a];
    }
    for (n = 13; f[0][n] < 'A'; a++, n--) f[0][n] = str[a];
    for (a = 1; a < 14; a++) printf("%c", f[0][a]);
    puts("");
    for (a = 1; a < 14; a++) printf("%c", f[1][a]);
  }
  return 0;
}
