#include <bits/stdc++.h>
using namespace std;
signed main() {
  vector<int> alpha(3);
  for (int i = 0; i < 3; i++) {
    string s;
    cin >> s;
    if (s[1] == '>')
      alpha[s[0] - 'A']++;
    else
      alpha[s[2] - 'A']++;
  }
  vector<int> ver = alpha;
  sort(ver.begin(), ver.end());
  if (ver[0] == 0 && ver[1] == 1 && ver[2] == 2)
    cout << (char)('A' + (find(alpha.begin(), alpha.end(), 0) - alpha.begin()))
         << (char)('A' + (find(alpha.begin(), alpha.end(), 1) - alpha.begin()))
         << (char)('A' + (find(alpha.begin(), alpha.end(), 2) - alpha.begin()));
  else
    cout << "Impossible";
  return 0;
}
