#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int s[3] = {};
  string s1, s2, s3;
  cin >> s1;
  if (s1[1] == '>') {
    s[s1[0] - 'A']++;
  } else {
    s[s1[2] - 'A']++;
  }
  cin >> s2;
  if (s2[1] == '>') {
    s[s2[0] - 'A']++;
  } else {
    s[s2[2] - 'A']++;
  }
  cin >> s3;
  if (s3[1] == '>') {
    s[s3[0] - 'A']++;
  } else {
    s[s3[2] - 'A']++;
  }
  set<int> dis;
  for (int i = 0; i < 3; i++) {
    dis.insert(s[i]);
  }
  if (dis.size() < 3) {
    cout << "Impossible";
    return 0;
  }
  int cnt = 0;
  for (int i = 0; i < 3; i++) {
    if (s[i] == cnt) {
      cout << (char)('A' + i);
      i = -1;
      s[i] = -1;
      cnt++;
    }
  }
}
