#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  char result[13][13];
  memset(result, ' ', sizeof result);
  char c;
  int niza[26];
  int diff = 0;
  int firstO;
  int secondO;
  string s;
  memset(niza, -1, sizeof niza);
  cin >> s;
  for (int i = 0; i < s.size(); i++) {
    if (niza[s[i] - 'A'] == -1) {
      niza[s[i] - 'A'] = i;
    } else {
      diff = i - niza[s[i] - 'A'];
      firstO = niza[s[i] - 'A'];
      c = s[i];
      secondO = i;
    }
  }
  if (diff == 1) {
    cout << "Impossible";
    return 0;
  }
  diff--;
  diff = diff / 2;
  result[0][12 - diff] = c;
  int temp = firstO;
  temp++;
  for (int i = 12 - diff + 1; i < 13; i++) {
    result[0][i] = s[temp];
    temp++;
  }
  int i = 12;
  while (temp < secondO) {
    result[1][i] = s[temp];
    i--;
    temp++;
  }
  temp = secondO + 1;
  i = 0;
  int j = 12 - diff - 1;
  while (temp < 27) {
    if (j < 0) {
      j = 0;
      i++;
    }
    result[i][j] = s[temp];
    temp++;
    if (i == 0)
      j--;
    else
      j++;
  }
  temp = 0;
  while (temp < firstO) {
    if (j < 0) {
      j = 0;
      i++;
    }
    result[i][j] = s[temp];
    temp++;
    if (i == 0)
      j--;
    else
      j++;
  }
  for (int i = 0; i < 2; i++) {
    for (int j = 0; j < 13; j++) {
      cout << result[i][j];
    }
    cout << "\n";
  }
  return 0;
}
