#include <bits/stdc++.h>
using namespace std;
int main() {
  istream& in(std::cin);
  ostream& out(std::cout);
  ios_base::sync_with_stdio(false);
  in.tie(NULL);
  string a, b;
  in >> a >> b;
  for (auto i : b) a = a.find('|') < a.length() / 2 ? i + a : a + i;
  out << (a[a.length() / 2] == '|' && a.length() % 2 ? a : "Impossible");
  return 0;
}
