#include <bits/stdc++.h>
using namespace std;
int mx[3], mn[3];
int main() {
  char s[1234][12];
  int n = 0;
  while (gets(s[n]) != NULL) {
    n++;
  }
  for (int i = 0; i < n; i++) {
    int a = s[i][0] - 'A';
    int b = s[i][2] - 'A';
    if (s[i][1] == '<') {
      mn[a]++;
      mx[b]++;
    } else {
      mn[b]++;
      mx[a]++;
    }
  }
  int posmin = -1;
  int posmax = -1;
  for (int i = 0; i < 3; i++) {
    if (mn[i] == 0) posmax = i;
    if (mx[i] == 0) posmin = i;
  }
  int posmid;
  for (int i = 0; i < 3; i++)
    if (i != posmin && i != posmax) posmid = i;
  if (posmin == -1 || posmax == -1)
    printf("Impossible\n");
  else {
    printf("%c%c%c\n", posmin + 'A', posmid + 'A', posmax + 'A');
  }
  return 0;
}
