#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 10;
const int MOD = 1e9 + 7;
const int N = 110;
string s;
map<char, int> mp;
char ans[3][N];
int main() {
  ios_base::sync_with_stdio(0);
  cout.tie(0);
  cin.tie(0);
  cin >> s;
  int x = -1;
  int y = -1;
  int n = 13;
  for (int i = 0; i < (int)s.size(); i++) {
    if (mp.count(s[i]) != 0) {
      x = mp[s[i]];
      y = i + 1;
    }
    mp[s[i]] = i + 1;
  }
  x--;
  y--;
  if (y - x == 1)
    cout << "Impossible";
  else {
    int upst = n - (y - x) / 2 + 1;
    int dnen = n - (y - x) / 2 + 1;
    if ((y - x) % 2) upst--;
    int k = 0;
    for (int i = upst; i <= n; i++) {
      ans[1][i] = s[x + k];
      k++;
    }
    for (int i = n; i >= dnen; i--) {
      ans[2][i] = s[x + k];
      k++;
    }
    k++;
    int ind = x + k;
    for (int i = dnen - 1; i >= 1; i--) {
      if (ind > 2 * n) ind = 0;
      ans[2][i] = s[ind];
      ind++;
    }
    for (int i = 1; i <= upst - 1; i++) {
      if (ind > 2 * n) ind = 0;
      ans[1][i] = s[ind];
      ind++;
    }
    for (int i = 1; i <= n; i++) cout << ans[1][i];
    cout << "\n";
    for (int i = 1; i <= n; i++) cout << ans[2][i];
    cout << "\n";
  }
  return 0;
}
