#include <bits/stdc++.h>
using namespace std;
string s;
int p, p1, p2, pos[256];
char ans[3][14];
int main() {
  ios::sync_with_stdio(0);
  cin >> s;
  for (int i = 0; i < 256; ++i) pos[i] = -1;
  for (int i = 0; i < s.length(); ++i) {
    if (pos[s[i]] != -1) p1 = pos[s[i]], p2 = i;
    pos[s[i]] = i;
  }
  if (p1 + 1 == p2) return cout << "Impossible", 0;
  int shift = (12 - p1) - (p2 - p1 - 1) / 2;
  if (shift < 0) {
    shift = -shift;
    for (int i = shift - 1; i >= 0; --i)
      if (s[p] != s[p1])
        ans[1][i] = s[p++];
      else
        ++p, ++i;
    for (int i = 0; i < 13; ++i) ans[0][i] = s[p++];
    for (int i = 12; i >= shift; --i)
      if (s[p] != s[p1])
        ans[1][i] = s[p++];
      else
        ++p, ++i;
  } else {
    for (int i = shift; i < 13; ++i) ans[0][i] = s[p++];
    for (int i = 12; i >= 0; --i)
      if (s[p] != s[p1])
        ans[1][i] = s[p++];
      else
        ++p, ++i;
    for (int i = 0; i < shift; ++i) ans[0][i] = s[p++];
  }
  for (int i = 0; i < 2; ++i) {
    for (int j = 0; j < 13; ++j) cout << ans[i][j];
    cout << endl;
  }
  return 0;
}
