#include <bits/stdc++.h>
using namespace std;
int main() {
  char a[40];
  char b[40];
  scanf("%s %s", a, b);
  int len1, len2;
  len1 = strlen(a);
  len2 = strlen(b);
  int i, j, len3;
  len3 = (len1 + len2 - 1) / 2;
  for (i = 0; a[i] != '|'; ++i)
    ;
  if ((len1 + len2 - 1) % 2 == 1 || i > len3 || (len1 - i - 1) > len3) {
    cout << "Impossible" << endl;
    return 0;
  }
  for (j = 0; j < len3 - i; ++j) {
    printf("%c", b[j]);
  }
  printf("%s", a);
  for (j = len3 - i; j < len2; ++j) {
    printf("%c", b[j]);
  }
  cout << endl;
  return 0;
}
