#include <bits/stdc++.h>
using namespace std;
pair<int, int> step(int r, int c) {
  if (r == 0) {
    if (c == 12)
      return make_pair(1, 12);
    else
      return make_pair(0, c + 1);
  } else {
    if (c == 0)
      return make_pair(0, 0);
    else
      return make_pair(1, c - 1);
  }
}
int main() {
  ios::sync_with_stdio(false);
  string s;
  cin >> s;
  int *x = new int[26];
  fill(x, x + 26, 0);
  for (int i = 0; i < 27; ++i) ++x[s[i] - 'A'];
  int begin = -1, end;
  for (int i = 0; i < 27; ++i) {
    if (x[s[i] - 'A'] == 2) {
      if (begin == -1)
        begin = i;
      else
        end = i;
    }
  }
  int **t = new int *[2];
  t[0] = new int[13];
  t[1] = new int[13];
  int f = end - begin - 1;
  if (f == 0) {
    cout << "Impossible" << endl;
    return 0;
  }
  int r = 0;
  int c = 12 - f / 2;
  t[r][c] = begin;
  for (int i = begin + 1; i != begin; i = (i + 1) % 27) {
    if (i != end) {
      pair<int, int> z = step(r, c);
      r = z.first, c = z.second;
      t[r][c] = i;
    }
  }
  for (int i = 0; i < 13; ++i) cout << s[t[0][i]];
  cout << endl;
  for (int i = 0; i < 13; ++i) cout << s[t[1][i]];
  cout << endl;
  return 0;
}
