#include <bits/stdc++.h>
using namespace std;
void fast() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
const int N = 1e5 + 5;
int arr[N];
int main() {
  fast();
  int t = 3;
  int a, b, c;
  a = b = c = 0;
  while (t--) {
    char arr[3];
    cin >> arr;
    if (arr[1] == '<') swap(arr[0], arr[2]);
    if (arr[0] == 'A')
      a++;
    else if (arr[0] == 'B')
      b++;
    else
      c++;
  }
  if (a == 1 and b == 1 and c == 1) {
    cout << "Impossible";
    return 0;
  }
  if (a < b and a < c) {
    if (b < c)
      cout << "ABC";
    else
      cout << "ACB";
  } else if (b < a and b < c) {
    if (c < a)
      cout << "BCA";
    else
      cout << "BAC";
  } else {
    if (b < a)
      cout << "CBA";
    else
      cout << "CAB";
  }
}
