#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int i, x = 0, y = 0, z = 0;
  string a;
  for (i = 0; i < 3; i++) {
    cin >> a;
    if (a[1] == '>') {
      if (a[0] == 'A')
        x++;
      else if (a[0] == 'B')
        y++;
      else
        z++;
    } else {
      if (a[2] == 'A')
        x++;
      else if (a[2] == 'B')
        y++;
      else
        z++;
    }
  }
  if (x == y && x == z) {
    cout << "Impossible";
  } else {
    for (i = 0; i < 3; i++) {
      if (x == min(x, min(y, z))) {
        cout << 'A';
        x = 3;
      } else if (y == min(x, min(y, z))) {
        cout << 'B';
        y = 3;
      } else {
        cout << 'C';
        z = 3;
      }
    }
  }
}
