#include <bits/stdc++.h>
using namespace std;
bool isPrime(int x) {
  if (x == 1) return false;
  for (long long i = 2; i <= sqrt(x); i += 1)
    if (x % i == 0) return false;
  return true;
}
void print(int a[], int n) {
  for (long long i = 0; i < n; i += 1) cout << a[i] << " ";
}
void iarr(int *a, int n) {
  for (long long i = 0; i < n; i += 1) cin >> a[i];
}
long long power(long long a, long long b) {
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = ((res % 1000000007) * (a % 1000000007)) % 1000000007;
    a = ((a % 1000000007) * (a % 1000000007)) % 1000000007;
    b >>= 1;
  }
  return res;
}
long long numFactors(long long x) {
  long long cnt = 0;
  for (long long i = 1; i <= sqrt(x); i += 1) {
    if (x % i == 0) {
      if (x / i == i)
        cnt += 1;
      else
        cnt += 2;
    }
  }
  return cnt;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  string s1, s2;
  cin >> s1 >> s2;
  vector<char> v1, v2;
  int f = 0;
  for (long long i = 0; i < s1.length(); i += 1) {
    if (s1[i] != '|') {
      if (f == 0) {
        v1.push_back(s1[i]);
      } else {
        v2.push_back(s1[i]);
      }
    } else {
      f = 1;
    }
  }
  int n1 = v1.size(), n2 = v2.size();
  int k = s2.length(), p = 0;
  if (n1 < n2) {
    while (n1 != n2 && p != s2.length()) {
      v1.push_back(s2[p++]);
      n1++;
    }
  } else if (n1 > n2) {
    while (n2 != n1 && p != s2.length()) {
      v2.push_back(s2[p++]);
      n2++;
    }
  }
  f = 0;
  if (p != s2.length()) {
    for (long long i = p; i < s2.length(); i += 1) {
      if (f == 0) {
        v1.push_back(s2[i]);
        f = 1;
      } else {
        v2.push_back(s2[i]);
        f = 0;
      }
    }
  }
  if (v1.size() == v2.size()) {
    for (auto i : v1) cout << i;
    cout << "|";
    for (auto i : v2) cout << i;
  } else {
    cout << "Impossible\n";
  }
  return 0;
}
