#include <bits/stdc++.h>
using namespace std;
char s[1000];
char a[1000];
int main() {
  scanf("%s", &s);
  int l = 0, r = 0, mid = -1;
  int n = strlen(s);
  for (int i = 0; s[i] != '|'; i++) {
    l++;
    mid = i;
  }
  for (int i = mid + 2; i < n; i++) r++;
  scanf("%s", &a);
  int m = strlen(a);
  int flag = 0;
  int k = r + m - l;
  if (k >= 0 && k % 2 == 0 && k / 2 <= m) flag = 1;
  k = k / 2;
  if (flag) {
    for (int i = 0; i <= mid; i++) printf("%c", s[i]);
    for (int i = 0; i < k; i++) printf("%c", a[i]);
    cout << '|';
    for (int i = mid + 2; i < n; i++) printf("%c", s[i]);
    for (int i = k; i < m; i++) printf("%c", a[i]);
    printf("\0");
    printf("\n");
  } else
    cout << "Impossible" << endl;
  return 0;
}
