#include <bits/stdc++.h>
using namespace std;
int GLL(long long& x) { return scanf("%lld", &x); }
int GI(int& x) { return scanf("%d", &x); }
const int MAXC = 26;
int cnt[MAXC];
char board[2][MAXC / 2];
string s;
int dx[8] = {-1, -1, -1, 0, 0, 1, 1, 1};
int dy[8] = {-1, 0, 1, -1, 1, -1, 0, 1};
inline bool inBoard(int i, int j) {
  return i >= 0 && i < 2 && j >= 0 && j < MAXC / 2;
}
bool check() {
  int x, y;
  for (int i = 0; i < (int)(2); i++) {
    for (int j = 0; j < (int)(MAXC / 2); j++) {
      if (board[i][j] == s[0]) {
        x = i;
        y = j;
        break;
      }
    }
  }
  for (int i = 1; i <= (int)(s.size() - 1); i++) {
    char target = s[i];
    bool ok = false;
    for (int k = 0; k < (int)(8); k++) {
      int nx = x + dx[k];
      int ny = y + dy[k];
      if (inBoard(nx, ny) && board[nx][ny] == target) {
        x = nx;
        y = ny;
        ok = true;
        break;
      }
    }
    if (!ok) return false;
  }
  return true;
}
void getNext(int& x, int& y) {
  if (x == 0) {
    if (y < MAXC / 2 - 1) {
      y++;
    } else {
      x++;
    }
  } else {
    if (y > 0) {
      y--;
    } else {
      x--;
    }
  }
}
int main() {
  cin >> s;
  int n = s.size();
  memset(cnt, 0, sizeof cnt);
  for (int i = 0; i < (int)(n); i++) cnt[s[i] - 'A']++;
  char rep;
  for (int i = 0; i < (int)(MAXC); i++)
    if (cnt[i] > 1) rep = (char)('A' + i);
  for (int i = 0; i < (int)(2); i++) {
    for (int j = 0; j < (int)(MAXC / 2); j++) {
      int x = i;
      int y = j;
      bool putRep = false;
      for (int k = 0; k < (int)(n); k++) {
        if (s[k] == rep && putRep) continue;
        board[x][y] = s[k];
        if (s[k] == rep) putRep = true;
        getNext(x, y);
      }
      if (check()) {
        for (int i = 0; i < (int)(2); i++) {
          for (int j = 0; j < (int)(MAXC / 2); j++) {
            cout << board[i][j];
          }
          cout << "\n";
        }
        return 0;
      }
    }
  }
  cout << "Impossible\n";
  return 0;
}
