#include <bits/stdc++.h>
using namespace std;
deque<char> q, qq;
int cnt[300];
int main() {
  string ss;
  cin >> ss;
  int x, y, p, pp;
  for (int i = 0; i < 27; i++) {
    cnt[ss[i]]++;
    if (cnt[ss[i]] == 2) x = i;
  }
  for (int i = 0; i < 27; i++) {
    if (cnt[ss[i]] == 2) {
      y = i;
      break;
    }
  }
  if (x - y == 1) {
    puts("Impossible");
    exit(0);
  }
  p = (x - y + 1) >> 1;
  pp = x - y - p - 1;
  char ch;
  for (int i = y; i < y + p; i++) {
    q.push_back(ss[i]);
  }
  for (int i = y - 1; i >= 0; i--) {
    if (q.size() == 13) break;
    q.push_front(ss[i]);
  }
  for (int i = y + p; i < x; i++) {
    qq.push_front(ss[i]);
  }
  for (int i = x + 1; i < 27; i++) {
    if (qq.size() == 13) break;
    qq.push_front(ss[i]);
  }
  int m = 26;
  while (q.size() < 13) {
    q.push_front(ss[m--]);
  }
  m = 0;
  while (qq.size() < 13) {
    qq.push_front(ss[m++]);
  }
  while (!q.empty()) {
    cout << q.front();
    q.pop_front();
  }
  puts("");
  while (!qq.empty()) {
    cout << qq.front();
    qq.pop_front();
  }
  puts("");
}
