#include <bits/stdc++.h>
using namespace std;
string s;
string g[3];
char pp;
vector<vector<int> > op;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> s;
  op = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}, {1, 1}, {1, -1}, {-1, 1}, {-1, -1}};
  g[0] = "aaaaaaaaaaaaa";
  g[1] = "aaaaaaaaaaaaa";
  pp = '-';
  for (int i = 0; i < (int)s.size(); ++i) {
    if (pp != '-') break;
    for (int j = 0; j < (int)s.size(); ++j) {
      if (i != j) {
        if (s[i] == s[j]) {
          pp = s[i];
          break;
        }
      }
    }
  }
  for (int k = 0; k < 13; ++k) {
    int i = k, j = 0, q = 0;
    for (int ii = 0; ii < (int)s.size(); ++ii) {
      if (s[ii] == pp and q == 1) continue;
      if (s[ii] == pp and q == 0) q = 1;
      g[j][i] = s[ii];
      if (j == 0)
        ++i;
      else
        --i;
      if (i < 0) j = 0, i = 0;
      if (i > 12) j = 1, i = 12;
    }
    i = k;
    j = 0;
    q = 0;
    int ok = 1;
    for (int t = 0; t < 26; ++t) {
      q = 0;
      for (int l = 0; l < 8; ++l) {
        int ti = i + op[l][0];
        int tj = j + op[l][1];
        if (ti < 13 and ti >= 0 and (tj == 0 or tj == 1)) {
          if (g[tj][ti] == s[t + 1]) {
            i = ti;
            j = tj;
            ++q;
          }
        }
      }
      if (q != 1) {
        ok = 0;
        break;
      }
    }
    if (ok) {
      for (int i = 0; i < 2; ++i) {
        for (int j = 0; j < 13; ++j) {
          cout << g[i][j];
        }
        cout << endl;
      }
      return 0;
    }
  }
  cout << "Impossible\n";
  return 0;
}
