#include <bits/stdc++.h>
using namespace std;
vector<int> ar(3);
void foo(const string &s) {
  int f1 = 0;
  if (s[0] == 'A') f1 = 0;
  if (s[0] == 'B') f1 = 1;
  if (s[0] == 'C') f1 = 2;
  int f2 = 0;
  if (s[2] == 'A') f2 = 0;
  if (s[2] == 'B') f2 = 1;
  if (s[2] == 'C') f2 = 2;
  if (s[1] == '<') swap(f1, f2);
  ++ar[f1];
  --ar[f2];
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string s, s1, s2;
  cin >> s;
  cin >> s1;
  cin >> s2;
  foo(s);
  foo(s1);
  foo(s2);
  map<int, int> num;
  bool ans = 1;
  vector<int> ansv;
  for (int i = 0; i < 3; ++i) {
    int mn = (int)1e9, id = 0;
    for (int j = 0; j < 3; ++j) {
      if (mn > ar[j]) {
        mn = ar[j];
        id = j;
      }
    }
    ++num[mn];
    ar[id] = (int)1e9;
    ansv.push_back(id);
  }
  int f = 0;
  for (auto &i : num) {
    if (i.first == 2 || i.first == 0 || i.first == -2) {
      if (i.second == 1) ++f;
    }
  }
  if (f != 3) ans = 0;
  if (ans) {
    for (int i = 0; i < 3; ++i) {
      cout << (char)toupper(char(ansv[i] + 'A'));
    }
  } else
    cout << "Impossible\n";
  if (false)
    cerr << "Time execute: " << (double)clock() / (double)CLOCKS_PER_SEC
         << " sec" << endl;
}
