#include <bits/stdc++.h>
using namespace std;
int main() {
  string s1, s2;
  cin >> s1 >> s2;
  if ((s1.size() + s2.size()) % 2 == 0)
    cout << "Impossible";
  else {
    int n = (s1.size() + s2.size()) / 2;
    int m = s1.find('|');
    int i = 0;
    for (; i < n - m; i++) s1 = s2[i] + s1;
    for (; i < s2.size(); i++) s1 += s2[i];
    if (s1.find('|') != s1.length() / 2)
      cout << "Impossible";
    else
      cout << s1;
  }
  return 0;
}
