#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, l;
  cin >> s >> l;
  int i = 0;
  int left = 0, right = 0;
  while (s[i] != '|') {
    left++;
    i++;
  }
  i++;
  while (i < s.size()) {
    right++;
    i++;
  }
  int lsize = l.size();
  int diff = abs(right - left);
  if (diff == 0) {
    if (lsize % 2 == 0) {
      for (int i = 0; i < lsize / 2; i++) {
        cout << l[i];
      }
      cout << s;
      for (int i = lsize / 2; i < lsize; i++) {
        cout << l[i];
      }
    } else
      cout << "Impossible";
  } else if (diff > 0) {
    if (diff == lsize) {
      if (left < right) {
        cout << l;
        cout << s;
      } else {
        cout << s << l;
      }
    } else if (diff > lsize)
      cout << "Impossible";
    else {
      int num = lsize;
      num = num - diff;
      if (num % 2 == 0) {
        if (left > right) {
          int j = 0;
          while (j < (num / 2)) {
            cout << l[j];
            j++;
          }
          cout << s;
          while (j < lsize) {
            cout << l[j];
            j++;
          }
        } else {
          int j = 0;
          while (j < (num / 2) + diff) {
            cout << l[j];
            j++;
          }
          cout << s;
          while (j < lsize) {
            cout << l[j];
            j++;
          }
        }
      } else
        cout << "Impossible";
    }
  }
  return 0;
}
