#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (a < b) {
    swap(a, b);
  }
  while (b) {
    long long r = a % b;
    a = b;
    b = r;
  }
  return a;
}
int lcm(int a, int b) { return (a * b) / gcd(a, b); }
int isPrim(int a) {
  if (a == 1) {
    return 0;
  }
  for (int i = 2; i <= (a + 1) / 2; i++) {
    if (a % i == 0) {
      return 0;
    }
  }
  return 1;
}
long long mod_pow(long long x, long long n, long long mod) {
  long long ret = 1;
  while (n > 0) {
    if (n % 2 == 1) {
      ret = (ret * x) % mod;
    }
    x = (x * x) % mod;
    n = n / 2;
  }
  return ret;
}
struct XX {
  int u;
  int v;
  int t;
};
class xxIntu {
 public:
  bool operator()(const XX& riLeft, const XX& riRight) const {
    if ((riLeft.u) == (riRight.u)) {
      return riLeft.v < riRight.v;
    }
    return (riLeft.u) < (riRight.u);
  }
};
int index(string in) {
  if (in == "A") {
    return 0;
  } else if (in == "B") {
    return 1;
  } else if (in == "C") {
    return 2;
  } else if (in == "D") {
    return 3;
  } else if (in == "E") {
    return 4;
  } else if (in == "F") {
    return 5;
  } else if (in == "G") {
    return 6;
  } else if (in == "H") {
    return 7;
  } else if (in == "I") {
    return 8;
  } else if (in == "J") {
    return 9;
  } else if (in == "K") {
    return 10;
  } else if (in == "L") {
    return 11;
  } else if (in == "M") {
    return 12;
  } else if (in == "N") {
    return 13;
  } else if (in == "O") {
    return 14;
  } else if (in == "P") {
    return 15;
  } else if (in == "Q") {
    return 16;
  } else if (in == "R") {
    return 17;
  } else if (in == "S") {
    return 18;
  } else if (in == "T") {
    return 19;
  } else if (in == "U") {
    return 20;
  } else if (in == "V") {
    return 21;
  } else if (in == "W") {
    return 22;
  } else if (in == "X") {
    return 23;
  } else if (in == "Y") {
    return 24;
  } else if (in == "Z") {
    return 25;
  }
  return -1;
}
long long ma(long long a, long long b) {
  if (a > b) {
    return a;
  } else {
    return b;
  }
}
long long mi(long long a, long long b) {
  if (a < b) {
    return a;
  } else {
    return b;
  }
}
int main(int argc, const char* argv[]) {
  string s;
  cin >> s;
  int ascii[26];
  for (int i = 0; i < 26; i++) {
    ascii[i] = 0;
  }
  for (int i = 0; i < s.size(); i++) {
    ascii[index(s.substr(i, 1))]++;
  }
  int f = 0;
  int choufuku = 0;
  for (int i = 0; i < 26; i++) {
    if (ascii[i] == 0) {
      f = 1;
      break;
    }
    if (ascii[i] == 2) {
      choufuku = i;
    }
  }
  if (f == 0) {
    for (int i = 1; i < s.size(); i++) {
      if (s.substr(i, 1) == s.substr(i - 1, 1)) {
        cout << "Impossible" << endl;
        return 0;
      }
    }
  }
  int before = -1;
  int after = -1;
  for (int i = 0; i < s.size(); i++) {
    if (index(s.substr(i, 1)) == choufuku && before == -1) {
      before = i;
    } else if (index(s.substr(i, 1)) == choufuku) {
      after = i;
    }
  }
  string ueRight = "";
  string ueLeft = "";
  string sitaRight = "";
  string sitaLeft = "";
  if ((after - before) % 2 == 1) {
    ueRight = s.substr(before, (after - before) / 2 + 1);
    sitaRight = s.substr(before + (after - before) / 2 + 1,
                         (after - before) - (after - before) / 2 - 1);
    reverse(sitaRight.begin(), sitaRight.end());
  } else {
    ueRight = s.substr(before, (after - before) / 2);
    sitaRight = s.substr(before + (after - before) / 2,
                         (after - before) - (after - before) / 2);
    reverse(sitaRight.begin(), sitaRight.end());
  }
  string zan = s.substr(after + 1, s.size() - after);
  zan = zan + s.substr(0, before);
  int bb = 13 - (int)sitaRight.size();
  int aa = 13 - (int)ueRight.size();
  sitaLeft = zan.substr(0, bb);
  reverse(sitaLeft.begin(), sitaLeft.end());
  ueLeft = zan.substr(bb, aa);
  cout << ueLeft << ueRight << endl;
  cout << sitaLeft << sitaRight << endl;
  return 0;
}
