#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
const int oo = 0x3f3f3f3f;
char s[maxn];
int vis[2][20];
int cnt[30];
char ans[2][20];
int main() {
  int n;
  while (~scanf("%s", s)) {
    memset(cnt, 0, sizeof(cnt));
    memset(vis, 0, sizeof(vis));
    char c;
    int a = -1, b = -1;
    for (int i = 0; i < 27; i++) {
      cnt[s[i] - 'A']++;
      if (cnt[s[i] - 'A'] == 2) {
        c = s[i];
        b = i;
      }
    }
    for (int i = 0; i < 27; i++) {
      if (s[i] == c) {
        a = i;
        break;
      }
    }
    for (int i = 27; i < 53; i++) {
      s[i] = s[i - 27];
    }
    int cnta = a, cntb = b - a - 1;
    int flag = 1;
    if (cntb == 0) {
      puts("Impossible");
      continue;
    } else if (cntb % 2 == 0) {
      ans[0][12 - cntb / 2] = c;
      int p = 12 - cntb / 2;
      for (int i = p + 1, j = a + 1; i < 13; i++, j++) {
        ans[0][i] = s[j];
      }
      for (int i = 12, j = a + cntb / 2 + 1; i >= p + 1; i--, j++) {
        ans[1][i] = s[j];
      }
      for (int i = p, j = a - 1; j >= 0 && i >= 0; i--, j--) {
        ans[1][i] = s[j];
      }
      int i, j;
      for (j = b + 1, i = p - 1; i >= 0; i--, j++) {
        ans[0][i] = s[j];
      }
      for (int i = 0; i <= p - cnta; i++, j++) {
        ans[1][i] = s[j];
      }
    } else {
      cntb--;
      ans[0][12 - cntb / 2] = c;
      ans[1][12 - cntb / 2] = s[b - 1];
      int p = 12 - cntb / 2;
      for (int i = p + 1, j = a + 1; i < 13; i++, j++) {
        ans[0][i] = s[j];
      }
      for (int i = 12, j = a + cntb / 2 + 1; i >= p + 1; i--, j++) {
        ans[1][i] = s[j];
      }
      for (int i = p - 1, j = a - 1; j >= 0 && i >= 0; i--, j--) {
        ans[1][i] = s[j];
      }
      int i, j;
      for (j = b + 1, i = p - 1; i >= 0; i--, j++) {
        ans[0][i] = s[j];
      }
      for (int i = 0; i <= p - cnta - 1; i++, j++) {
        ans[1][i] = s[j];
      }
    }
    for (int i = 0; i < 13; i++) {
      printf("%c", ans[0][i]);
    }
    puts("");
    for (int i = 0; i < 13; i++) {
      printf("%c", ans[1][i]);
    }
    puts("");
  }
}
