#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<char> v;
  int n1 = 0, n2 = 0, n3, r, a, b;
  int i = 0, j;
  string s1, s2;
  cin >> s1 >> s2;
  for (n1 = 0; s1[n1] != '|'; n1++)
    ;
  n2 = s1.size() - 1 - n1;
  for (i = 0; i < s2.size(); i++) v.push_back(s2[i]);
  n3 = v.size();
  r = abs(n1 - n2);
  if (n3 < r || (n3 - r) % 2 == 1)
    cout << "Impossible";
  else {
    if (n1 < n2) {
      a = (n3 - r) / 2 + r;
    } else {
      a = (n3 - r) / 2;
    }
    for (j = 0; j < a; j++) cout << v[j];
    cout << s1;
    for (; j < n3; j++) cout << v[j];
  }
}
