#include <bits/stdc++.h>
using namespace std;
int main() {
  char a[3][3];
  map<char, int> m;
  int c = 0;
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 3; j++) cin >> a[i][j];
    (a[i][1] == '>') ? m[a[i][0]]++ : m[a[i][2]]++;
  }
  if (m['A'] == m['B'] || m['B'] == m['C'] || m['C'] == m['A'])
    cout << "Impossible";
  else
    for (int i = 0; i < 3; i++)
      for (char j = 'A'; j <= 'C'; j++)
        if (m[j] == i) cout << j;
}
