#include <bits/stdc++.h>
using namespace std;
string fixStr(string s) {
  if (s[1] == '>') {
    return string(1, s[2]) + "<" + string(1, s[0]);
  }
  return s;
}
string getAns(string s1, string s2, string s3) {
  int arrLetterOnLeftCount[300];
  arrLetterOnLeftCount['A'] = 0;
  arrLetterOnLeftCount['B'] = 0;
  arrLetterOnLeftCount['C'] = 0;
  arrLetterOnLeftCount[s1[0]]++;
  arrLetterOnLeftCount[s2[0]]++;
  arrLetterOnLeftCount[s3[0]]++;
  int countA, countB, countC;
  countA = arrLetterOnLeftCount['A'];
  countB = arrLetterOnLeftCount['B'];
  countC = arrLetterOnLeftCount['C'];
  if (countA != 2 && countB != 2 && countC != 2) return "Impossible";
  if (countA == 2) {
    if (countB == 1) {
      return "ABC";
    } else {
      return "ACB";
    }
  } else if (countB == 2) {
    if (countA == 1) {
      return "BAC";
    } else {
      return "BCA";
    }
  }
  if (countA == 1) {
    return "CAB";
  }
  return "CBA";
}
int main() {
  string s1, s2, s3;
  cin >> s1 >> s2 >> s3;
  cout << getAns(fixStr(s1), fixStr(s2), fixStr(s3)) << endl;
}
