#include <bits/stdc++.h>
using namespace std;
int main() {
  char a1, a2, a3, b1, b2, b3, s1, s2, s3;
  double num = 0, val[3] = {1.5, 2.5, -0.5};
  scanf("%c%c%c\n", &a1, &s1, &b1);
  num += (val[a1 - 'A'] + val[b1 - 'A']) *
         (s1 == (a1 - b1 == -1 || a1 - b1 == 2 ? '>' : '<'));
  scanf("%c%c%c\n", &a2, &s2, &b2);
  num += (val[a2 - 'A'] + val[b2 - 'A']) *
         (s2 == (a2 - b2 == -1 || a2 - b2 == 2 ? '>' : '<'));
  scanf("%c%c%c", &a3, &s3, &b3);
  num += (val[a3 - 'A'] + val[b3 - 'A']) *
         (s3 == (a3 - b3 == -1 || a3 - b3 == 2 ? '>' : '<'));
  if (num == 1)
    printf("ABC\n");
  else if (num == 2)
    printf("CAB\n");
  else if (num == 3)
    printf("ACB\n");
  else if (num == 4)
    printf("BCA\n");
  else if (num == 5)
    printf("BAC\n");
  else if (num == 6)
    printf("CBA\n");
  else
    printf("Impossible\n");
  return 0;
}
