#include <bits/stdc++.h>
using namespace std;
int main() {
  string in, other, str1 = "", str2 = "";
  cin >> in >> other;
  int j = 0;
  int ans = 0;
  while (in[j] != '|') {
    str1 += in[j];
    j++;
  }
  j++;
  for (int i = j; i < in.length(); i++) str2 += in[i];
  ans = (in.length() - 1) + other.length();
  if (ans % 2 != 0) {
    cout << "Impossible";
    return 0;
  } else {
    int a = 0;
    while (other.length() != 0) {
      while (str1.length() <= str2.length() && other.length() != 0) {
        str1 += other[a];
        other.erase(a, 1);
      }
      while (str2.length() <= str1.length() && other.length() != 0) {
        str2 += other[a];
        other.erase(a, 1);
      }
    }
    if (str1.length() != str2.length())
      cout << "Impossible";
    else
      cout << str1 << "|" << str2;
  }
  return 0;
}
