#include <bits/stdc++.h>
using namespace std;
int main() {
  string s1, s2;
  cin >> s1 >> s2;
  int n1, n2, n;
  n1 = s1.find('|');
  n2 = s1.size() - n1 - 1;
  n = s2.size();
  if (n >= abs(n2 - n1) && (n - abs(n2 - n1)) % 2 == 0) {
    int d = (n + n1 + n2) / 2;
    cout << s2.substr(0, d - n1) << s1 << s2.substr(d - n1);
  } else
    cout << "Impossible";
  return 0;
}
