#include <bits/stdc++.h>
using namespace std;
int main() {
  string s1, s2, left, line;
  cin >> line;
  bool first = true;
  for (int i = 0; i < line.size(); i++) {
    if (line[i] == '|')
      first = false;
    else if (first)
      s1 += line[i];
    else
      s2 += line[i];
  }
  cin >> left;
  int l1 = s1.size();
  int l2 = s2.size();
  int l3 = left.size();
  int m = (l1 + l2 + l3) / 2;
  if ((l1 + l2 + l3) % 2 == 1 || l1 > m || l2 > m)
    cout << "Impossible" << endl;
  else {
    cout << s1;
    int p = m - l1;
    for (int i = 0; i < p; i++) cout << left[i];
    cout << "|";
    cout << s2;
    for (int i = p; i < l3; i++) cout << left[i];
    cout << endl;
  }
}
