#include <bits/stdc++.h>
using namespace std;
struct Task {
  int row;
  int col;
  vector<string> sollines;
  Task() : sollines(2, string(13, ' ')) {}
  void nextpos() {
    if (row == 0) {
      ++col;
      if (col == 13) {
        --col;
        ++row;
      }
    } else {
      --col;
      if (col == -1) {
        ++col;
        --row;
      }
    }
  }
  void print(char ch) {
    sollines[row][col] = ch;
    nextpos();
  }
  int solve(string filePrefix) {
    cin.sync_with_stdio(false);
    cout.sync_with_stdio(false);
    string letters;
    cin >> letters;
    ;
    map<char, int> hist;
    char duplch;
    for (char ch : letters) {
      ++hist[ch];
      if (hist[ch] == 2) {
        duplch = ch;
      }
    };
    int n = (int)letters.size();
    vector<int> duplpositions;
    for (int i = 0; i < n; ++i) {
      if (letters[i] == duplch) {
        duplpositions.push_back(i);
      }
    }
    int looplen = duplpositions[1] - duplpositions[0] - 1;
    ;
    string sol = "Impossible";
    if (looplen > 0) {
      row = 0;
      col = 12 - (looplen / 2);
      print(duplch);
      for (int i = duplpositions[0] + 1; i < duplpositions[1]; ++i) {
        print(letters[i]);
      }
      for (int i = duplpositions[1] + 1; i < n; ++i) {
        print(letters[i]);
      }
      for (int i = 0; i < duplpositions[1]; ++i) {
        print(letters[i]);
      }
      sol = sollines[0] + "\n" + sollines[1];
    }
    cout << sol << endl;
    return 0;
  }
};
int solve(std::string s) {
  Task t;
  return t.solve(s);
}
int main(int argc, char *argv[]) {
  int ret = 0;
  ret = solve("");
  return ret;
}
