#include <bits/stdc++.h>
using namespace std;
string str, war, air;
pair<int, int> arr[3];
int a, b, c;
bool s;
int main() {
  for (int i = 0; i < 3; i++) {
    cin >> str;
    if (str == "A>B" || str == "A>C" || str == "B<A" || str == "C<A") a++;
    if (str == "B>A" || str == "B>C" || str == "A<B" || str == "C<B") b++;
    if (str == "C>A" || str == "C>B" || str == "B<C" || str == "A<C") c++;
    if (i == 2) {
      arr[0].first = a;
      arr[0].second = 1;
      arr[1].first = b;
      arr[1].second = 2;
      arr[2].first = c;
      arr[2].second = 3;
      if (c == b || c == a || a == b) s = 1;
    }
  }
  if (!s) {
    sort(arr, arr + 3);
    for (int j = 0; j < 3; j++) {
      if (arr[j].second == 1)
        cout << "A";
      else if (arr[j].second == 2)
        cout << "B";
      else if (arr[j].second == 3)
        cout << "C";
    }
  } else
    cout << "Impossible";
  return 0;
}
