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