#include <bits/stdc++.h>
using namespace std;
int vt[40], mt[3][15], a, b;
char s[40];
int main() {
  scanf("%s", s);
  for (int i = 0; i <= 28; i++) vt[i] = -1;
  for (int i = 0; i <= 26; i++)
    if (vt[s[i] - 'A'] == -1)
      vt[s[i] - 'A'] = i;
    else {
      if (vt[s[i] - 'A'] == i - 1) {
        printf("Impossible");
        return 0;
      }
      a = vt[s[i] - 'A'];
      b = i;
      break;
    }
  int so = (b - a - 1) / 2;
  for (int i = a; i <= a + so; i++) mt[1][13 - so + i - a] = s[i] - 'A';
  for (int i = a + so + 1; i <= b - 1; i++)
    mt[2][13 - i + (a + so + 1)] = s[i] - 'A';
  int vt = 13 - so - 1, dem = 1;
  while (vt > 0) {
    mt[1][vt] = s[a - dem] - 'A';
    vt--;
    dem++;
    if (a - dem < 0) break;
  }
  vt = 1;
  while (a - dem >= 0) {
    mt[2][vt] = s[a - dem] - 'A';
    vt++;
    dem++;
  }
  if ((b - a - 1) % 2 != 0)
    vt = so + 1;
  else
    vt = so;
  vt = 13 - so;
  if ((a - b - 1) % 2 != 0) vt--;
  dem = b + 1;
  while (dem <= 26) {
    mt[2][vt] = s[dem] - 'A';
    vt--;
    dem++;
    if (vt == 0) break;
  }
  vt = 1;
  while (dem <= 26) {
    mt[1][vt] = s[dem] - 'A';
    dem++;
    vt++;
  }
  for (int i = 1; i <= 13; i++) printf("%c", mt[1][i] + 'A');
  printf("\n");
  for (int i = 1; i <= 13; i++) printf("%c", mt[2][i] + 'A');
  return 0;
}
