#include <bits/stdc++.h>
using namespace std;
map<char, int> m;
string s;
int main() {
  for (int i = 0; i < 3; i++) {
    cin >> s;
    if (s[1] == '>')
      m[s[0]]++;
    else
      m[s[2]]++;
  }
  if (m['A'] == m['B'] && m['B'] == m['C'])
    cout << "Impossible";
  else {
    if (m['A'] < m['B'] && m['A'] < m['C']) {
      cout << "A";
      if (m['B'] < m['C'])
        cout << "BC";
      else
        cout << "CB";
    } else if (m['B'] < m['A'] && m['B'] < m['C']) {
      cout << "B";
      if (m['A'] < m['C'])
        cout << "AC";
      else
        cout << "CA";
    } else if (m['C'] < m['B'] && m['C'] < m['A']) {
      cout << "C";
      if (m['B'] < m['A'])
        cout << "BA";
      else
        cout << "AB";
    }
  }
  return 0;
}
