#include <bits/stdc++.h>
using namespace std;
int num[300], n1, n2;
char s[30], ch;
bool flag;
char mp[2][30];
int main(void) {
  scanf("%s", s);
  for (int i = 0; i < 27; ++i) {
    num[s[i]]++;
    if (num[s[i]] == 2) ch = s[i];
  }
  for (int time = 1, i = 0; i < 27; ++i) {
    if (ch == s[i]) {
      if (time) {
        n1 = i;
        time = 0;
      } else
        n2 = i;
    }
  }
  if (n2 - n1 == 1)
    printf("Impossible\n");
  else {
    int t, index = (n2 - n1 - 1) / 2;
    t = index;
    int i = n1;
    for (; index >= 0; --index) {
      mp[0][index] = s[i];
      i = (i + 1) % 27;
    }
    for (index = 0; index < 13;) {
      if (s[i] != s[n1]) {
        mp[1][index] = s[i];
        ++index;
      }
      i = (i + 1) % 27;
    }
    for (index = 12; index != t; --index) {
      mp[0][index] = s[i];
      i = (i + 1) % 27;
    }
    for (int i = 0; i < 13; ++i) printf("%c", mp[0][i]);
    printf("\n");
    for (int i = 0; i < 13; ++i) printf("%c", mp[1][i]);
    printf("\n");
  }
}
