#include <bits/stdc++.h>
using namespace std;
string s, t;
int l = 0, r = 0;
int main() {
  cin >> s >> t;
  while (s[l] != '|') l++;
  r = s.size() - l - 1;
  int dif;
  if (l > r)
    dif = t.size() - (l - r);
  else
    dif = t.size() - (r - l);
  if (dif < 0 || dif & 1) {
    cout << "Impossible" << endl;
    return 0;
  }
  if (l < r) {
    reverse(s.begin(), s.end());
    int i = 0;
    while (l < r) {
      s += t[i];
      i++;
      l++;
    }
    while (i < t.size()) {
      s += t[i];
      i++;
      s = t[i] + s;
      i++;
    }
    reverse(s.begin(), s.end());
    cout << s << endl;
    return 0;
  }
  int i = 0;
  while (r < l) {
    s += t[i];
    i++;
    r++;
  }
  while (i < t.size()) {
    s += t[i];
    i++;
    s = t[i] + s;
    i++;
  }
  cout << s << endl;
  return 0;
}
