#include <bits/stdc++.h>
using namespace std;
int main() {
  string str;
  cin >> str;
  string extra;
  cin >> extra;
  string left = "";
  string right = "";
  bool ok = 0;
  for (int i = 0; i < str.length(); ++i) {
    if (str[i] == '|') {
      ok = 1;
      continue;
    }
    if (!ok) {
      left += str[i];
    } else {
      right += str[i];
    }
  }
  int inc = 0;
  while (left.length() < right.length()) {
    left += extra[inc];
    ++inc;
    if (inc > extra.length()) {
      break;
    }
  }
  while (left.length() > right.length()) {
    right += extra[inc];
    ++inc;
    if (inc > extra.length()) {
      break;
    }
  }
  int len = extra.length() - inc;
  int f = 0;
  while (len) {
    if (!f) {
      if (inc > extra.length()) {
        break;
      }
      left += extra[inc];
      inc++;
      len--;
      if (inc > extra.length()) {
        break;
      }
      f = !f;
    } else {
      if (inc > extra.length()) {
        break;
      }
      right += extra[inc];
      inc++;
      len--;
      f = !f;
    }
  }
  if (right.length() != left.length()) {
    cout << "Impossible" << endl;
  } else {
    cout << left << "|" << right << endl;
  }
  return 0;
}
