#include <bits/stdc++.h>
using namespace std;
string s1, s2;
int main() {
  cin >> s1;
  cin >> s2;
  int c1, c2;
  c1 = c2 = 0;
  bool si = false;
  int ind = 0;
  for (int i = 0; i < s1.size(); i++) {
    if (s1[i] == '|') {
      si = true;
      ind = i;
      continue;
    }
    if (si)
      c2++;
    else
      c1++;
  }
  for (int i = 0; i < s2.size(); i++) {
    if (c1 > c2)
      c2++;
    else
      c1++;
  }
  if (c1 == c2) {
    for (int i = 0; i < ind; i++) cout << s1[i];
    c1 -= ind;
    for (int i = 0; i < c1; i++) cout << s2[i];
    cout << "|";
    for (int i = ind + 1; i < s1.size(); i++) cout << s1[i];
    for (int i = c1; i < s2.size(); i++) cout << s2[i];
    cout << endl;
  } else
    cout << "Impossible" << endl;
  return 0;
}
