#include <bits/stdc++.h>
using namespace std;
int main() {
  char a[26], b[26], c[26], d[26];
  scanf("%s", a);
  scanf("%s", b);
  int i = 0, m = 0, n = 0, k, q, w, j = 0, flag = 0, t = 0;
  while (a[i] != '\0') {
    if (a[i] == '|') m = i;
    i++;
  }
  q = m;
  w = i - m - 1;
  n = i;
  while (b[j] != '\0') {
    j++;
  }
  i = 0;
  for (i = 0; i < q; i++) c[i] = a[i];
  for (i = 0; i < w; i++) d[i] = a[q + i + 1];
  i = 0;
  while (j > 0) {
    if (q < w) {
      c[q++] = b[i++];
      j--;
    } else if (q >= w) {
      d[w++] = b[i++];
      j--;
    }
  }
  if (q == w) {
    for (i = 0; i < q; i++) printf("%c", c[i]);
    printf("|");
    for (i = 0; i < w; i++) printf("%c", d[i]);
  } else {
    printf("Impossible");
  }
  return 0;
}
