#include <bits/stdc++.h>
using namespace std;
void past_code();
int main() {
  string s;
  int ca = 0, cb = 0, cc = 0;
  int y[3];
  fill_n(y, 3, 0);
  for (int i = 0; i < 3; i++) {
    cin >> s;
    if (s[1] == '>') {
      if (s[0] == 'A') ca++;
      if (s[0] == 'B') cb++;
      if (s[0] == 'C') cc++;
    } else {
      if (s[2] == 'A') ca++;
      if (s[2] == 'B') cb++;
      if (s[2] == 'C') cc++;
    }
  }
  y[0] = ca;
  y[1] = cb;
  y[2] = cc;
  sort(y, y + 3);
  if (y[0] == y[1] || y[1] == y[2])
    cout << "Impossible\n";
  else if (ca == y[2] && cb == y[1])
    cout << "CBA\n";
  else if (ca == y[2] && cc == y[1])
    cout << "BCA\n";
  else if (cb == y[2] && cc == y[1])
    cout << "ACB\n";
  else if (cb == y[2] && ca == y[1])
    cout << "CAB\n";
  else if (cc == y[2] && ca == y[1])
    cout << "BAC\n";
  else if (cc == y[2] && cb == y[1])
    cout << "ABC\n";
  return 0;
}
