#include <bits/stdc++.h>
using namespace std;
void solve() {
  string s;
  cin >> s;
  vector<int> positions[26];
  int doubleOccurr = -1;
  for (int i = 0; i < (int)s.length(); i++) {
    positions[s[i] - 'A'].push_back(i);
    if (positions[s[i] - 'A'].size() == 2) {
      doubleOccurr = s[i] - 'A';
      if (positions[s[i] - 'A'][1] - positions[s[i] - 'A'][0] == 1) {
        cout << "Impossible";
        return;
      }
    }
  }
  vector<char> ans[2];
  ans[0].resize(13);
  ans[1].resize(13);
  int fromLeft =
      (positions[doubleOccurr][1] - positions[doubleOccurr][0] - 1) / 2;
  ans[1][12 - fromLeft] = char('A' + doubleOccurr);
  int move = 1,
      between = positions[doubleOccurr][1] - positions[doubleOccurr][0] - 1;
  int row = 1, col = 12 - fromLeft, index = positions[doubleOccurr][0] + 1;
  while (between--) {
    if (move == 1 && col + 1 > 12) {
      move = -1;
      row = 0;
    } else {
      col += move;
    }
    ans[row][col] = s[index];
    index++;
  }
  between = positions[doubleOccurr][0] - 1 + (27 - positions[doubleOccurr][1]);
  row = 0;
  index = (positions[doubleOccurr][1] + 1) % 27;
  while (index != positions[doubleOccurr][0]) {
    if (move == -1 && col - 1 < 0) {
      move = 1;
      row = 1;
    } else {
      col += move;
    }
    ans[row][col] = s[index];
    index++;
    index %= 27;
  }
  for (int i = 0; i < 2; i++) {
    for (char ch : ans[i]) cout << ch;
    cout << endl;
  }
  return;
}
int main() {
  int t;
  t = 1;
  while (t--) {
    solve();
  }
}
