#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
void solve() {
  string s;
  vector<pair<int, string>> p;
  p.push_back(make_pair(0, "A"));
  p.push_back(make_pair(0, "B"));
  p.push_back(make_pair(0, "C"));
  int i = 3;
  while (i--) {
    cin >> s;
    if (s[1] == '>') {
      if (s[0] == 'A')
        p[0].first++;
      else if (s[0] == 'B')
        p[1].first++;
      else
        p[2].first++;
    } else {
      if (s[2] == 'A')
        p[0].first++;
      else if (s[2] == 'B')
        p[1].first++;
      else
        p[2].first++;
    }
  }
  sort(p.begin(), p.end());
  if (p[0].first == p[1].first or p[1].first == p[2].first)
    cout << "Impossible";
  else
    for (int i = 0; i < 3; i++) cout << p[i].second;
}
int main() {
  ios_base::sync_with_stdio(NULL);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  solve();
}
