#include <bits/stdc++.h>
using namespace std;
string s;
int col[26];
char a[13];
char b[13];
int main() {
  srand(time(NULL));
  ios_base::sync_with_stdio(false);
  cin >> s;
  fill(col, col + 26, 0);
  for (int i = 0; i < 27; i++) {
    if (i < 26 && s[i] == s[i + 1]) {
      cout << "Impossible\n";
      return 0;
    }
    col[s[i] - 'A']++;
  }
  int st = -1, en;
  for (int i = 0; i < 27; i++) {
    if (col[s[i] - 'A'] == 2) {
      if (st == -1)
        st = i;
      else
        en = i;
    }
  }
  int j = st;
  for (int i = 13 - (en - st + 1) / 2; i < 13; i++) {
    a[i] = s[j];
    j++;
  }
  for (int i = 12; i >= 13 - (en - st) / 2; i--) {
    b[i] = s[j];
    j++;
  }
  int stop = -1;
  j++;
  for (int i = 13 - (en - st) / 2 - 1; i >= 0; i--) {
    if (j == 27) {
      stop = i;
      break;
    }
    b[i] = s[j];
    j++;
  }
  if (stop != -1) {
    j = 0;
    for (int i = stop; i >= 0; i--) {
      b[i] = s[j];
      j++;
    }
    for (int i = 0; i < 13; i++) {
      if (j == st) break;
      a[i] = s[j];
      j++;
    }
  } else {
    for (int i = 0; i < 13; i++) {
      if (j == 27) {
        stop = i;
        break;
      }
      a[i] = s[j];
      j++;
    }
    j = 0;
    for (int i = stop; i < 13; i++) {
      if (j == st) break;
      a[i] = s[j];
      j++;
    }
  }
  for (int i = 0; i < 13; i++) cout << a[i];
  cout << endl;
  for (int i = 0; i < 13; i++) cout << b[i];
  cout << endl;
  return 0;
}
