#include <bits/stdc++.h>
using namespace std;
void swap(string &mas, int firstIndex, int secondIndex) {
  char temp = mas[firstIndex];
  mas[firstIndex] = mas[secondIndex];
  mas[secondIndex] = temp;
}
int main() {
  vector<string> mas(3);
  string result = "ABC";
  for (int i = 0; i < 3; i++) {
    getline(cin, mas[i]);
  }
  for (int i = 0; i < 3; i++) {
    int firstIndex = result.find(mas[i][0]),
        secondIndex = result.find(mas[i][2]);
    if ((mas[i][1] == '>' && firstIndex < secondIndex) ||
        (mas[i][1] == '<' && firstIndex > secondIndex)) {
      swap(result, firstIndex, secondIndex);
    }
  }
  int firstIndex = result.find(mas[0][0]), secondIndex = result.find(mas[0][2]);
  if ((mas[0][1] == '>' && firstIndex < secondIndex) ||
      (mas[0][1] == '<' && firstIndex > secondIndex)) {
    swap(result, firstIndex, secondIndex);
  }
  bool itsTheTrap = false;
  for (int i = 0; i < 3; i++) {
    int firstIndex = result.find(mas[i][0]),
        secondIndex = result.find(mas[i][2]);
    if ((mas[i][1] == '>' && firstIndex < secondIndex) ||
        (mas[i][1] == '<' && firstIndex > secondIndex)) {
      itsTheTrap = true;
    }
  }
  if (itsTheTrap) {
    cout << "Impossible";
  } else {
    cout << result;
  }
  return 0;
}
