#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cout.tie(NULL);
  cin.tie(NULL);
  char x, y, z;
  int f[3] = {0};
  int r[3] = {0};
  for (int i = 1; i <= 3; i++) {
    cin >> x >> y >> z;
    if (y == '>') {
      f[x - 'A']++;
      r[x - 'A']++;
    } else {
      f[(z - 'A')]++;
      r[z - 'A']++;
    }
  }
  sort(r, r + 3);
  if (!(r[0] == 0 && r[1] == 1 && r[2] == 2)) {
    cout << "Impossible";
    return 0;
  }
  for (int i = 1; i <= 3; i++) {
    for (int j = 0; j < 3; j++) {
      if (f[j] == 0) {
        cout << (char)(65 + j);
        f[j] = -1;
      } else
        f[j]--;
    }
  }
}
