#include <bits/stdc++.h>
const long long MOD = 1000000007;
const int INF = 1 << 30;
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  pair<char, char> a[] = {pair<char, char>(0, 'A'), pair<char, char>(0, 'B'),
                          pair<char, char>(0, 'C')};
  string t;
  for (int i = 0; i < 3; ++i) {
    cin >> t;
    if (t[1] == '>') {
      a[t[0] - 'A'].first++;
      a[t[2] - 'A'].first--;
    } else {
      a[t[0] - 'A'].first--;
      a[t[2] - 'A'].first++;
    }
  }
  sort(a, a + 3);
  if (a[0].first != -2 || a[1].first != 0 || a[2].first != 2) {
    cout << "Impossible";
  } else {
    for (int i = 0; i < 3; ++i) {
      cout << a[i].second;
    }
  }
  return 0;
}
