#include <bits/stdc++.h>
using namespace std;
double pi = 3.1415926536;
const int oo = (int)1e9;
int dx[] = {0, 1, 0, -1};
int dy[] = {1, 0, -1, 0};
int di[] = {0, 0, 1, -1, 1, 1, -1, -1};
int dj[] = {1, -1, 0, 0, 1, -1, 1, -1};
int main() {
  ios_base::sync_with_stdio(false);
  map<char, int> rank;
  char first, sign, second;
  string ans = "***";
  for (int i = 0; i < 3; ++i) {
    cin >> first >> sign >> second;
    if (sign == '>') {
      rank[first] += 1;
    } else {
      rank[second] += 1;
    }
  }
  for (char i = 'A'; i <= 'C'; ++i) {
    int index = rank[i];
    if (rank[i] > 2 || ans[index] != '*') {
      cout << "Impossible";
      return 0;
    }
    ans[index] = i;
  }
  cout << ans;
}
