#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  string s;
  cin >> s;
  int n = ((int)(s).size());
  assert(n == 27);
  pair<int, int> same;
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      if (s[i] == s[j]) {
        same = {i, j};
      }
    }
  }
  string t = s.substr(same.first) + s.substr(0, same.first);
  same.second -= same.first;
  same.first = 0;
  if (same.second == 1) {
    puts("Impossible");
    return 0;
  }
  vector<string> ans(2, string(13, ' '));
  int pos = 12 - (same.second - 1) / 2;
  t.erase(t.begin() + same.second);
  int j = 0;
  for (int i = pos; i < 13; i++) {
    ans[0][i] = t[j++];
  }
  for (int i = 12; i >= 0; i--) {
    ans[1][i] = t[j++];
  }
  for (int i = 0; i < pos; i++) {
    ans[0][i] = t[j++];
  }
  cout << ans[0] << endl << ans[1] << endl;
  return 0;
}
