#include <bits/stdc++.h>
int IntMaxVal = (int)1e20;
long long LongMaxVal = (long long)1e20;
template <typename T>
struct argument_type;
template <typename T, typename U>
struct argument_type<T(U)> {};
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  string s1;
  cin >> s1;
  ;
  string s2;
  cin >> s2;
  ;
  int i1;
  for (int i = 0; i < s1.length() - 1 + 1; ++i)
    if (s1[i] == '|') {
      i1 = i;
    }
  int w1 = i1;
  int w2 = s1.length() - 1 - w1;
  int w3 = s2.length();
  if (w1 + w3 >= w2 && w2 + w3 >= w1 && (w1 + w2 + w3) % 2 == 0) {
    vector<char> c1;
    vector<char> c2;
    for (int i = 0; i < s2.length() - 1 + 1; ++i) {
      if (w1 < w2) {
        c1.push_back(s2[i]);
        w1++;
      } else {
        c2.push_back(s2[i]);
        w2++;
      }
    }
    for (int i = 0; i < (int)c1.size() - 1 + 1; ++i) cout << c1[i];
    cout << s1;
    for (int i = 0; i < (int)c2.size() - 1 + 1; ++i) cout << c2[i];
  } else
    cout << "Impossible";
}
