#include <bits/stdc++.h>
using namespace std;
map<char, int> m;
map<int, char> ans;
char x, p, y;
int main() {
  for (int i = 0; i < 3; i++) {
    cin >> x >> p >> y;
    if (p == '>')
      m[y]++;
    else
      m[x]++;
  }
  for (int i = 0; i < 3; i++) ans[m['A' + i]] = 'A' + i;
  if (ans[0] && ans[1] && ans[2])
    cout << ans[2] << ans[1] << ans[0];
  else
    cout << "Impossible";
  return 0;
}
