#include <bits/stdc++.h>
using namespace std;
int dist;
vector<vector<char> > solve(string s) {
  vector<vector<char> > ret(3);
  for (int i = 0; i < ret.size(); i++) ret[i].resize(33);
  int d = -1;
  int m = -1;
  int n = -1;
  for (int i = 0; d == -1 && i < s.length(); i++) {
    for (int j = i + 1; d == -1 && j < s.length(); j++) {
      if (s[i] == s[j]) {
        m = i + 1;
        n = j + 1;
        d = j - i;
      }
    }
  }
  dist = d;
  if (d == 1) return vector<vector<char> >();
  if (d % 2 == 0) {
    int idx = m - 2;
    for (int j = 13 - d / 2; idx >= 0 && j >= 1; j--) {
      ret[1][j] = s[idx--];
    }
    for (int j = 1; idx >= 0; j++) {
      ret[2][j] = s[idx--];
    }
    idx = m - 1;
    for (int j = 13 - d / 2 + 1; j <= 13; j++) {
      ret[1][j] = s[idx++];
    }
    for (int j = 13; j >= 13 - d / 2 + 1; j--) {
      ret[2][j] = s[idx++];
    }
    idx++;
    for (int j = 13 - d / 2; j >= 1 && idx < 27; j--) {
      ret[2][j] = s[idx++];
    }
    for (int j = 1; idx < 27; j++) {
      ret[1][j] = s[idx++];
    }
  } else {
    int idx = m - 2;
    for (int j = 13 - d / 2; idx >= 0 && j >= 1; j--) {
      ret[1][j] = s[idx--];
    }
    for (int j = 1; idx >= 0; j++) {
      ret[2][j] = s[idx--];
    }
    ret[2][13 - d / 2] = s[m - 1];
    idx = m;
    for (int j = 13 - d / 2 + 1; j <= 13; j++) {
      ret[1][j] = s[idx++];
    }
    for (int j = 13; j >= 13 - d / 2 + 1; j--) {
      ret[2][j] = s[idx++];
    }
    idx++;
    for (int j = 13 - d / 2 - 1; j >= 1 && idx < 27; j--) {
      ret[2][j] = s[idx++];
    }
    for (int j = 1; idx < 27; j++) {
      ret[1][j] = s[idx++];
    }
  }
  return ret;
}
int main() {
  string s;
  cin >> s;
  vector<vector<char> > ans = solve(s);
  if (dist == 1) {
    puts("Impossible");
  } else {
    for (int i = 1; i <= 2; i++) {
      for (int j = 1; j <= 13; j++) {
        printf("%c", ans[i][j]);
      }
      puts("");
    }
  }
  return 0;
}
