#include <bits/stdc++.h>
using namespace std;
const int dr[] = {-1, 1, 0, 0};
const int dc[] = {0, 0, -1, 1};
const int dx[] = {1, 1, 0, -1, -1, -1, 0, 1};
const int dy[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int kr[] = {1, 1, -1, -1, 2, 2, -2, -2};
const int kc[] = {2, -2, 2, -2, 1, -1, 1, -1};
template <class T1>
void deb(T1 e1) {
  cout << e1 << endl;
}
template <class T1, class T2>
void deb(T1 e1, T2 e2) {
  cout << e1 << " " << e2 << endl;
}
template <class T1, class T2, class T3>
void deb(T1 e1, T2 e2, T3 e3) {
  cout << e1 << " " << e2 << " " << e3 << endl;
}
const int res = 1e5 + 10;
int main() {
  string x, y, z, s;
  map<char, int> m;
  map<int, char> ans;
  for (int i = 0; i < 3; i++) {
    cin >> s;
    if (s[1] == '>') {
      m[s[0]]++;
    } else {
      m[s[2]]++;
    }
  }
  if (m['A'] == 1 and m['B'] == 1 and m['C'] == 1) {
    deb("Impossible\n");
    return 0;
  }
  ans[m['A']] = 'A', ans[m['B']] = 'B', ans[m['C']] = 'C';
  for (auto it : ans) {
    cout << it.second;
  }
  return 0;
}
