#include <bits/stdc++.h>
using namespace std;
class Word {
 public:
  vector<string> getGrid(string pathStr, bool &valid) {
    valid = true;
    int dupFrst, dupSec;
    valid = !hasRepeat(pathStr);
    vector<string> retVec;
    if (valid) {
      int nBetDup = getSep(pathStr, dupFrst, dupSec);
      int nLft = nBetDup / 2;
      retVec.push_back("9999999999999");
      retVec.push_back("9999999999999");
      retVec[0][nLft] = pathStr[dupFrst];
      retVec = getRtPre(retVec, pathStr, dupFrst, nLft);
      retVec = getMidLeftBel(retVec, pathStr, dupFrst, nLft, nBetDup);
      int sfxR1Ind = nBetDup - nLft;
      int nCharsSfx = 27 - dupSec - 1;
      retVec = getRtBelSuff(retVec, pathStr, sfxR1Ind, nCharsSfx);
    }
    return retVec;
  }
  vector<string> getRtPre(vector<string> retVec, string pathStr, int dup1Ind,
                          int nLft) {
    int nCh = dup1Ind;
    int startInd = nLft + nCh;
    int resid = 0;
    if ((nCh + nLft + 1) > 13) {
      resid = nCh + nLft + 1 - 13;
      int lowerInd = 13 - resid;
      for (int i = 0; i < resid; i++) {
        retVec[1][lowerInd + i] = pathStr[i];
      }
      startInd = 12;
    }
    for (int i = 0; i < nCh - resid; i++) {
      retVec[0][startInd - i] = pathStr[resid + i];
    }
    return retVec;
  }
  vector<string> getMidLeftBel(vector<string> retVec, string path, int dupFst,
                               int nLeft, int nBetDup) {
    for (int i = nLeft - 1; i >= 0; i--) {
      retVec[0][i] = path[dupFst + 1 + nLeft - 1 - i];
    }
    int rem = nBetDup - nLeft;
    int pathInd = dupFst + nLeft + 1;
    for (int i = 0; i < rem; i++) {
      retVec[1][i] = path[pathInd + i];
    }
    return retVec;
  }
  vector<string> getRtBelSuff(vector<string> retVec, string path, int sfxR1Ind,
                              int nCharsSfx) {
    int pathStartInd = 27 - nCharsSfx;
    int nR1Chars = min(13 - sfxR1Ind, nCharsSfx);
    int nR0Chars = nCharsSfx - nR1Chars;
    for (int i = 0; i < nR1Chars; i++) {
      retVec[1][sfxR1Ind + i] = path[pathStartInd + i];
    }
    pathStartInd += nR1Chars;
    for (int i = 0; i < nR0Chars; i++) {
      retVec[0][12 - i] = path[pathStartInd + i];
    }
    return retVec;
  }
  int getSep(string s, int &df, int &ds) {
    int len = s.length();
    unordered_map<char, bool> seen;
    char dupCh;
    for (int i = 0; i < len; i++) {
      char ch = s[i];
      if (seen.find(ch) != seen.end()) {
        ds = i;
        dupCh = ch;
        break;
      } else {
        seen[ch] = true;
      }
    }
    df = s.find(dupCh);
    int retLen = ds - df - 1;
    return retLen;
  }
  bool hasRepeat(string s) {
    bool retV = false;
    int len = s.length();
    for (int i = 0; i < (len - 1); i++) {
      if (s[i] == s[i + 1]) {
        retV = true;
        break;
      }
    }
    return retV;
  }
};
int main(int argc, const char *argv[]) {
  Word w;
  bool valid;
  string pathStr;
  getline(cin, pathStr);
  vector<string> grid = w.getGrid(pathStr, valid);
  if (!valid) {
    cout << "Impossible";
  } else {
    cout << grid[0] << endl;
    cout << grid[1];
  }
  cout << endl;
  return 0;
}
