#include <bits/stdc++.h>
inline int Rand() { return (rand() << 16) | rand(); }
using namespace std;
int i, pos, l, r;
string ans1, s, ss, ans2;
int main() {
  srand(time(NULL));
  cin >> s;
  cin >> ss;
  for (i = 0; i < s.size(); i++) {
    if (s[i] == '|') {
      pos = i;
    }
  }
  l = pos;
  r = s.size() - (pos + 1);
  for (i = 0; i < ss.size(); i++) {
    if (l <= r) {
      l++;
      ans1 += ss[i];
    } else {
      r++;
      ans2 += ss[i];
    }
  }
  if (l == r)
    cout << ans1 << s << ans2;
  else
    cout << "Impossible";
  return 0;
}
