#include <bits/stdc++.h>
using namespace std;
int main() {
  int a = 0, b = 0, c = 0;
  string x;
  for (int i = 1; i <= 3; i++) {
    getline(cin, x);
    if (x[0] == 'A') {
      if (x[1] == '>')
        a++;
      else {
        if (x[2] == 'B')
          b++;
        else
          c++;
      }
    }
    if (x[0] == 'B') {
      if (x[1] == '>')
        b++;
      else {
        if (x[2] == 'A')
          a++;
        else
          c++;
      }
    }
    if (x[0] == 'C') {
      if (x[1] == '>')
        c++;
      else {
        if (x[2] == 'A')
          a++;
        else
          b++;
      }
    }
  }
  if (a == b || a == c || b == c) {
    cout << "Impossible";
    return 0;
  }
  for (int i = 0; i < 3; i++) {
    if (a == i) {
      cout << 'A';
      continue;
    } else if (b == i) {
      cout << 'B';
      continue;
    } else {
      cout << 'C';
      continue;
    }
  }
  return 0;
}
