#include <bits/stdc++.h>
using namespace std;
int main() {
  string s[3], ans = "   ";
  map<char, int> k;
  cin >> s[0] >> s[1] >> s[2];
  for (int i = 0; i < 3; i++) {
    if (s[i][1] == '<') {
      k[s[i][2]]++;
    } else {
      k[s[i][0]]++;
    }
  }
  if (k.size() != 2) {
    cout << "Impossible" << endl;
    return 0;
  }
  if (k['A'] == 0) {
    ans[0] = 'A';
  } else if (k['A'] == 1) {
    ans[1] = 'A';
  } else if (k['A'] == 2) {
    ans[2] = 'A';
  }
  if (k['B'] == 0) {
    ans[0] = 'B';
  } else if (k['B'] == 1) {
    ans[1] = 'B';
  } else if (k['B'] == 2) {
    ans[2] = 'B';
  }
  if (k['C'] == 0) {
    ans[0] = 'C';
  } else if (k['C'] == 1) {
    ans[1] = 'C';
  } else if (k['C'] == 2) {
    ans[2] = 'C';
  }
  cout << ans << endl;
  return 0;
}
