#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, k, n, A1 = 1, B1 = 1, C1 = 1;
  char a[4], b[4], c[4];
  cin >> a;
  cin >> b;
  cin >> c;
  if (a[1] == '>') {
    if (a[0] == 'A')
      A1++;
    else if (a[0] == 'B')
      B1++;
    else
      C1++;
  } else {
    if (a[2] == 'A') A1++;
    if (a[2] == 'B') B1++;
    if (a[2] == 'C') C1++;
  }
  if (b[1] == '>') {
    if (b[0] == 'A') A1++;
    if (b[0] == 'B') B1++;
    if (b[0] == 'C') C1++;
  } else {
    if (b[2] == 'A') A1++;
    if (b[2] == 'B') B1++;
    if (b[2] == 'C') C1++;
  }
  if (c[1] == '>') {
    if (c[0] == 'A') A1++;
    if (c[0] == 'B') B1++;
    if (c[0] == 'C') C1++;
  } else {
    if (c[2] == 'A') A1++;
    if (c[2] == 'B') B1++;
    if (c[2] == 'C') C1++;
  }
  if (A1 > 1 && B1 > 1 && C1 > 1)
    cout << "Impossible";
  else {
    if (A1 == 1)
      cout << "A";
    else if (B1 == 1)
      cout << "B";
    else if (C1 == 1)
      cout << "C";
    if (A1 == 2)
      cout << "A";
    else if (B1 == 2)
      cout << "B";
    else if (C1 == 2)
      cout << "C";
    if (A1 == 3)
      cout << "A";
    else if (B1 == 3)
      cout << "B";
    else if (C1 == 3)
      cout << "C";
  }
  cout << endl;
  return 0;
}
