#include <bits/stdc++.h>
using namespace std;
char arr1[13];
char arr2[13];
int i, j, k;
void solve() {
  string s;
  cin >> s;
  vector<int> v(26, 0);
  char c;
  for (i = 0; i < 27; i += 1) {
    if (v[s[i] - 65] == 1)
      c = s[i];
    else
      v[s[i] - 65]++;
  }
  vector<int> v1;
  for (i = 0; i < 27; i += 1)
    if (s[i] == c) v1.push_back(i);
  int d = v1[1] - v1[0] - 1;
  if (!d) {
    !printf("Impossible");
    return;
  }
  int a1 = v1[0], a2 = v1[1];
  arr1[12 - d / 2] = c;
  for (i = 1; i <= d / 2; i++) arr1[12 - d / 2 + i] = s[a1 + i];
  for (i = 0; i < d / 2 + d % 2; i++) {
    arr2[12 - i] = s[a1 + d / 2 + 1 + i];
  }
  if (26 - a2 <= 13 - (d / 2 + d % 2)) {
    for (i = 1; i <= 26 - a2; i++) {
      arr2[13 - d / 2 - d % 2 - i] = s[a2 + i];
    }
    int y = 13 - (d / 2 + d % 2) - (26 - a2);
    int j = 0;
    for (i = y - 1; i >= 0; i--) {
      arr2[i] = s[j];
      j++;
    }
    for (i = 0; i < a1; i++) {
      arr1[i] = s[y + i];
    }
  } else {
    int j = 1;
    for (i = 12 - d / 2 - d % 2; i > -1; i--) {
      arr2[i] = s[a2 + j];
      j++;
    }
    int x = 26 - a2 - (13 - d / 2 - d % 2);
    for (i = 0; i < x; i++) {
      arr1[i] = s[a2 + 13 - d / 2 - d % 2 + i + 1];
    }
    j = 0;
    for (i = 0; i < a1; i++) {
      arr1[x + i] = s[i];
    }
  }
  for (i = 0; i < 13; i++) printf("%c", arr1[i]);
  printf("\n");
  for (i = 0; i < 13; i++) printf("%c", arr2[i]);
}
int main() {
  int t = 1;
  while (t--) solve();
  return 0;
}
