#include <bits/stdc++.h>
using namespace std;
int main() {
  long long i, j = 0, x, y, z, count = 0, sum = 0, ans = 0;
  string s, s1;
  cin >> s >> s1;
  vector<char> v, w, q;
  queue<char> qu;
  for (long long i = 0; i < s.size(); i++) {
    if (s[i] != '|') {
      count++;
      w.push_back(s[i]);
    } else
      break;
  }
  for (long long i = s.size() - 1; i >= 0; i--) {
    if (s[i] != '|') {
      sum++;
      q.push_back(s[i]);
    } else
      break;
  }
  long long k = sum + count + s1.size();
  if (sum > (k / 2) || count > (k / 2) || k & 1)
    cout << "Impossible" << endl;
  else {
    for (long long i = 0; i < s1.size(); i++) {
      qu.push(s1[i]);
    }
    reverse(q.begin(), q.end());
    for (auto it : w) cout << it;
    while (!qu.empty()) {
      if (count == (k / 2)) break;
      cout << qu.front();
      qu.pop();
      count++;
    }
    cout << "|";
    for (auto it : q) cout << it;
    while (!qu.empty()) {
      cout << qu.front();
      qu.pop();
    }
    cout << endl;
  }
  return 0;
}
