#include <bits/stdc++.h>
using namespace std;
char x, y, f;
struct abc {
  char c;
  int k;
} q[3];
bool cmp(abc a, abc b) { return a.k < b.k; }
int main() {
  for (int i = 0; i < 3; i++) {
    q[i].c = 65 + i;
  }
  for (int i = 1; i <= 3; i++) {
    cin >> x >> f >> y;
    if (f == '>')
      q[x - 'A'].k++;
    else if (f == '<')
      q[y - 'A'].k++;
  }
  sort(q, q + 3, cmp);
  if (q[1].k == q[2].k || q[1].k == q[0].k || q[2].k == q[0].k)
    cout << "Impossible";
  else
    cout << q[0].c << q[1].c << q[2].c;
}
