#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, tek, f;
  string s, g;
  cin >> s;
  cin >> g;
  tek = 0;
  while (s[tek] != '|') tek++;
  int h = s.size() - 1 - tek;
  m = s.size() - h - 1;
  f = abs(h - m);
  if (g.size() < f || (g.size() - f) % 2 != 0) {
    cout << "Impossible";
    return 0;
  }
  int t = (g.size() - f) / 2;
  if (h > m) {
    for (int i = 0; i < t + f; i++) cout << g[i];
    cout << s;
    for (int i = t + f; i < g.size(); i++) cout << g[i];
  } else {
    for (int i = 0; i < t; i++) cout << g[i];
    cout << s;
    for (int i = t; i < g.size(); i++) cout << g[i];
  }
}
