#include <bits/stdc++.h>
using namespace std;
string s;
int mkan, n(26), lf;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  ;
  cin >> s;
  for (int i = n; i + 1; --i) {
    mkan = s.find(s[i]);
    if (mkan != i) {
      if (s[i - 1] == s[i]) return cout << "Impossible", 0;
      mkan = i;
      break;
    }
  }
  int mkan2 = s.find(s[mkan]);
  for (int i = 0, j = mkan2 + (mkan - mkan2 + 1) / 2; i < 13; i++, j++) {
    if (j % 27 == mkan) j++;
    cout << s[j % 27];
  }
  cout << endl;
  for (int i = 0, j = mkan2 + (mkan - mkan2 - 1) / 2; i < 13; i++, j--)
    cout << s[(j % 27 + 27) % 27];
  return 0;
}
