#include <bits/stdc++.h>
using namespace std;
using lint = long long;
int main() {
  string s;
  cin >> s;
  vector<int> v(27, -1);
  char cc = 0;
  int c1pos = -1;
  int c2pos = -1;
  for (int i = 0; i < s.length(); i++) {
    if (i > 0 && s[i - 1] == s[i]) {
      cout << "Impossible";
      return 0;
    }
    if (v[s[i] - 'A'] == -1) {
      v[s[i] - 'A'] = i;
    } else {
      cc = s[i];
      c2pos = i;
      c1pos = v[s[i] - 'A'];
      s.erase(s.begin() + i);
      break;
    }
  }
  int mid = (c2pos + c1pos) / 2 + ((c2pos + c1pos) % 2 == 0 ? 0 : 1);
  for (int i = mid; i < min(26, mid + 13); i++) {
    cout << s[i];
  }
  for (int i = 0; i < mid - 13; i++) {
    cout << s[i];
  }
  cout << endl;
  for (int i = mid - 1; i >= max(0, mid - 13); i--) {
    cout << s[i];
  }
  for (int i = 26 - 1; i >= mid + 13; i--) {
    cout << s[i];
  }
  cout << endl;
  return 0;
}
