#include <bits/stdc++.h>
using namespace std;
int row[] = {0, 1, 0, -1, -1, -1, 1, 1};
int col[] = {1, 0, -1, 0, 1, -1, -1, 1};
const long long N = 1e6 + 10;
const long long M = 1e18 + 7;
const long long H = 1e9 + 7;
const long long base = 131;
long long logx(long long a, long long bs) { return log(a) / log(bs); }
long long Max(long long a, long long b) {
  if (a > b) return a;
  return b;
}
long long Min(long long a, long long b) {
  if (a > b) return b;
  return a;
}
long long big_mul(long long a, long long b, long long m) {
  long long x = 0, y = a % m;
  while (b > 0) {
    if (b & 1) x = (x + y) % m;
    y = (2 * y) % m;
    b >>= 1;
  }
  return x % m;
}
long long big_mod(long long a, long long b, long long m) {
  long long x = 1, y = a % m;
  while (b > 0) {
    if (b & 1) x = (x * y) % m;
    y = (y * y) % m;
    b >>= 1;
  }
  return x % m;
}
long long Big_mod(long long a, long long b, long long m) {
  long long x = 1, y = a % m;
  while (b > 0) {
    if (b & 1) x = big_mul(x, y, m);
    y = big_mul(y, y, m);
    b >>= 1;
  }
  return x % m;
}
long long mod_inverse(long long a, long long m) { return big_mod(a, m - 2, m); }
long long GCD(long long a, long long b) {
  if (!a) return b;
  return GCD(b % a, a);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  string str;
  cin >> str;
  int cnt1 = 0;
  int cnt2 = 0;
  for (int i = 0; i < str.size(); i++) {
    if (str[i] == '|') break;
    cnt1++;
  }
  for (int i = str.size() - 1; i >= 0; i--) {
    if (str[i] == '|') break;
    cnt2++;
  }
  string str1;
  cin >> str1;
  int d = max(cnt1, cnt2) - min(cnt1, cnt2);
  if (d <= str1.size() && (str1.size() - d) % 2 == 0) {
    int p = cnt1 + cnt2 + str1.size();
    p /= 2;
    int pos = cnt1;
    for (int i = 0; i < pos; i++) cout << str[i];
    for (int i = 0; i < p - cnt1; i++) cout << str1[i];
    cout << "|";
    for (int i = pos + 1; i < str.size(); i++) cout << str[i];
    for (int i = p - cnt1; i < str1.size(); i++) cout << str1[i];
    cout << endl;
  } else
    cout << "Impossible" << endl;
  return 0;
}
