#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000009;
int counter[256];
char path[30], ans[2][30];
int main() {
  scanf("%s", path);
  char S;
  int first = -1, second = -1;
  for (int i = 'A'; i <= 'Z'; i++) counter[i] = -1;
  for (int i = 0; i < 27; i++) {
    if (counter[path[i]] != -1) {
      S = path[i];
      first = counter[path[i]];
      second = i;
      break;
    }
    counter[path[i]] = i;
  }
  int dif = second - first;
  if (dif == 1) {
    puts("Impossible");
    return 0;
  }
  int pos = 12 - (dif - 1) / 2;
  ans[0][pos] = S;
  int pos2 = pos + 1;
  int add = 1, ind = 0;
  for (int i = first + 1; i < second; i++) {
    if (pos2 > 12) {
      add = -1;
      ind = 1;
      pos2--;
    }
    if (pos2 < 0) {
      add = 1;
      ind = 0;
      pos2++;
    }
    ans[ind][pos2] = path[i];
    pos2 += add;
  }
  for (int i = second + 1; i < 27; i++) {
    if (pos2 > 12) {
      add = -1;
      ind = 1;
      pos2--;
    }
    if (pos2 < 0) {
      add = 1;
      ind = 0;
      pos2++;
    }
    ans[ind][pos2] = path[i];
    pos2 += add;
  }
  for (int i = 0; i < first; i++) {
    if (pos2 > 12) {
      add = -1;
      ind = 1;
      pos2--;
    }
    if (pos2 < 0) {
      add = 1;
      ind = 0;
      pos2++;
    }
    ans[ind][pos2] = path[i];
    pos2 += add;
  }
  printf("%s\n%s\n", ans[0], ans[1]);
  return 0;
}
