#include <bits/stdc++.h>
using namespace std;
char c;
int pos[26], pos1, pos2;
string S, row1, row2;
int main() {
  ios::sync_with_stdio(0);
  cin >> S;
  for (int i = 0; i < int(S.size()); i++) {
    if (pos[S[i] - 'A']) {
      c = S[i];
      pos1 = pos[S[i] - 'A'];
      pos2 = i + 1;
    }
    pos[S[i] - 'A'] = i + 1;
  }
  int L = pos2 - pos1 - 1;
  if (L == 0) {
    cout << "Impossible\n";
    return 0;
  }
  row1 = string(1, c);
  for (int i = 0; i < L / 2; i++) row1 += S[pos1 + i];
  for (int i = 0; i < (L + 1) / 2; i++) row2 += S[pos1 + i + L / 2];
  reverse(row2.begin(), row2.end());
  string extraRow1 = "", extraRow2 = "";
  for (int i = pos1 - 1; i >= 1; i--) {
    if (int(row1.size()) < 13)
      row1 = S[i - 1] + row1;
    else
      extraRow2 += S[i - 1];
  }
  for (int i = pos2 + 1; i <= int(S.size()); i++) {
    if (int(row2.size()) < 13)
      row2 = S[i - 1] + row2;
    else
      extraRow1 += S[i - 1];
  }
  cout << extraRow1 << row1 << "\n";
  cout << extraRow2 << row2 << "\n";
  return 0;
}
