#include <bits/stdc++.h>
using namespace std;
int main() {
  string str, s;
  cin >> str >> s;
  int a = 0, b = 0;
  int i;
  for (i = 0; i < str.size(); i++)
    if (str[i] == '|')
      break;
    else
      a++;
  for (i = i + 1; i < str.size(); i++) b++;
  while (a != b || s.size() > 0) {
    if (s.size() == 0) break;
    if (a < b) {
      str = s[0] + str;
      s.erase(s.begin());
      a++;
    } else {
      str = str + s[0];
      s.erase(s.begin());
      b++;
    }
  }
  if (a == b)
    cout << str << endl;
  else
    cout << "Impossible" << endl;
  return 0;
}
