#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, lenl, lenr, leno;
  string s, o, l = "", r = "";
  cin >> s;
  for (x = 0; s[x] != '|'; x++) l += s[x];
  x++;
  for (x; s[x]; x++) r += s[x];
  cin >> o;
  leno = o.size();
  lenl = l.size();
  lenr = r.size();
  if (lenl == lenr) {
    if (leno & 1)
      cout << "Impossible\n";
    else {
      for (int i = 0; o[i]; i++) {
        if (i & 1)
          r += o[i];
        else
          l += o[i];
      }
      cout << l << "|" << r << endl;
    }
  } else if (lenl > lenr) {
    if ((leno >= (lenl - lenr)) && (((leno - lenl + lenr) & 1) == 0)) {
      for (int i = 0; i < (lenl - lenr); i++) r += o[i];
      for (int i = (lenl - lenr); o[i]; i++) {
        if (i & 1)
          r += o[i];
        else
          l += o[i];
      }
      cout << l << "|" << r << endl;
    } else
      cout << "Impossible\n";
  } else {
    if ((leno >= (lenr - lenl)) && (((leno - lenr + lenl) & 1) == 0)) {
      for (int i = 0; i < (lenr - lenl); i++) l += o[i];
      for (int i = (lenr - lenl); o[i]; i++) {
        if (i & 1)
          r += o[i];
        else
          l += o[i];
      }
      cout << l << "|" << r << endl;
    } else
      cout << "Impossible\n";
  }
  return 0;
}
