#include <bits/stdc++.h>
using namespace std;
int n, c, dai, dem, tt, ck, min1, dai1, dai2, dt;
int a[111];
char s[33], s1[33], s2[33], tam[33];
void sol() {
  int i, j;
  int x, y, z;
  dai = strlen(s);
  x = 0;
  y = 0;
  for (i = 0; i < dai; i++) {
    if (s[i] == '|') {
      for (j = i + 1; j < dai; j++) {
        s2[y] = s[j];
        y++;
      }
      break;
    } else {
      s1[x] = s[i];
      x++;
    }
  }
  dt = strlen(tam);
  dai1 = strlen(s1);
  dai2 = strlen(s2);
  if (dai1 == dai2) {
    if (dt % 2 == 1) {
      cout << "Impossible\n";
      return;
    }
    for (i = 0; i < dt; i++) {
      if (i < dt / 2) {
        s1[x] = tam[i];
        x++;
      } else {
        s2[y] = tam[i];
        y++;
      }
    }
    cout << s1 << "|" << s2 << endl;
    return;
  }
  j = 0;
  if ((dai1 + dai2 + dt) % 2 == 0) {
    z = (dai1 + dai2 + dt) / 2;
    if (dai1 > z || dai2 > z) {
      cout << "Impossible\n";
      return;
    }
    for (x = dai1; x < z; x++) {
      s1[x] = tam[j];
      j++;
    }
    for (y = dai2; y < z; y++) {
      s2[y] = tam[j];
      j++;
    }
    cout << s1 << "|" << s2 << endl;
    return;
  }
  cout << "Impossible\n";
  return;
}
int main() {
  int i, j;
  while (scanf("%s %s", &s, &tam) > 0) {
    sol();
  }
  return 0;
}
