#include <bits/stdc++.h>
using namespace std;
map<char, int> mp;
char a[20], b[20];
int main() {
  a[0] = ' ';
  b[0] = ' ';
  string s;
  cin >> s;
  s = ' ' + s;
  int n = s.size() - 1, pos1, pos2, len, cnt = 0;
  for (int i = 1; i <= n; i++) {
    if (s[i] == s[i + 1]) {
      puts("Impossible");
      return 0;
    }
    if (mp[s[i]]) {
      pos1 = mp[s[i]];
      pos2 = i;
      break;
    }
    mp[s[i]] = i;
  }
  len = pos2 - pos1 - 1;
  int i;
  for (i = 13; i > 13 - len / 2; i--)
    a[13 - len / 2 + (14 - i)] = s[pos2 - (14 - i)];
  for (i = 13; i > 13 - (len + 1) / 2; i--)
    b[13 - (len + 1) / 2 + (14 - i)] = s[pos1 + (14 - i)];
  a[13 - len / 2] = s[pos1];
  for (int i = 13 - len / 2 - 1; pos1 - ((13 - len / 2) - i) >= 1; i--) {
    if (i >= 1)
      a[i] = s[pos1 - ((13 - len / 2) - i)];
    else
      b[abs(i) + 1] = s[pos1 - ((13 - len / 2) - i)];
  }
  for (int i = 13 - (len + 1) / 2;
       pos2 + ((13 - (len + 1) / 2) - i) + 1 < s.size(); i--) {
    if (i >= 1)
      b[i] = s[pos2 + ((13 - (len + 1) / 2) - i) + 1];
    else
      a[abs(i) + 1] = s[pos2 + ((13 - (len + 1) / 2) - i) + 1];
  }
  for (int i = 1; i <= 13; i++)
    if (isalpha(a[i])) cout << a[i];
  cout << endl;
  for (int i = 1; i <= 13; i++)
    if (isalpha(b[i])) cout << b[i];
}
