#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string s;
  int g[3] = {0}, m[3] = {0};
  for (int i = 0; i < 3; i++) {
    cin >> s;
    if (s[1] == '>') {
      g[s[0] - 'A']++;
      m[s[2] - 'A']++;
    } else {
      g[s[2] - 'A']++;
      m[s[0] - 'A']++;
    }
  }
  int i, f1 = 0, j, f2 = 0;
  for (i = 0; i < 3; i++) {
    if (g[i] == 2) {
      f1 = 1;
      break;
    }
  }
  for (j = 0; j < 3; j++) {
    if (m[j] == 2) {
      f2 = 1;
      break;
    }
  }
  if (f1 && f2) {
    int k;
    for (k = 0; k < 3; k++) {
      if ((i != k) && (j != k)) break;
    }
    cout << (char)('A' + j) << (char)('A' + k) << (char)('A' + i);
  } else {
    cout << "Impossible";
  }
  return 0;
}
