#include <bits/stdc++.h>
using namespace std;
int main() {
  string str1, str2;
  cin >> str1 >> str2;
  string left, right;
  int i = str1.size() - 1;
  if (str1[i] == '|') str1 = str1 + "0";
  size_t pos = str1.find("|");
  left = str1.substr(0, pos);
  right = str1.substr(pos + 1);
  if (right == "0") right = "";
  int a = (left.size() - right.size());
  a = abs(a);
  int b = str2.size();
  if ((b - a) % 2 != 0 || (b - a) < 0)
    cout << "Impossible" << endl;
  else {
    if (left.size() > right.size()) {
      right = right + str2.substr(0, a);
      string remain = str2.substr(a);
      int mid = remain.size() / 2;
      left = left + remain.substr(0, mid) + "|";
      right = right + remain.substr(mid);
    } else {
      left = left + str2.substr(0, a);
      string remain = str2.substr(a);
      int mid = remain.size() / 2;
      left = left + remain.substr(0, mid) + "|";
      right = right + remain.substr(mid);
    }
    cout << left << right << endl;
  }
}
