#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  string t;
  cin >> t;
  long long n = s.size();
  long long p = 0;
  long long m = t.size();
  string ans;
  string ans1;
  for (long long i = 0; i < n; i++) {
    if (s[i] == '|') {
      p = i;
      break;
    }
    ans.push_back(s[i]);
  }
  long long cnt = 0;
  for (long long i = p + 1; i < n; i++) {
    cnt += 1;
    ans1.push_back(s[i]);
  }
  long long x = abs(cnt - p);
  if ((x + m) % 2 != 0 || m < x)
    cout << "Impossible"
         << "\n";
  else {
    long long y = p;
    long long i = 0;
    if (y < cnt) {
      while (y < cnt) {
        ans.push_back(t[i]);
        y += 1;
        i += 1;
      }
      for (long long j = i; j < m; j++) {
        if (j % 2 == 0)
          ans.push_back(t[j]);
        else
          ans1.push_back(t[j]);
      }
      cout << ans << "|" << ans1 << "\n";
    } else {
      long long y = p;
      long long i = 0;
      while (cnt < y) {
        ans1.push_back(t[i]);
        cnt += 1;
        i += 1;
      }
      for (long long j = i; j < m; j++) {
        if (j % 2 == 0)
          ans.push_back(t[j]);
        else
          ans1.push_back(t[j]);
      }
      cout << ans << "|" << ans1 << "\n";
    }
  }
  return 0;
}
