#include <bits/stdc++.h>
using namespace std;
map<string, int> t;
char A[51][51];
string y = "";
int main() {
  int i, p = 0, k = 0, t = 0;
  string a, v, y = "", h = "";
  cin >> a >> v;
  for (i = 0; i < a.length(); i++) {
    if (a[i] == '|') t = 1;
    if (t == 0) p++;
  }
  k = a.length() - 1 - p;
  for (i = 0; i < v.length(); i++) {
    if (p < k) {
      h = "";
      h = h + v[i];
      h = h + a;
      a = "";
      a += h;
      p++;
    } else {
      k++;
      a = a + v[i];
    }
  }
  if (p == k)
    cout << a;
  else
    cout << "Impossible";
}
