#include <bits/stdc++.h>
using namespace std;
void addmod(int &a, long long b) {
  a = (a + b);
  if (a >= 1000000007) a -= 1000000007;
}
void mulmod(int &a, long long b) { a = (a * b) % 1000000007; }
int gi() {
  int a;
  scanf("%d", &a);
  return a;
}
long long gll() {
  long long a;
  scanf("%lld", &a);
  return a;
}
int gp(int ix) {
  if (ix < 13) {
    ix--;
    if (ix < 0) ix = 13;
  } else {
    ix++;
    if (ix > 25) ix = 12;
  }
  return ix;
}
int gn(int ix) {
  if (ix < 13) {
    ix++;
    if (ix == 13) ix = 25;
  } else {
    ix--;
    if (ix == 12) ix = 0;
  }
  return ix;
}
int main() {
  string s, ans(26, ' ');
  cin >> s;
  vector<int> a(26, 0);
  int ix, tw = -1, on = -1;
  for (int i = 0; i < 27; i++) {
    ix = (s[i] - 'A');
    a[ix]++;
    if (a[ix] > 1) tw = i;
  }
  assert(tw != -1);
  for (int i = 0; i < 27 && on == -1; i++) {
    if (s[i] == s[tw]) on = i;
  }
  assert(on != -1 && on != tw);
  if (tw == (on + 1)) {
    cout << "Impossible" << endl;
    return 0;
  }
  int d = tw - on;
  d = (d + 1) / 2;
  int aix = 13 - d, six = on - 1;
  for (int i = 0; i < 27; i++) {
    six++;
    if (six > 26) six = 0;
    if (six == tw) continue;
    ans[aix] = s[six];
    aix = gn(aix);
  }
  cout << ans.substr(0, 13) << endl;
  cout << ans.substr(13) << endl;
  return 0;
}
