#include <bits/stdc++.h>
using namespace std;
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
char a[2][13];
int main() {
  string s;
  cin >> s;
  int x, y;
  char ch;
  for (int i = s.size() - 1; i >= 0; i--) {
    int pos = s.find(s[i]);
    if (pos != -1 && pos != i) {
      ch = s[i];
      x = pos, y = i;
      break;
    }
  }
  int dis = y - x;
  s.erase(s.begin() + y);
  if (dis == 1) {
    cout << "Impossible" << endl;
    return 0;
  }
  if (dis % 2) {
    int p = 13 - dis / 2 - 1;
    a[0][p] = ch;
    int p1 = x;
    int d = 0;
    for (int i = p; i > max(p - x, -1); i--) a[1][i] = s[--p1];
    while (p1) a[0][d++] = s[--p1];
    p1 = x + 1;
    for (int i = p + 1; i < 13; i++) a[0][i] = s[p1++];
    for (int i = 12; i > p; i--) a[1][i] = s[p1++];
    for (int i = p - 1; i >= 0 && p1 < s.size(); i--) a[0][i] = s[p1++];
    for (int i = 0; i <= p - x && p1 < s.size(); i++) a[1][i] = s[p1++];
  } else {
    int p = 13 - dis / 2;
    a[0][p] = ch;
    int p1 = x;
    int d = 0;
    for (int i = p - 1; i > max(p - 1 - x, -1); i--) a[1][i] = s[--p1];
    while (p1) a[0][d++] = s[--p1];
    p1 = x + 1;
    for (int i = p + 1; i < 13; i++) a[0][i] = s[p1++];
    for (int i = 12; i >= p; i--) a[1][i] = s[p1++];
    for (int i = p - 1; i >= 0 && p1 < s.size(); i--) a[0][i] = s[p1++];
    for (int i = 0; i <= p - 1 - x && p1 < s.size(); i++) a[1][i] = s[p1++];
  }
  for (int i = 0; i < 2; i++) {
    for (int j = 0; j < 13; j++) cout << a[i][j];
    cout << endl;
  }
  return 0;
}
