#include <bits/stdc++.h>
using namespace std;
int arr[26];
char mat[2][13];
int main() {
  bool r = true, l = false;
  char c;
  string s;
  cin >> s;
  for (int i = 0; i < s.size(); i++) arr[s[i] - 'A']++;
  for (int i = 0; i < s.size() - 1; i++)
    if (s[i] == s[i + 1]) {
      cout << "Impossible" << endl;
      return 0;
    }
  for (int i = 0; i < 26; i++)
    if (arr[i] == 2) c = 'A' + i;
  int cnt = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == c) {
      i++;
      while (s[i] != c) cnt++, i++;
      break;
    }
  }
  int indx = 0;
  for (int i = 0; i < s.size(); i++)
    if (s[i] == c) {
      indx = i;
      break;
    }
  int i = indx, j, k;
  if (cnt % 2 == 0) {
    mat[0][12 - cnt / 2] = s[i];
    j = 1, k = 13 - cnt / 2;
  } else {
    mat[0][13 - (cnt + 1) / 2] = s[i];
    j = 1, k = 13 - (cnt + 1) / 2;
  }
  for (i = i + 1; i <= 26; i++) {
    if (k > 12)
      k = 12, j = 1 - j, r = !r, l = !l;
    else if (k < 0)
      k = 0, j = 1 - j, r = !r, l = !l;
    if (mat[j][k] == c) {
      mat[j][k] = s[i];
      if (cnt % 2 == 0)
        j = 1 - j, k++;
      else
        j = 1 - j;
    } else {
      mat[j][k] = s[i];
    }
    if (r)
      k++;
    else
      k--;
  }
  for (i = 0; i < indx; i++) {
    if (k > 12)
      k = 12, j = 1 - j, r = !r, l = !l;
    else if (k < 0)
      k = 0, j = 1 - j, r = !r, l = !l;
    if (mat[j][k] == c) {
      mat[j][k] = s[i];
      if (cnt % 2 == 0)
        j = 1 - j, k++;
      else
        j = 1 - j;
    } else {
      mat[j][k] = s[i];
    }
    if (r)
      k++;
    else
      k--;
  }
  for (i = 0; i < 2; i++) {
    for (j = 0; j < 13; j++) {
      cout << mat[i][j];
    }
    cout << endl;
  }
  return 0;
}
