#include <bits/stdc++.h>
using namespace std;
int main(void) {
  string str;
  cin >> str;
  char x;
  int arr[26];
  memset(arr, 0, sizeof(arr));
  for (int i = 0; i < 27; i++) {
    arr[str[i] - 'A']++;
    if (arr[str[i] - 'A'] == 2) x = str[i];
  }
  int jarak = -1;
  int pos[2];
  pos[0] = pos[1] = -1;
  for (int i = 0; i < 27; i++) {
    if (str[i] == x) {
      if (pos[0] == -1)
        pos[0] = i;
      else
        pos[1] = i;
    }
  }
  jarak = pos[1] - pos[0];
  if (jarak == 1) {
    printf("Impossible");
    return 0;
  }
  string ret[2];
  ret[0].assign(13, '.');
  ret[1].assign(13, '.');
  int ct = 0;
  int st = (jarak + 1) / 2;
  int cur = pos[0];
  for (int i = 13 - st; i < 13; i++) {
    ret[0][i] = str[cur];
    ct++;
    cur = (cur + 1) % 27;
  }
  for (int i = 12; i >= 0; i--) {
    if (cur == pos[1]) {
      i++;
      cur = (cur + 1) % 27;
      continue;
    }
    ret[1][i] = str[cur];
    cur = (cur + 1) % 27;
    ct++;
  }
  int z = 0;
  while (ct < 27) {
    ret[0][z] = str[cur];
    cur = (cur + 1) % 27;
    z++;
    ct++;
  }
  cout << ret[0] << endl << ret[1];
  return 0;
}
