#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  vector<int> count(1000, 0);
  for (int i = (0); i < (s.size()); i++) {
    count[int(s[i])]++;
  }
  char rep;
  for (int i = (int('A')); i < (int('Z') + 1); i++) {
    if (count[i] == 2) rep = char(i);
  }
  int pos1 = -1;
  int pos2;
  for (int i = (0); i < (s.size()); i++) {
    if (s[i] == rep && pos1 == -1)
      pos1 = i;
    else if (s[i] == rep)
      pos2 = i;
  }
  if (pos2 - pos1 == 1) {
    cout << "Impossible" << endl;
    return 0;
  }
  vector<char> res(26);
  int put = 12 - (pos2 - pos1 - 1) / 2;
  res[put] = rep;
  put++;
  int donde = pos1 + 1;
  while (donde != pos1) {
    res[put] = s[donde];
    donde++;
    put++;
    if (donde == pos2) donde++;
    put = put % 26;
    donde = donde % 27;
  }
  for (int i = (0); i < (13); i++) {
    cout << res[i];
  }
  cout << endl;
  for (int i = (0); i < (13); i++) {
    cout << res[25 - i];
  }
  cout << endl;
  return 0;
}
