#include <bits/stdc++.h>
using namespace std;
int dx[] = {0, 1, -1, 0, 1, -1, 1, -1};
int dy[] = {1, 0, 0, -1, -1, 1, 1, -1};
int main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  string s;
  cin >> s;
  map<int, int> idx;
  int st = -1, en = -1;
  for (int i = 0; i < (int)s.size(); i++) {
    if (idx.count(s[i])) st = idx[s[i]], en = i;
    idx[s[i]] = i;
  }
  int d = en - st;
  if (d == 1) {
    cout << "Impossible\n";
    return 0;
  }
  string g[2] = {string(13, '#'), string(13, '#')};
  int up = 13 - (d + 1) / 2, down = 13 - d / 2, ss = st;
  for (int i = up; i < 13; i++) g[0][i] = s[st++];
  for (int i = 12; i >= down; i--) g[1][i] = s[st++];
  int x = 0, y = up - 1, dir = -1;
  for (int i = ss - 1; i >= 0; i--) {
    if (y < 0) y = 0, dir = 1, x = 1;
    g[x][y] = s[i], y += dir;
  }
  x = 1, y = down - 1, dir = -1;
  for (int i = en + 1; i < (int)s.size(); i++) {
    if (y < 0) y = 0, dir = 1, x = 0;
    g[x][y] = s[i], y += dir;
  }
  cout << g[0] << endl << g[1] << endl;
  return 0;
}
