#include <bits/stdc++.h>
using namespace std;
string s1, s2;
int answer, i, len, leftt, rightt, cnt;
vector<char> vr;
vector<char> vl;
bool b = false;
int main() {
  cin >> s1 >> s2;
  len = s1.size();
  for (i = 0; i < len; i++) {
    if (s1[i] == '|') {
      leftt = i;
      rightt = len - i - 1;
    }
  }
  for (i = 0; i < leftt; i++) {
    if (s1[i] != ' ') vl.push_back(s1[i]);
  }
  for (i = leftt + 1; i < len; i++) {
    if (s1[i] != ' ') vr.push_back(s1[i]);
  }
  if (leftt == rightt) {
    if (s2.size() % 2 != 0)
      cout << "Impossible" << endl;
    else {
      b = true;
      for (i = 0; i < s2.size(); i += 2) {
        vl.push_back(s2[i]);
        vr.push_back(s2[i + 1]);
      }
    }
  } else if (leftt > rightt) {
    int x = s2.size() - leftt + rightt;
    i = 0;
    if (x < 0 || x % 2 != 0)
      cout << "Impossible" << endl;
    else {
      b = true;
      while (leftt > rightt) {
        vr.push_back(s2[i]);
        i++;
        rightt++;
        cnt = i;
      }
      for (i = cnt; i < s2.size(); i += 2) {
        vr.push_back(s2[i]);
        vl.push_back(s2[i + 1]);
      }
    }
  } else if (leftt < rightt) {
    i = 0;
    int y = s2.size() - rightt + leftt;
    if (y < 0 || y % 2 != 0)
      cout << "Impossible" << endl;
    else {
      b = true;
      while (leftt < rightt) {
        vl.push_back(s2[i]);
        i++;
        leftt++;
        cnt = i;
      }
      for (i = cnt; i < s2.size(); i += 2) {
        vr.push_back(s2[i]);
        vl.push_back(s2[i + 1]);
      }
    }
  }
  if (b) {
    for (i = 0; i < vl.size(); i++) cout << vl[i];
    cout << '|';
    for (i = 0; i < vr.size(); i++) cout << vr[i];
  }
  return 0;
}
