#include <bits/stdc++.h>
using namespace std;
string s, t;
int i;
int main() {
  cin >> s;
  cin >> t;
  int s1 = 0, s2 = 0, p = 0;
  for (i = 0; i < s.size(); i++) {
    if (s[i] == '|') {
      p = 1;
    } else if (p == 0)
      s1++;
    else
      s2++;
  }
  if (abs(s1 - s2) > t.size() || (t.size() - abs(s1 - s2)) % 2 == 1) {
    puts("Impossible");
    return 0;
  }
  while (s1 > s2) {
    s += t[0];
    s2++;
    t.erase(t.begin());
  }
  while (s1 < s2) {
    s = t[0] + s;
    s1++;
    t.erase(t.begin());
  }
  while (t.size() > 0) {
    s = t[0] + s + t[1];
    t.erase(t.begin());
    t.erase(t.begin());
  }
  cout << s << endl;
  return 0;
}
