#include <bits/stdc++.h>
using namespace std;
template <class T1, class T2>
inline void gmax(T1 &a, T2 b) {
  if (b > a) a = b;
}
template <class T1, class T2>
inline void gmin(T1 &a, T2 b) {
  if (b < a) a = b;
}
const int N = 100;
const int ms63 = 0x3f3f3f3f;
int casenum, casei;
void fre() { freopen("/home/hyf/Desktop/programs/in.txt", "r", stdin); }
map<char, int> mop;
char s[N], s1[N], s2[N];
int len, flag, st, ed, num, lft, t;
int main() {
  while (~scanf("%s", s)) {
    mop.clear();
    len = strlen(s);
    flag = 0;
    for (int i = 0; i < len; i++) {
      if (mop.find(s[i]) == mop.end()) {
        mop[s[i]] = i;
      } else {
        if (mop[s[i]] != i - 1) {
          flag = 1;
          st = mop[s[i]];
          ed = i;
          break;
        }
      }
    }
    if (!flag)
      puts("Impossible");
    else {
      num = ed - st;
      if (num % 2 == 0) {
        lft = num / 2;
        s2[lft] = s[st];
        t = st;
        for (int i = lft; i >= 1; i--) {
          t++;
          if (t == ed) t++;
          if (t >= 27) t -= 27;
          s1[i] = s[t];
        }
        for (int i = 1; i < lft; i++) {
          t++;
          if (t == ed) t++;
          if (t >= 27) t -= 27;
          s2[i] = s[t];
        }
        for (int i = lft + 1; i <= 13; i++) {
          t++;
          if (t == ed) t++;
          if (t >= 27) t -= 27;
          s1[i] = s[t];
        }
        for (int i = 13; i >= lft + 1; i--) {
          t++;
          if (t == ed) t++;
          if (t >= 27) t -= 27;
          s2[i] = s[t];
        }
      } else {
        lft = num / 2;
        s2[lft + 1] = s[st];
        t = st;
        for (int i = lft; i >= 1; i--) {
          t++;
          if (t == ed) t++;
          if (t >= 27) t -= 27;
          s1[i] = s[t];
        }
        for (int i = 1; i <= lft; i++) {
          t++;
          if (t == ed) t++;
          if (t >= 27) t -= 27;
          s2[i] = s[t];
        }
        for (int i = lft + 1; i <= 13; i++) {
          t++;
          if (t == ed) t++;
          if (t >= 27) t -= 27;
          s1[i] = s[t];
        }
        for (int i = 13; i >= lft + 2; i--) {
          t++;
          if (t == ed) t++;
          if (t >= 27) t -= 27;
          s2[i] = s[t];
        }
      }
      printf("%s\n%s\n", s1 + 1, s2 + 1);
    }
  }
  return 0;
}
