#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  char s[10000], ss[10000];
  int x[2], t = 0;
  ;
  x[0] = 0;
  x[1] = 0;
  cin >> s;
  int ls = strlen(s);
  for (int i = 1; i <= ls; i++) {
    if (s[i - 1] == '|') t++;
    x[t]++;
  }
  x[1]--;
  cin >> ss;
  int lss = strlen(ss);
  if ((x[0] + x[1] + lss) % 2 == 1 || x[0] > (x[0] + x[1] + lss) / 2 ||
      x[1] > (x[0] + x[1] + lss) / 2)
    cout << "Impossible" << endl;
  else {
    for (int i = 0; i <= (ls - 1 + lss) / 2 - x[0] - 1; i++) cout << ss[i];
    cout << s;
    for (int i = (ls - 1 + lss) / 2 - x[0]; i <= lss - 1; i++) cout << ss[i];
  }
  return 0;
}
