#include <bits/stdc++.h>
using namespace std;
char s[32], s1[14], s2[14], d;
int x[256], a, b, c, i, j, cnt1, cnt2;
int main() {
  scanf("%s", s);
  memset(x, 0xff, sizeof(x));
  for (i = 0; i < 27; i++) {
    if (-1 != x[s[i]]) {
      a = x[s[i]], b = i;
      d = s[i];
      break;
    } else
      x[s[i]] = i;
  }
  if (a + 1 == b) {
    puts("Impossible");
    return 0;
  }
  c = (a + b + 1) / 2;
  for (i = c - 1, j = 12; i >= 0 && j >= 0; i--, j--) s1[j] = s[i], cnt1++;
  for (i = c, j = 12; i < 27 && j >= 0; i++) {
    if (s[i] != d) s2[j--] = s[i], cnt2++;
  }
  if (cnt1 < 13) {
    for (int u = 0; i < 27; i++, u++) s1[u] = s[i];
  } else if (cnt2 < 13) {
    for (int u = 0, v = 12 - cnt2; v >= 0; u++, v--) s2[v] = s[u];
  }
  puts(s1);
  puts(s2);
  return 0;
}
