#include <bits/stdc++.h>
int main() {
  int x[3];
  char str[10];
  for (int i = 0; i < 3; i++) {
    x[i] = 7;
  }
  for (int i = 0; i < 3; i++) {
    scanf("%[^\n]", str);
    getchar();
    int a = str[0] - 'A';
    int b = str[2] - 'A';
    if (str[1] == '>') {
      x[a]++;
      x[b]--;
    } else {
      x[a]--;
      x[b]++;
    }
  }
  int max = -1, min = 9, m, o;
  if (x[0] == x[1] || x[0] == x[2] || x[1] == x[2]) {
    printf("Impossible\n");
  } else {
    for (int i = 0; i < 3; i++) {
      if (x[i] > max) {
        max = x[i];
        m = i;
      }
      if (x[i] < min) {
        min = x[i];
        o = i;
      }
    }
    printf("%c%c%c\n", o + 'A', 3 - m - o + 'A', m + 'A');
  }
  return 0;
}
