#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  char str[100];
  scanf("%s", str);
  char fir[100];
  char sec[100];
  for (int i = 0; i < 13; i++) {
    fir[i] = ' ';
    sec[i] = ' ';
  }
  bool found = false;
  map<char, int> memo;
  for (int i = 0; i < 27; i++) memo[str[i]]++;
  int left, right;
  for (int i = 0; i < 27; i++) {
    if (memo[str[i]] == 2) {
      left = i;
      break;
    }
  }
  for (int i = 26; i >= 0; i--) {
    if (memo[str[i]] == 2) {
      right = i;
      break;
    }
  }
  if (right - left == 1) {
    cout << "Impossible" << endl;
    return 0;
  }
  int diff = right - left - 1;
  diff /= 2;
  int diffr = right - left - 1 - diff;
  for (int i = 0; i < 27; i++) {
    if (memo[str[i]] == 2) {
      fir[12 - diff] = str[i];
      for (int j = i + 1; j < i + diff + 1; j++) {
        fir[12 - diff + j - i] = str[j];
      }
      break;
    }
  }
  fir[13] = '\0';
  sec[13] = '\0';
  for (int i = 27; i >= 0; i--) {
    if (memo[str[i]] == 2) {
      for (int j = i - 1; j > i - 1 - diffr; j--) {
        sec[13 - diffr + (i - 1 - j)] = str[j];
      }
      break;
    }
  }
  for (int i = 27; i >= 0; i--) {
    bool fl = true;
    if (memo[str[i]] == 2) {
      int strtr = 12 - diffr, fri = 0;
      for (int j = (i + 1) % 27; memo[str[j]] != 2;) {
        if (fl) {
          sec[strtr] = str[j];
          j++;
          j %= 27;
          strtr--;
          if (strtr == -1) fl = false;
        } else {
          fir[fri] = str[j];
          j++;
          j %= 27;
          fri++;
        }
      }
      break;
    }
  }
  printf("%s\n%s\n", fir, sec);
}
