#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string a[3];
  for (int i = 0; i < 3; i++) cin >> a[i];
  int ar[3] = {0};
  for (int i = 0; i < 3; i++) {
    if (a[i][1] == '>') {
      ar[a[i][0] - 'A']++;
    } else {
      ar[a[i][2] - 'A']++;
    }
  }
  int cnt = 0;
  string ans;
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 3; j++) {
      if (ar[j] == cnt) {
        if (j == 0)
          ans.push_back('A');
        else if (j == 1)
          ans.push_back('B');
        else
          ans.push_back('C');
        cnt++;
        break;
      }
    }
  }
  if (ans.size() == 3)
    cout << ans;
  else
    cout << "Impossible";
  return 0;
}
