#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string st1, st2;
  cin >> st1;
  cin >> st2;
  int before, after;
  for (int i = 0;; i++) {
    if (st1[i] == '|') {
      before = i;
      break;
    }
  }
  after = st1.size() - before - 1;
  int i = before;
  for (char x : st2) {
    if (before < after) {
      char ch[2];
      ch[0] = x, ch[1] = *st2.end();
      st1.insert(i, ch);
      i++;
      before++;
    } else {
      st1.push_back(x);
      after++;
    }
  }
  if (before == after)
    for (char x : st1) cout << x;
  else
    cout << "Impossible" << endl;
  return 0;
}
