#include <bits/stdc++.h>
using namespace std;
int main() {
  string Scale, left, right, rest_elements;
  int Slash;
  cin >> Scale;
  Slash = Scale.find('|');
  left = Scale.substr(0, Slash);
  right = Scale.substr(Slash + 1, Scale.size());
  cin >> rest_elements;
  for (auto i : rest_elements)
    if (left.size() <= right.size())
      left += i;
    else
      right += i;
  cout << (left.size() == right.size() ? left + "|" + right : "Impossible")
       << endl;
  return 0;
}
