#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
char s[33];
int num[33];
char mp[3][14];
int main() {
  while (scanf("%s", s + 1) != EOF) {
    memset(num, 0, sizeof(num));
    int id;
    for (int i = 1; i <= 27; i++) {
      num[s[i] - 'A']++;
      if (num[s[i] - 'A'] == 2) {
        id = s[i] - 'A';
      }
    }
    int st = -1, ed = -1;
    for (int i = 1; i <= 27; i++) {
      int x = s[i] - 'A';
      if (x == id) {
        if (st == -1)
          st = i;
        else
          ed = i;
      }
    }
    if (ed - st == 1) {
      printf("Impossible\n");
      continue;
    }
    int len = ed - st - 1;
    int L = st - 1, R = len / 2, cnt = 1;
    if (L + R + 1 <= 13) {
      for (int i = 13 - R - 1 - L + 1; i <= 13 - R - 1; i++) {
        mp[1][i] = s[cnt++];
      }
      mp[1][13 - R] = s[cnt++];
      for (int i = 13 - R + 1; i <= 13; i++) mp[1][i] = s[cnt++];
      int now = 13;
      for (int i = len - R; i >= 1; i--) mp[2][now--] = s[cnt++];
      cnt++;
      for (int i = now; i >= 1; i--) mp[2][i] = s[cnt++];
      now = 1;
      for (int i = cnt; i <= 27; i++) mp[1][now++] = s[i];
    } else {
      int lef = L + R + 1 - 13;
      for (int i = lef; i >= 1; i--) {
        mp[2][i] = s[cnt++];
      }
      for (int i = 1; i <= L - lef; i++) mp[1][i] = s[cnt++];
      mp[1][L - lef + 1] = s[cnt++];
      int now = L - lef + 2;
      for (int i = 1; i <= R; i++) mp[1][now++] = s[cnt++];
      now = 13;
      for (int i = len - R; i >= 1; i--) mp[2][now--] = s[cnt++];
      cnt++;
      for (int i = cnt; i <= 27; i++) mp[2][now--] = s[i];
    }
    for (int i = 1; i <= 2; i++) {
      for (int j = 1; j <= 13; j++) printf("%c", mp[i][j]);
      printf("\n");
    }
  }
  return 0;
}
