#include <bits/stdc++.h>
int main(void) {
  char s[30], t[30], s1[30], s2[30];
  scanf("%s %s", s, t);
  int i = 0, c1 = 0, c2 = 0, c3 = 0;
  while (s[i] != '|') {
    s1[c1++] = s[i];
    i++;
  }
  i++;
  while (s[i] != '\0') {
    s2[c2++] = s[i];
    i++;
  }
  i = 0;
  while (t[i++] != '\0') c3++;
  if ((c1 + c2 + c3) % 2 == 1)
    printf("Impossible");
  else {
    i = 0;
    while (t[i] != '\0') {
      if (c1 > c2) {
        s2[c2++] = t[i++];
      }
      if (c1 <= c2 && t[i] != '\0') s1[c1++] = t[i++];
    }
    if (c1 != c2)
      printf("Impossible");
    else {
      s1[c1] = '\0';
      s2[c2] = '\0';
      printf("%s|%s", s1, s2);
    }
  }
  return 0;
}
