#include <bits/stdc++.h>
using namespace std;
int main() {
  pair<int, char> p[3] = {{1, 'A'}, {1, 'B'}, {1, 'C'}};
  for (int i = 0; i < 3; i++) {
    string s;
    cin >> s;
    if (s[1] == '>') {
      p[s[0] - 'A'].first *= 2;
    } else
      p[s[2] - 'A'].first *= 2;
  }
  sort(p, p + 3);
  if (p[0].first == p[1].first || p[1].first == p[2].first) {
    cout << "Impossible\n";
    return 0;
  }
  cout << p[0].second << p[1].second << p[2].second << "\n";
}
