#include <bits/stdc++.h>
using namespace std;
const long double epsylon = 1e-9;
const std::string PROGRAM_NAME = "ivo";
int main() {
  string s;
  cin >> s;
  int x1 = -1, x2 = -1;
  for (int i = 0; i < (int)s.size(); ++i) {
    for (int j = i + 1; j < (int)s.size(); ++j) {
      if (s[i] == s[j]) {
        x1 = i;
        x2 = j;
        break;
      }
    }
  }
  s = s.substr(x1) + s.substr(0, x1);
  x2 -= x1;
  x1 = 0;
  if (x2 <= 1) {
    cout << "Impossible" << endl;
    return 0;
  }
  vector<string> res(2, string(13, ' '));
  if (x2 == 2) {
    res[0][11] = s[0];
    res[0][12] = s[1];
    res[1][12] = s[3];
    res[1][11] = s[4];
    for (int i = 10; i >= 0; --i) {
      res[1][i] = s[10 - i + 5];
    }
    for (int i = 0; i <= 10; ++i) {
      res[0][i] = s[16 + i];
    }
    cout << res[0] << endl << res[1] << endl;
    return 0;
  }
  if (x2 % 2 == 1) {
    int shift = (x2 - 1) / 2;
    int ix = 0;
    res[0][12 - shift] = s[ix++];
    for (int j = 1; j <= shift; ++j) {
      res[0][12 - shift + j] = s[ix++];
    }
    for (int j = 0; j < shift; ++j) {
      res[1][12 - j] = s[ix++];
    }
    ix++;
    for (int j = 12 - shift - 1; j >= 0; --j) {
      res[0][j] = s[ix++];
    }
    for (int j = 0; j <= 12 - shift; ++j) {
      res[1][j] = s[ix++];
    }
  } else {
    int shift = (x2 - 1) / 2;
    int ix = 0;
    res[0][12 - shift] = s[ix++];
    for (int j = 1; j <= shift; ++j) {
      res[0][12 - shift + j] = s[ix++];
    }
    for (int j = 0; j <= shift; ++j) {
      res[1][12 - j] = s[ix++];
    }
    ix++;
    for (int j = 12 - shift - 1; j >= 0; --j) {
      res[0][j] = s[ix++];
    }
    for (int j = 0; j < 12 - shift; ++j) {
      res[1][j] = s[ix++];
    }
  }
  cout << res[0] << endl << res[1] << endl;
  return 0;
}
