#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  map<char, int> m;
  for (char ch = 'A'; ch <= 'C'; ++ch) m.insert(pair<char, int>(ch, 0));
  for (int i = 0; i < 3; ++i) {
    cin >> s;
    if (s[1] == '>')
      m[s[0]]++;
    else
      m[s[2]]++;
  }
  if (m['A'] == 1 && m['B'] == 1 && m['C'] == 1)
    printf("Impossible\n");
  else {
    for (int i = 0; i < 3; ++i) {
      if (m['A'] == i)
        printf("A");
      else if (m['B'] == i)
        printf("B");
      else if (m['C'] == i)
        printf("C");
    }
  }
  return 0;
}
