#include <bits/stdc++.h>
using namespace std;
int main() {
  string inp1, inp2;
  cin >> inp1;
  cin >> inp2;
  int l = inp1.length() + inp2.length() - 1;
  if (l % 2 != 0) {
    cout << "Impossible";
  } else {
    int i = 0;
    while (inp1[i] != '|') i++;
    if (i > l / 2 || inp1.length() - 1 - i > l / 2)
      cout << "Impossible";
    else {
      int i = 0, j = 0;
      while (inp1[i] != '|') cout << inp1[i++];
      int k = i;
      while (k != l / 2) {
        cout << inp2[j++];
        k++;
      }
      cout << '|';
      i++;
      while (inp1[i] != '\0') cout << inp1[i++];
      while (inp2[j] != '\0') cout << inp2[j++];
    }
  }
  return 0;
}
