#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vll = vector<ll>;
using pill = pair<int, ll>;
using vvi = vector<vi>;
ll gcd(ll a, ll b) {
  ll t;
  while ((t = a % b) != 0) {
    a = b;
    b = t;
  }
  return b;
}
ll fast_exp(ll base, ll n, ll m) {
  if (n == 0) return 1;
  ll t = fast_exp(base, n / 2, m);
  if (n % 2 == 0)
    return (t * t) % m;
  else
    return (((t * t) % m) * base) % m;
}
bool is_set(int i, ll mask) { return (mask >> i) & 1; }
int count_bits(ll mask) {
  int ans = 0;
  for (int i = 0; i < 64; ++i)
    if (is_set(i, mask)) ++ans;
  return ans;
}
int first_bit(ll mask) {
  int i = 0;
  while (i < 64)
    if (is_set(i++, mask)) return i - 1;
  return -1;
}
int main() {
  ios::sync_with_stdio(false);
  string s;
  cin >> s;
  int pos[26][2];
  memset(pos, -1, sizeof pos);
  int dis = 0, p = -1;
  for (int i = 0; i < 27; ++i) {
    if (pos[s[i] - 'A'][0] == -1)
      pos[s[i] - 'A'][0] = i;
    else {
      dis = i - pos[s[i] - 'A'][0] - 1, p = pos[s[i] - 'A'][0];
      break;
    }
  }
  if (dis == 0) {
    cout << "Impossible\n";
    return 0;
  }
  char row[2][14];
  row[0][13] = row[1][13] = '\0';
  row[0][12 - dis / 2] = s[p];
  int p1 = p + 1, start = 12 - dis / 2, idx = start + 1;
  while (idx < 13) row[0][idx++] = s[p1++];
  idx--;
  while (idx > start) row[1][idx--] = s[p1++];
  if (dis & 1) row[1][idx] = s[p1++];
  idx--;
  p1 = (p1 + 1) % 27;
  while (idx >= 0) row[0][idx--] = s[p1], p1 = (p1 + 1) % 27;
  idx = 0;
  while (idx < start) row[1][idx++] = s[p1], p1 = (p1 + 1) % 27;
  if (dis % 2 == 0) row[1][idx] = s[p1];
  printf("%s\n%s\n", row[0], row[1]);
  return 0;
}
