#include <bits/stdc++.h>
using namespace std;
string s;
char c, f[20][20];
int d;
int a[255] = {0};
bool dd[255] = {0};
void add(int k, char c) {
  k--;
  f[k / 2][k % 2] = c;
}
int main() {
  cin >> s;
  s += s;
  for (int i = 0; i < 27; i++) {
    if (dd[s[i]]) {
      d = a[s[i]];
      c = s[i];
    }
    dd[s[i]] = true;
    a[s[i]] = i;
    if (i > 0)
      if (s[i] == s[i - 1]) {
        cout << "Impossible";
        return 0;
      }
  }
  add(a[c] - d, c);
  int j = a[c] - d - 1;
  for (int i = d + 1; i < a[c] && j > 0; i++, j -= 2) add(j, s[i]);
  j = a[c] - d - 2;
  for (int i = a[c] - 1; i > d && j > 0; i--, j -= 2) add(j, s[i]);
  j = a[c] - d + 1;
  for (int i = a[c] + 1; i < 27 + d && j <= 26; i++, j += 2) add(j, s[i]);
  j = a[c] - d + 2;
  for (int i = 26 + d; i > a[c] && j <= 26; i--, j += 2) add(j, s[i]);
  for (int i = 0; i < 13; i++) cout << f[i][0];
  cout << endl;
  for (int i = 0; i < 13; i++) cout << f[i][1];
}
