#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int index[30];
  cin >> s;
  memset(index, -1, sizeof(index));
  int start, end;
  for (int i = 0; i < 27; i++) {
    int tmp = s[i] - 'A';
    if (index[tmp] > -1) {
      start = index[tmp];
      end = i;
      break;
    }
    index[tmp] = i;
  }
  char result[2][14];
  if (end - start == 1) {
    printf("Impossible\n");
  } else {
    int a = (end - start - 1) / 2;
    int b = 0;
    for (int i = start; i < end; i++) {
      result[b][a] = s[i];
      if (b == 0) {
        a--;
        if (a < 0) {
          b = 1;
          a = 0;
        }
      } else {
        a++;
      }
    }
    for (int i = end + 1; i < 27; i++) {
      result[b][a] = s[i];
      if (b == 0) {
        a--;
      } else {
        a++;
        if (a >= 13) {
          a = 12;
          b = 0;
        }
      }
    }
    b = 0;
    a = (end - start - 1) / 2;
    for (int i = start - 1; i >= 0; i--) {
      if (b == 0) {
        a++;
        if (a >= 13) {
          a = 12;
          b = 1;
        }
      } else {
        a--;
      }
      result[b][a] = s[i];
    }
    result[0][13] = '\0';
    result[1][13] = '\0';
    printf("%s\n", result[0]);
    printf("%s\n", result[1]);
  }
}
