#include <bits/stdc++.h>
using namespace std;
int main() {
  int left[3] = {0}, right[3] = {0};
  string s;
  for (int i = 0; i < 3; i++) {
    cin >> s;
    if (s[1] == '>') {
      left[(s[0] - 'A')]++;
      right[(s[2] - 'A')]++;
    } else {
      left[(s[2] - 'A')]++;
      right[(s[0] - 'A')]++;
    }
  }
  if (count(left, left + 3, 0) == 1 && count(right, right + 3, 0) == 1) {
    switch (right[0]) {
      case 2:
        cout << 'A';
        if (right[1] == 1)
          cout << 'B' << 'C';
        else if (right[2] == 1)
          cout << 'C' << 'B';
        break;
      case 1:
        if (right[1] == 2)
          cout << 'B' << 'A' << 'C';
        else if (right[2] == 2)
          cout << 'C' << 'A' << 'B';
        break;
      case 0:
        if (right[1] == 2)
          cout << 'B' << 'C' << 'A';
        else if (right[2] == 2)
          cout << 'C' << 'B' << 'A';
    }
  } else {
    cout << "Impossible";
  }
  return 0;
}
