#include <bits/stdc++.h>
char s[30], ans[30];
int pos[30];
int main() {
  scanf("%s", s);
  std::fill(pos, pos + 26, -1);
  int x = 0, y = 0;
  for (int i = 0; i < 27; i++) {
    if (pos[s[i] - 'A'] >= 0) {
      x = pos[s[i] - 'A'];
      y = i;
      break;
    } else {
      pos[s[i] - 'A'] = i;
    }
  }
  int d = y - x;
  if (d <= 1) {
    printf("Impossible\n");
  } else {
    int i = 0;
    for (int p = 13 - (d / 2) - x; i < x; i++, p++) {
      ans[p < 0 ? 12 - p : p] = s[i];
    }
    for (int p = 26 - ((d + 1) / 2); p < 26; i++, p++) {
      ans[p] = s[i];
    }
    for (int p = 12; i < y; i++, p--) {
      ans[p] = s[i];
    }
    i++;
    for (int p = 26 - ((d + 1) / 2) - 1; p >= 13 && i < 27; i++, p--) {
      ans[p] = s[i];
    }
    for (int p = 0; i < 27; i++, p++) {
      ans[p] = s[i];
    }
    for (int i = 0; i < 2; i++) {
      for (int j = 0; j < 13; j++) {
        printf("%c", ans[13 * i + j]);
      }
      printf("\n");
    }
  }
  return 0;
}
