#include <bits/stdc++.h>
using namespace std;
int main() {
  string s1;
  string s2;
  cin >> s1 >> s2;
  int sz = s2.size();
  int pos = s1.find('|');
  string left = s1.substr(0, pos);
  string right = s1.substr(pos + 1);
  for (auto pointer : s2) {
    if (left.size() <= right.size()) {
      left += pointer;
    } else
      right += pointer;
  }
  cout << (left.size() == right.size() ? left + "|" + right : "Impossible");
}
