#include <bits/stdc++.h>
using namespace std;
string b = "ABC", S = "";
int dem[3];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie();
  cout.tie();
  string s[4];
  for (int i = 1; i <= 3; i++) cin >> s[i];
  for (int i = 1; i <= 3; i++) {
    if (s[i][1] == '<')
      dem[b.find(s[i][2])]++;
    else
      dem[b.find(s[i][0])]++;
  }
  bool ok1, ok2, ok3;
  ok1 = ok2 = ok3 = 0;
  for (int i = 0; i < 3; i++)
    if (!dem[i]) {
      S += b[i];
      ok1 = 1;
      for (int j = 0; j < 3; j++)
        if (dem[j] == 1 && j != i) {
          ok2 = 1;
          S += b[j];
          for (int k = 0; k < 3; k++)
            if (dem[k] == 2)
              if (k != i && k != j) {
                S += b[k];
                ok3 = 1;
                cout << S;
                return 0;
              }
        }
    }
  if (ok1 && ok2 && ok3)
    cout << S;
  else
    cout << "Impossible";
  return 0;
}
