#include <bits/stdc++.h>
using namespace std;
void solve() {
  string a[3];
  for (int i = 0; i < 3; i++) cin >> a[i];
  map<char, int> s;
  for (char i = 'A'; i < 'D'; i++) {
    s[i] = 0;
  }
  for (int i = 0; i < 3; i++) {
    if (a[i][1] == '>')
      s[a[i][0]]++;
    else
      s[a[i][2]]++;
  }
  bool x = 1;
  for (auto i = s.begin(); i != s.end(); i = next(i)) {
    if (i->second != 1) x = 0;
  }
  if (x) {
    cout << "Impossible" << '\n';
  } else {
    for (auto i = s.begin(); i != s.end(); i = next(i)) {
      if (i->second == 0) cout << i->first;
    }
    for (auto i = s.begin(); i != s.end(); i = next(i)) {
      if (i->second == 1) cout << i->first;
    }
    for (auto i = s.begin(); i != s.end(); i = next(i)) {
      if (i->second == 2) cout << i->first;
    }
    cout << '\n';
  }
}
int main() { solve(); }
