#include <bits/stdc++.h>
using namespace std;
int main() {
  string str;
  cin >> str;
  int i;
  int left = 0;
  int right = 0;
  int len = str.size();
  int pos = str.find('|');
  for (i = 0; i < len; i++) {
    if (i < pos) left++;
    if (i > pos) right++;
  }
  string unuse;
  cin >> unuse;
  int avail = unuse.size();
  int j = avail - abs(left - right);
  if (j >= 0 && j % 2 == 0) {
    int side = (left + right + avail) / 2;
    if (left < side) cout << unuse.substr(0, side - left);
    cout << str;
    if (right < side) cout << unuse.substr(side - left);
  } else {
    cout << "Impossible" << endl;
  }
  return 0;
}
