#include <bits/stdc++.h>
using namespace std;
int main(int argc, const char* argv[]) {
  ios::sync_with_stdio(false);
  string s;
  cin >> s;
  vector<int> pos(256, -1);
  int pos2 = -1;
  for (int i = 0; i < s.size(); ++i) {
    if (pos[s[i]] == -1) {
      pos[s[i]] = i;
    } else {
      pos2 = i;
      break;
    }
  }
  int pos1 = pos[s[pos2]];
  if (pos2 == pos1 + 1) {
    cout << "Impossible";
    return 0;
  }
  vector<string> v(2);
  v[0].assign(13, '0');
  v[1].assign(13, '0');
  int mid = pos1 + (pos2 - pos1) / 2;
  v[0][0] = s[mid];
  int ctop = 1;
  for (int i = mid - 1; i > pos1; --i) {
    v[0][ctop] = s[i];
    ++ctop;
  }
  int cbot = 0;
  for (int i = mid + 1; i < pos2; ++i) {
    v[1][cbot] = s[i];
    ++cbot;
  }
  v[1][cbot++] = s[pos2];
  if (pos1 < s.size() - pos2 - 1) {
    for (int i = pos1 - 1; i >= 0; --i) {
      v[0][ctop++] = s[i];
    }
    for (int i = pos2 + 1; i < s.size(); ++i) {
      int row = (cbot / 13) ^ 1;
      int col = row == 0 ? 13 - cbot % 13 - 1 : cbot;
      v[row][col] = s[i];
      cbot++;
    }
  } else {
    for (int i = pos2 + 1; i < s.size(); ++i) {
      v[1][cbot++] = s[i];
    }
    for (int i = pos1 - 1; i >= 0; --i) {
      int row = (ctop / 13);
      int col = row ? 13 - ctop % 13 - 1 : ctop;
      v[row][col] = s[i];
      ++ctop;
    }
  }
  cout << v[0] << endl;
  cout << v[1] << endl;
  return 0;
}
