#include <bits/stdc++.h>
char s[55], res[2][55];
int p[555];
int a, b, mid;
int main() {
  scanf("%s", s);
  memset(p, -1, sizeof p);
  for (int i = 0; s[i]; i++)
    if (p[s[i]] < 0)
      p[s[i]] = i;
    else {
      a = p[s[i]];
      b = i;
      break;
    }
  if (b == a + 1) {
    printf("Impossible\n");
    return 0;
  }
  mid = (a + b - 1) / 2;
  int it = 12;
  for (int i = mid; i >= a; i--) res[1][it--] = s[i];
  int tmp = it;
  it = 12;
  for (int i = mid + 1; i < b; i++) res[0][it--] = s[i];
  int id = b + 1;
  for (; it >= 0 && id < 27; id++) res[0][it--] = s[id];
  for (; id < 27; id++) res[1][++it] = s[id];
  id = a - 1;
  it = tmp;
  for (; it >= 0 && id >= 0; id--) res[1][it--] = s[id];
  for (; id >= 0; id--) res[0][++it] = s[id];
  printf("%s\n%s\n", res[0], res[1]);
  return 0;
}
