#include <bits/stdc++.h>
using namespace std;
int main() {
  string s1, s2, s3;
  cin >> s1 >> s2 >> s3;
  int a = 0, b = 0, c = 0;
  for (int x = 0; x < 3; x += 2) {
    if ((s1[x] == 'A' && s1[x + 1] == '>') ||
        (s1[x - 1] == '<' && s1[x] == 'A'))
      a += 1;
    if ((s2[x] == 'A' && s2[x + 1] == '>') ||
        (s2[x - 1] == '<' && s2[x] == 'A'))
      a += 1;
    if ((s3[x] == 'A' && s3[x + 1] == '>') ||
        (s3[x - 1] == '<' && s3[x] == 'A'))
      a += 1;
    if ((s1[x] == 'B' && s1[x + 1] == '>') ||
        (s1[x - 1] == '<' && s1[x] == 'B'))
      b += 1;
    if ((s2[x] == 'B' && s2[x + 1] == '>') ||
        (s2[x - 1] == '<' && s2[x] == 'B'))
      b += 1;
    if ((s3[x] == 'B' && s3[x + 1] == '>') ||
        (s3[x - 1] == '<' && s3[x] == 'B'))
      b += 1;
    if ((s1[x] == 'C' && s1[x + 1] == '>') ||
        (s1[x - 1] == '<' && s1[x] == 'C'))
      c += 1;
    if ((s2[x] == 'C' && s2[x + 1] == '>') ||
        (s2[x - 1] == '<' && s2[x] == 'C'))
      c += 1;
    if ((s3[x] == 'C' && s3[x + 1] == '>') ||
        (s3[x - 1] == '<' && s3[x] == 'C'))
      c += 1;
  }
  if (a == c || a == b || b == c)
    cout << "Impossible";
  else {
    for (int x = 0; x <= 2; x++) {
      if (a == x)
        cout << 'A';
      else if (b == x)
        cout << 'B';
      else if (c == x)
        cout << 'C';
    }
  }
  return 0;
}
