#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  string s;
  cin >> s;
  int x = -1, y = -1;
  for (int i = 0; i < s.size(); ++i) {
    for (int j = 0; j < i; ++j) {
      if (s[i] == s[j]) {
        x = j, y = i;
      }
    }
  }
  if (abs(y - x) == 1) {
    cout << "Impossible" << endl;
    return 0;
  }
  int len = y - x;
  char ans[2][13];
  for (int i = 0; i < 13; ++i) {
    ans[0][i] = ans[1][i] = '*';
  }
  for (int i = (len + 1) / 2 - 1; i >= 0; i--) {
    ans[0][i] = s[x + ((len + 1) / 2 - 1 - i)];
  }
  for (int i = 0; i < len - (len + 1) / 2; ++i) {
    ans[1][i] = s[x + (len + 1) / 2 + i];
  }
  int pos0 = (len + 1) / 2, pos1 = len - (len + 1) / 2;
  if (13 - pos0 > x) {
    for (int i = 0; i < x; ++i) {
      ans[0][pos0 + i] = s[x - 1 - i];
    }
    for (int i = pos1; i < 13; ++i) {
      ans[1][i] = s[y + 1 + (i - pos1)];
    }
    for (int i = pos0 + x; i < 13; ++i) {
      ans[0][i] = s[27 - (i - pos0 - x) - 1];
    }
  } else {
    for (int i = 0; i < 13 - pos0; ++i) {
      ans[0][pos0 + i] = s[x - 1 - i];
    }
    for (int i = pos1; i < pos1 + (26 - y); ++i) {
      ans[1][i] = s[y + 1 + (i - pos1)];
    }
    pos1 += 26 - y;
    for (int i = 0; i + pos1 < 13; ++i) {
      ans[1][i + pos1] = s[i];
    }
  }
  for (int i = 0; i < 13; ++i) {
    cout << ans[0][i];
  }
  cout << endl;
  for (int i = 0; i < 13; ++i) {
    cout << ans[1][i];
  }
  cout << endl;
  return 0;
}
