#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 100;
const int SQRTN = 320;
const int LOGN = 20;
const double PI = acos(-1);
string s;
char best;
string a[2] = {"AAAAAAAAAAAAA", "AAAAAAAAAAAAA"};
int freq[27];
int main() {
  cin >> s;
  freq[s[0] - 'A']++;
  for (int i = 1; i < s.size(); i++) {
    if (freq[s[i] - 'A']) {
      best = s[i];
    }
    freq[s[i] - 'A']++;
    if (s[i] == s[i - 1]) {
      return puts("Impossible");
    }
  }
  int fi, si;
  fi = si = -1;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == best) {
      if (fi == -1)
        fi = i;
      else
        si = i;
    }
  }
  string s1, s2, s3;
  s1 = s2 = s3 = "";
  for (int i = 0; i < fi; i++) s1 += s[i];
  for (int i = fi + 1; i < si; i++) s2 += s[i];
  for (int i = si + 1; i < s.size(); i++) s3 += s[i];
  s1 = s3 + s1;
  if (s1.size() & 1) {
    swap(s1, s2);
  }
  int idx = s1.size() >> 1;
  idx--;
  int j = 0;
  for (int i = 0; i < s1.size(); i++) {
    a[j][idx] = s1[i];
    idx += j ? 1 : -1;
    if (idx == -1) {
      idx++;
      j++;
    }
  }
  idx = s1.size() >> 1;
  j = 0;
  for (int i = 0; i < s2.size(); i++) {
    a[j][idx] = s2[i];
    idx -= j ? 1 : -1;
    if (idx == 13) {
      idx--;
      j++;
    }
  }
  a[j][idx] = best;
  cout << a[0] << endl << a[1] << endl;
  return 0;
}
