#include <bits/stdc++.h>
using namespace std;
const int N = 3;
char s[8];
int ms[N][N], ps[N];
int main() {
  for (int i = 0; i < N * (N - 1) / 2; i++) {
    scanf("%s", s);
    int u = s[0] - 'A', v = s[2] - 'A';
    int c = (s[1] == '>') ? 1 : -1;
    ms[u][v] = c;
    ms[v][u] = -c;
  }
  for (int i = 0; i < N; i++) ps[i] = i;
  do {
    bool ok = true;
    for (int i = 0; ok && i < N; i++)
      for (int j = i + 1; ok && j < N; j++) ok = (ms[ps[i]][ps[j]] < 0);
    if (ok) {
      for (int i = 0; i < N; i++) putchar(ps[i] + 'A');
      putchar('\n');
      return 0;
    }
  } while (next_permutation(ps, ps + N));
  puts("Impossible");
  return 0;
}
