#include <bits/stdc++.h>
using namespace std;
long long n, m, a, b, d, l, r;
string z, x;
int main() {
  cin >> z >> x;
  a = z.size();
  b = x.size();
  if ((a + b) % 2 == 0) {
    cout << "Impossible" << endl;
    return 0;
  }
  for (int c = 0; c < a; c++) {
    if (z[c] == '|') {
      d = c;
      break;
    }
  }
  r = a - d - 1;
  l = d;
  if (max(r, l) <= min(r, l) + b) {
    d = (a + b - 1) / 2;
    for (int c = 0; c < d - l; c++) {
      cout << x[c];
    }
    cout << z;
    for (int c = d - l; c < b; c++) {
      cout << x[c];
    }
  } else {
    cout << "Impossible" << endl;
  }
  return 0;
}
