#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
inline void smin(T &a, U b) {
  if (a > b) a = b;
}
template <typename T, typename U>
inline void smax(T &a, U b) {
  if (a < b) a = b;
}
int power(int a, int b, int m, int ans = 1) {
  for (; b; b >>= 1, a = 1LL * a * a % m)
    if (b & 1) ans = 1LL * ans * a % m;
  return ans;
}
char s[100];
char ss[100];
int main() {
  scanf("%s", s);
  scanf("%s", ss);
  int m = strlen(ss);
  int n = strlen(s);
  int k;
  for (int i = 0; i < n; i++)
    if (s[i] == '|') {
      k = i;
      break;
    }
  int a = k;
  int b = n - k - 1;
  if (min(a, b) + m < max(a, b) || (n + m) % 2 == 0) {
    printf("Impossible");
    return 0;
  }
  for (int i = 0; i < a; i++) printf("%c", s[i]);
  for (int i = 0; i < (b + m - a) / 2; i++) printf("%c", ss[i]);
  printf("|");
  for (int i = k + 1; i < n; i++) printf("%c", s[i]);
  for (int i = (b + m - a) / 2; i < m; i++) printf("%c", ss[i]);
  return 0;
}
