#include <bits/stdc++.h>
using namespace std;
const int Dr[][2] = {{0, 1}, {1, 0}, {0, -1}, {-1, 0}};
string R[2];
string A;
inline bool in_bound(int x, int y) {
  return x >= 0 && y >= 0 && x < 2 && y < 13;
}
void enter() { cin >> A; }
void solve() {
  R[0].resize(13);
  R[1].resize(13);
  int x, y;
  {
    map<char, int> P;
    for (int i = 0; i < A.size(); ++i) {
      if (P.count(A[i])) {
        x = P[A[i]];
        y = i;
        break;
      }
      P[A[i]] = i;
    }
  }
  if (x + 1 == y) {
    cout << "Impossible\n";
    return;
  }
  int i = 0;
  int j = 13 - (y - x + 1) / 2;
  int dr = 0;
  int k = x;
  do {
    if (k != y) {
      R[i][j] = A[k];
      if (!in_bound(i + Dr[dr][0], j + Dr[dr][1])) dr = (dr + 1) % 4;
      i += Dr[dr][0];
      j += Dr[dr][1];
    }
    k = (k + 1) % A.size();
  } while (k != x);
  cout << R[0] << "\n" << R[1] << "\n";
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  if (ifstream("test.inp")) cin.rdbuf((new ifstream("test.inp"))->rdbuf());
  enter();
  solve();
}
