#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, let, R = "", L = "";
  cin >> s;
  cin >> let;
  bool flag = true;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '|') {
      flag = false;
      continue;
    }
    if (flag) {
      R += s[i];
    } else {
      L += s[i];
    }
  }
  int numr = R.size();
  int numl = L.size();
  int numlet = let.size();
  int sum = numr + numl + numlet;
  if (sum % 2 == 0) {
    for (int i = 0; i < numlet; i++) {
      if (R.size() > L.size()) {
        L += let[i];
      } else if (R.size() < L.size()) {
        R += let[i];
      } else if (R.size() == L.size()) {
        R += let[i];
        i++;
        L += let[i];
      }
    }
    if (R.size() == L.size())
      cout << R << "|" << L;
    else {
      cout << "Impossible";
    }
  } else {
    cout << "Impossible";
  }
  return 0;
}
