#include <bits/stdc++.h>
using namespace std;
int main(void) {
  ios::sync_with_stdio(false);
  cin.tie(NULL), cout.tie(NULL);
  string s, s1, s2, s3;
  cin >> s;
  cin >> s3;
  int i = 0, j = 0, cntr = s3.length();
  for (i = 0; i < s.length(); i++) {
    if (s[i] != '|')
      s1 += s[i];
    else
      break;
  }
  for (i = i + 1; i < s.length(); i++) {
    s2 += s[i];
  }
  while (1) {
    if (s1.length() > s2.length())
      s2 += s3[j];
    else if (s2.length() > s1.length())
      s1 += s3[j];
    else
      s1 += s3[j];
    j++;
    cntr--;
    if (cntr == 0) break;
  }
  if (s1.length() != s2.length())
    cout << "Impossible"
         << "\n";
  else
    cout << s1 << '|' << s2 << "\n";
  return 0;
}
