#include <bits/stdc++.h>
char s1[100], s2[100];
int main() {
  int i;
  scanf("%s %s", s1, s2);
  int ls = strlen(s1);
  for (i = 0; i < ls; i++)
    if (s1[i] == '|') break;
  int zuo = i;
  int you = ls - 1 - zuo;
  int diff = abs(zuo - you) % 2;
  int diff2 = strlen(s2);
  if ((diff + diff2) % 2 == 1 || abs(zuo - you) > diff2) {
    printf("Impossible\n");
    return 0;
  }
  int l2zuo, l2you;
  if (zuo > you) {
    int dif = zuo - you;
    l2zuo = (diff2 - dif) / 2;
    l2you = (diff2 + dif) / 2;
  } else {
    int dif = you - zuo;
    l2zuo = (diff2 + dif) / 2;
    l2you = (diff2 - dif) / 2;
  }
  for (i = 0; i < l2zuo; i++) printf("%c", s2[i]);
  printf("%s", s1);
  for (; i < diff2; i++) printf("%c", s2[i]);
  return 0;
}
