#include <bits/stdc++.h>
using namespace std;
int main() {
  string p;
  string s;
  cin >> p >> s;
  int i;
  for (i = 0; p[i] != '|'; i++)
    ;
  int a, b;
  a = i;
  b = p.length() - 1 - i;
  int q;
  q = s.length() - abs(b - a);
  if (q < 0) {
    cout << "Impossible";
    cout << endl;
    return 0;
  }
  if (q % 2 == 0) {
    int k;
    k = (s.length() - abs(b - a)) / 2;
    if (a > b) {
      for (i = 0; i < a; i++) cout << p[i];
      for (i = 0; i < k; i++) cout << s[i];
      cout << "|";
      for (i = a + 1; i < p.length(); i++) cout << p[i];
      for (i = k; i < s.length(); i++) cout << s[i];
    }
    if (a <= b) {
      for (i = 0; i < a; i++) cout << p[i];
      for (i = 0; i < k + abs(b - a); i++) cout << s[i];
      cout << "|";
      for (i = a + 1; i < p.length(); i++) cout << p[i];
      for (i = k + abs(b - a); i < s.length(); i++) cout << s[i];
    }
  } else
    cout << "Impossible";
  cout << endl;
  return 0;
}
