#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int cr = 0, cl = 0, j = 0;
  string ch, w;
  cin >> ch;
  int req = ch.length();
  for (int i = 0; s[i] != '|'; i++) {
    cr++;
  }
  string st = s.substr(0, cr);
  for (int i = cr + 1; i < s.length(); i++) {
    cl++;
  }
  string str = s.substr(cr + 1);
  if (cl + cr <= req && (cl + cr + req) % 2 == 0) {
  }
  int p = req;
  for (int i = 0; i < req; i++) {
    if (st.length() < str.length()) {
      st += ch[i];
      p--;
      j++;
    } else if (st.length() > str.length()) {
      str += ch[i];
      p--;
      j++;
    }
  }
  if (st.length() == str.length() && p != 0) {
    while (j < ch.length()) {
      if (j % 2 == 0)
        st += ch[j];
      else
        str += ch[j];
      j++;
    }
  }
  if (st.length() != str.length())
    cout << "Impossible";
  else
    cout << st << "|" << str;
}
