#include <bits/stdc++.h>
using namespace std;
int n, m;
char s[100];
char a[2][30];
int f[300];
int main() {
  scanf("%s", s);
  n = 27;
  for (int i = (0); i < (n - 1); i++)
    if (s[i] == s[(i + 1) % n]) {
      puts("Impossible");
      return 0;
    }
  memset(f, -1, sizeof(f));
  int len, pos;
  for (int i = (0); i < (n); i++) {
    if (f[s[i]] != -1) {
      len = i - f[s[i]] - 1;
      pos = f[s[i]];
    }
    f[s[i]] = i;
  }
  queue<char> q;
  for (int i = (0); i < (n); i++) {
    if (!i || (i && s[(pos + i) % n] != s[pos])) q.push(s[(pos + i) % n]);
  }
  a[0][13] = a[1][13] = 0;
  for (int i = len / 2; i >= 0; i--) {
    a[0][i] = q.front();
    q.pop();
  }
  for (int i = 0; i < 13; i++) {
    a[1][i] = q.front();
    q.pop();
  }
  for (int i = 12; q.size(); i--) {
    a[0][i] = q.front();
    q.pop();
  }
  puts(a[0]);
  puts(a[1]);
  return 0;
}
