#include <bits/stdc++.h>
using namespace std;
void print(string &s, int st, int pos) {
  for (int i = st; i <= (int)(pos); ++i) cout << s[i];
}
int main() {
  string a, b;
  cin >> a >> b;
  int pos = a.find('|');
  int n = ((int)b.size()), l = pos, r = ((int)a.size()) - pos - 1, rem = r - l,
      both = n - abs(rem);
  if (n >= abs(rem) && (both & 1) != 1) {
    print(a, 0, pos - 1);
    print(b, 0, both / 2 - 1);
    if (rem > 0) print(b, both / 2, rem + both / 2 - 1);
    cout << "|";
    print(a, pos + 1, ((int)a.size()) - 1);
    if (rem > 0)
      print(b, rem + both / 2, n - 1);
    else
      print(b, both / 2, n - 1);
  } else
    cout << "Impossible";
  return 0;
}
