#include <bits/stdc++.h>
using namespace std;
const int N = 200007, M = 200001, mod = 1000000007, inf = 1000000007;
const long long lmod = 1000000007, linf = 1e18 + 77;
const long double eps = 1e-9;
string s;
int id[N];
bool used[N];
char ans[3][100];
int main() {
  ios_base::sync_with_stdio(0);
  cin >> s;
  char c;
  for (int i = 0; i < 27; i++) {
    if (used[s[i]]) {
      c = s[i];
    } else {
      used[s[i]] = 1;
    }
  }
  int l = -1, r;
  for (int i = 0; i < 27; i++) {
    if (s[i] == c) {
      if (l == -1)
        l = i;
      else
        r = i;
    }
  }
  int delta = r - l;
  if (r - l == 1) {
    cout << "Impossible" << endl;
    return 0;
  }
  delta--;
  string L;
  string M;
  string R;
  for (int i = 0; i < l; i++) {
    L += s[i];
  }
  for (int i = l + 1; i < r; i++) {
    M += s[i];
  }
  for (int i = r + 1; i < 27; i++) {
    R += s[i];
  }
  int st = delta / 2;
  ans[0][st] = c;
  int im = 0;
  for (int j = st - 1; j >= 0; j--) {
    ans[0][j] = M[im];
    im++;
  }
  for (int j = 0; j < st; j++) {
    ans[1][j] = M[im];
    im++;
  }
  if (delta % 2 == 1) {
    ans[1][st] = M[im];
  }
  L = R + L;
  im = 0;
  int i = st;
  if (delta % 2 == 1) {
    i++;
  }
  for (; i < 13; i++) {
    ans[1][i] = L[im];
    im++;
  }
  for (i = 12; i > st; i--) {
    ans[0][i] = L[im];
    im++;
  }
  for (int i = 0; i < 2; i++) {
    for (int j = 0; j < 13; j++) {
      cout << ans[i][j];
    }
    cout << endl;
  }
}
