#include <bits/stdc++.h>
using namespace std;
void write(string s, int x, int y, vector<vector<int> > &ans) {
  for (int i = 0; i < s.size(); ++i) {
    ans[x][y] = s[i];
    if (x == 0) {
      if (y == ans[0].size() - 1)
        x = 1;
      else
        y++;
    } else {
      if (y == 0)
        x = 0;
      else
        y--;
    }
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  string s;
  cin >> s;
  map<char, int> M;
  char k;
  string a, b, c;
  for (int i = 0; i < 27; ++i) {
    if (M[s[i]]) {
      k = s[i];
      a = s.substr(0, M[s[i]] - 1);
      b = s.substr(M[s[i]] - 1, (i + 1) - M[s[i]]);
      c = s.substr(i + 1, (int)s.size() - i);
    }
    if (i > 0 && s[i] == s[i - 1]) {
      cout << "Impossible\n";
      return 0;
    }
    M[s[i]] = i + 1;
  }
  string ca = c + a;
  vector<vector<int> > ans(2, vector<int>(13));
  int ind = 13 - (b.size() + 1) / 2;
  write(b, 0, ind, ans);
  if (b.size() % 2 == 0) ind--;
  write(ca, 1, ind, ans);
  for (int i = 0; i < 2; ++i) {
    for (int j = 0; j < 13; ++j) cout << (char)ans[i][j];
    cout << "\n";
  }
  return 0;
}
