#include <bits/stdc++.h>
char ans[2][14], s[30];
int cnt[26];
int main() {
  scanf("%s", s);
  for (int i = 0; i <= 26; i++) {
    cnt[s[i] - 'A']++;
  }
  int letter, p1 = -1, p2 = -1;
  for (int i = 0; i < 26; i++) {
    if (cnt[i] == 2) {
      letter = i;
      break;
    }
  }
  for (int i = 0; i <= 26; i++) {
    if (s[i] == 'A' + letter) {
      if (p1 == -1)
        p1 = i;
      else
        p2 = i;
    }
  }
  if (p2 - p1 == 1)
    printf("Impossible\n");
  else {
    int dif = p2 - p1;
    int hang = (dif - 1) % 2, lie = 12 - (dif - 1) / 2;
    ans[hang][lie] = 'A' + letter;
    int nowhang = hang, nowlie = lie;
    int st = p1 + 1;
    if ((dif - 1) % 2) {
      nowhang = 0;
      ans[0][lie] = s[p1 + 1];
      st++;
    }
    nowlie++;
    for (int i = st; i < p2; i++) {
      ans[nowhang][nowlie] = s[i];
      if (nowhang == 1)
        nowlie--;
      else if (nowlie == 12)
        nowhang = 1 - nowhang;
      else
        nowlie++;
    }
    nowhang = 0;
    nowlie = lie - 1;
    if (nowlie < 0) {
      nowhang = 1;
      nowlie = 0;
    }
    for (int i = p2 + 1; i <= 26; i++) {
      ans[nowhang][nowlie] = s[i];
      if (nowhang == 1)
        nowlie++;
      else if (nowlie == 0)
        nowhang = 1 - nowhang;
      else
        nowlie--;
    }
    nowhang = 1;
    nowlie = lie;
    if ((dif - 1) % 2) nowlie--;
    for (int i = p1 - 1; i >= 0; i--) {
      ans[nowhang][nowlie] = s[i];
      if (nowhang == 0)
        nowlie++;
      else if (nowlie == 0)
        nowhang = 1 - nowhang;
      else
        nowlie--;
    }
    for (int i = 0; i < 2; i++) {
      for (int j = 0; j <= 12; j++) {
        printf("%c", ans[i][j]);
      }
      printf("\n");
    }
  }
  return 0;
}
