#include <bits/stdc++.h>
using namespace std;
struct debugger {
  template <typename T>
  debugger& operator,(const T& v) {
    cout << v << " ";
    return *this;
  }
} dbg;
using namespace std;
int main() {
  string a;
  cin >> a;
  for (int i = 0; i < 26; i++) {
    if (a[i] == a[i + 1]) {
      cout << "Impossible\n";
      return 0;
    }
  }
  pair<int, int> repetition;
  int where[26];
  memset(where, -1, sizeof where);
  for (int i = 0; i < 27; i++) {
    if (where[a[i] - 'A'] != -1) {
      repetition = make_pair(where[a[i] - 'A'], i);
      break;
    } else {
      where[a[i] - 'A'] = i;
    }
  }
  int dist = repetition.second - repetition.first - 1;
  int start = 12 - (dist / 2);
  char ans[2][13];
  int current = repetition.first;
  for (int j = start; j < 13; j++) {
    ;
    ans[0][j] = a[current];
    current++;
    current %= 27;
  }
  for (int j = 12; j >= 0; j--) {
    ;
    if (current != repetition.second)
      ans[1][j] = a[current];
    else
      j++;
    current++;
    current %= 27;
  }
  for (int i = 0; i < start; i++) {
    ;
    ans[0][i] = a[current];
    current++;
    current %= 27;
  }
  for (int i = 0; i < 2; i++) {
    for (int j = 0; j < 13; j++) {
      cout << ans[i][j];
    }
    cout << endl;
  }
}
