#include <bits/stdc++.h>
using namespace std;
bool check(string s) {
  int n = s.length();
  if (n % 2 == 0) return false;
  return s[n / 2] == '|';
}
int MAIN() {
  string s;
  cin >> s;
  string t;
  cin >> t;
  string ans = "Impossible";
  for (int i = 0; i <= t.length(); i++) {
    string t1, t2;
    for (int j = 0; j < i; j++) t1 += t[j];
    for (int j = i; j < t.length(); j++) t2 += t[j];
    if (check(t1 + s + t2)) ans = t1 + s + t2;
  }
  cout << ans << endl;
  return 0;
}
int main() {
  ios ::sync_with_stdio(false);
  cout << fixed << setprecision(16);
  return MAIN();
}
