#include <bits/stdc++.h>
using namespace std;
int main() {
  int left, right, x, y;
  int k, l1, l2;
  char s1[100], s2[100];
  scanf("%s", s1);
  scanf("%s", s2);
  l1 = strlen(s1), l2 = strlen(s2);
  for (k = 0; s1[k] != '|'; ++k)
    ;
  left = k;
  right = l1 - k - 1;
  if ((l2 + right - left < 0) || ((l2 + right - left) & 1)) {
    printf("Impossible");
    return 0;
  }
  x = (l2 + right - left) / 2;
  if (x > l2) {
    printf("Impossible");
    return 0;
  }
  for (int i = 0; i < x; ++i) printf("%c", s2[i]);
  printf("%s", s1);
  for (int i = x; i < l2; ++i) printf("%c", s2[i]);
  return 0;
}
