#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string a, b;
  cin >> a >> b;
  int c = a.find('|');
  string l, r;
  l = string(a, 0, c);
  r = string(a, c + 1, a.size());
  for (int i = 0; i < b.size(); i++) {
    if (l.size() <= r.size())
      l += b[i];
    else
      r += b[i];
  }
  if (l.size() == r.size())
    cout << l + '|' + r << '\n';
  else
    cout << "Impossible" << '\n';
}
