#include <bits/stdc++.h>
using namespace std;
struct item {
  char c;
  int num = 0;
};
bool proceed(item a, item b) { return a.num < b.num; }
int main() {
  cin.tie(0);
  cin.sync_with_stdio(0);
  item a[3];
  map<char, int> mp;
  int total = 0;
  string arr[3];
  for (int i = 0; i < 3; ++i) cin >> arr[i];
  for (int i = 0; i < 3; ++i)
    if (arr[i][1] == '>')
      mp[arr[i][0]]++;
    else if (arr[i][1] == '<')
      mp[arr[i][2]]++;
  for (int i = 0; i < 3; ++i) {
    total += (mp['A' + i] == 1);
    a[i].c = 'A' + i;
    a[i].num = mp['A' + i];
  }
  sort(a, a + 3, proceed);
  if (total == 3)
    puts("Impossible");
  else
    for (int i = 0; i < 3; ++i) printf("%c", a[i].c);
}
