#include <bits/stdc++.h>
using namespace std;
char s[30], ss[30];
int main() {
  int i, j, l = 0, r = 0;
  scanf("%s", s);
  int len = strlen(s);
  int first = 1, t;
  for (i = 0; i < len; i++) {
    if (first && s[i] != '|')
      l++;
    else if (s[i] == '|') {
      first = 0;
      t = i;
    } else
      r++;
  }
  scanf("%s", ss);
  int len2 = strlen(ss);
  int k;
  int temp = len2 - abs(l - r);
  if (temp >= 0 && (temp % 2) == 0)
    k = 1;
  else
    k = 0;
  if (k) {
    int n;
    if (l < r)
      n = abs(l - r) + temp / 2;
    else
      n = temp / 2;
    for (i = 0; i < t; i++) printf("%c", s[i]);
    for (i = 0; i < n; i++) printf("%c", ss[i]);
    printf("|");
    for (i = t + 1; i < len; i++) printf("%c", s[i]);
    for (i = n; i < len2; i++) printf("%c", ss[i]);
    printf("\n");
  } else
    printf("Impossible\n");
  return 0;
}
