#include <bits/stdc++.h>
using namespace std;
int main() {
  string pan;
  while (cin >> pan) {
    int left = pan.find('|'), right = pan.size() - left - 1;
    string str;
    cin >> str;
    int extra = str.size() - abs(left - right);
    if (extra < 0 || extra % 2 != 0)
      cout << "Impossible" << endl;
    else {
      for (int i = 0; i < str.size(); i++) {
        if (left <= right) {
          pan.insert(pan.find('|'), 1, str[i]);
          left++;
        } else {
          pan.insert(pan.end(), 1, str[i]);
          right++;
        }
      }
      cout << pan << endl;
    }
  }
  return 0;
}
