#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int i, j;
  long long int x[3] = {0};
  string s;
  for (i = 0; i < 3; i++) {
    cin >> s;
    if (s[1] == '>')
      x[s[0] - 'A']++;
    else
      x[s[2] - 'A']++;
  }
  if (x[0] == x[1] || x[1] == x[2] || x[2] == x[0])
    cout << "Impossible";
  else {
    for (i = 0; i < 3; i++) {
      for (j = 0; j < 3; j++) {
        if (i == x[j]) cout << char('A' + j);
      }
    }
  }
}
