#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, t = "";
  int a, b;
  cin >> s;
  for (int i = 0; i < 26; i++) {
    for (int j = i + 1; j < 27; j++) {
      if (s[i] == s[j]) {
        a = i;
        b = j;
        break;
      }
    }
  }
  int n = b - a;
  if (n == 1) {
    cout << "Impossible" << endl;
  } else {
    int m = (n + 1) / 2;
    for (int i = 0; i < 27; i++)
      if (i != b) {
        t += s[i];
      }
    for (int i = 0; i < 13; i++) {
      cout << t[(a + 13 + m + i) % 26];
    }
    cout << endl;
    for (int i = -1; i > -14; i--) {
      cout << t[(a + 13 + m + i) % 26];
    }
    cout << endl;
  }
}
