#include <bits/stdc++.h>
using namespace std;
int main() {
  int a = 0, b = 0, c = 0;
  string s;
  for (int i = 0; i < 3; i++) {
    cin >> s;
    if (s == "A<B") b++;
    if (s == "B>A") b++;
    if (s == "A>B") a++;
    if (s == "B<A") a++;
    if (s == "A<C") c++;
    if (s == "C>A") c++;
    if (s == "A>C") a++;
    if (s == "C<A") a++;
    if (s == "C<B") b++;
    if (s == "B>C") b++;
    if (s == "C>B") c++;
    if (s == "B<C") c++;
  }
  if ((a == b) && (b == c))
    cout << "Impossible" << endl;
  else if ((c > b) && (b > a))
    cout << "ABC" << endl;
  else if ((b > c) && (c > a))
    cout << "ACB" << endl;
  else if ((a > c) && (b > a))
    cout << "CAB" << endl;
  else if ((c > a) && (a > b))
    cout << "BAC" << endl;
  else if ((a > c) && (c > b))
    cout << "BCA" << endl;
  else if ((a > b) && (b > c))
    cout << "CBA" << endl;
  return 0;
}
