#include <bits/stdc++.h>
using namespace std;
int a[26];
int main() {
  string s;
  cin >> s;
  char ch;
  int rep1, fg = 0, rep2;
  memset(a, -1, sizeof(a));
  for (int i = 0; i < 27; i++) {
    ch = s[i];
    if (a[ch - 'A'] == -1)
      a[ch - 'A'] = i;
    else if (a[ch - 'A'] != -1 && fg == 0) {
      rep1 = a[ch - 'A'];
      fg = 1;
      rep2 = i;
    } else {
      cout << "Impossible";
      return 0;
    }
  }
  if (rep2 == rep1 + 1) {
    cout << "Impossible";
    return 0;
  }
  string st1 = "abcdefghijklm";
  string st2 = "abcdefghijklm";
  int d = rep2 - rep1 - 1;
  int x = 12 - d / 2;
  if (d % 2) {
    int i, j, k;
    for (i = x, k = rep1; i < 13; i++) {
      st1[i] = s[k];
      k = (k + 1) % 27;
    }
    for (j = 12; j >= x; j--) {
      st2[j] = s[k];
      k = (k + 1) % 27;
    }
    k = (k + 1) % 27;
    for (j = x - 1; j >= 0; j--) {
      st2[j] = s[k];
      k = (k + 1) % 27;
    }
    for (i = 0; i < x; i++) {
      st1[i] = s[k];
      k = (k + 1) % 27;
    }
  } else {
    int i, k;
    for (i = x, k = rep1; i < 13; i++) {
      st1[i] = s[k];
      k = (k + 1) % 27;
    }
    for (int j = 12; j > x; j--) {
      st2[j] = s[k];
      k = (k + 1) % 27;
    }
    k = (k + 1) % 27;
    for (int j = x; j >= 0; j--) {
      st2[j] = s[k];
      k = (k + 1) % 27;
    }
    for (i = 0; i < x; i++) {
      st1[i] = s[k];
      k = (k + 1) % 27;
    }
  }
  cout << st1 << endl << st2;
  return 0;
}
