#include <bits/stdc++.h>
using namespace std;
int pnt[3], order[3];
bool cp(int a, int b) { return pnt[a] < pnt[b]; }
int main() {
  order[0] = 0, order[1] = 1, order[2] = 2;
  char x, y, lsormo;
  for (int i = 0; i < 3; i++) {
    scanf(" %c%c%c", &x, &lsormo, &y);
    if (lsormo == '>')
      pnt[x - 'A']++;
    else
      pnt[y - 'A']++;
  }
  sort(order, order + 3, cp);
  if (pnt[order[0]] != 0)
    printf("Impossible");
  else {
    for (int i = 0; i < 3; i++) {
      printf("%c", 'A' + order[i]);
    }
  }
  return 0;
}
