#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  map<char, int> m;
  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) {
    cout << "Impossible" << endl;
    return 0;
  }
  if (m['A'] == 0)
    cout << "A";
  else if (m['B'] == 0)
    cout << "B";
  else if (m['C'] == 0)
    cout << "C";
  if (m['A'] == 1)
    cout << "A";
  else if (m['B'] == 1)
    cout << "B";
  else if (m['C'] == 1)
    cout << "C";
  if (m['A'] == 2)
    cout << "A";
  else if (m['B'] == 2)
    cout << "B";
  else if (m['C'] == 2)
    cout << "C";
  return 0;
}
