#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, x, t, g;
  cin >> s >> g;
  int j;
  int p = s.find_first_of('|');
  for (int i = 0; i < p; i++) x += s[i];
  for (int i = p + 1; i < s.size(); i++) t += s[i];
  j = s.size() - 1 + g.size();
  if (x.size() > j / 2 || t.size() > j / 2 || j % 2) {
    cout << "Impossible" << endl;
    return 0;
  }
  int k = 0;
  while (x.size() < j / 2) {
    x += g[k];
    k++;
  }
  while (t.size() < j / 2) {
    t += g[k];
    k++;
  }
  cout << x << '|' << t << endl;
  return 0;
}
