#include <bits/stdc++.h>
using namespace std;
void my_return(int code) { exit(code); }
int main() {
  ios_base::sync_with_stdio();
  cin.tie(0);
  int t = 3;
  vector<pair<int, char>> arr;
  arr.push_back({0, 'A'});
  arr.push_back({0, 'B'});
  arr.push_back({0, 'C'});
  while (t--) {
    string s;
    cin >> s;
    if (s[1] == '>') {
      arr[s[0] - 'A'].first++;
      arr[s[2] - 'A'].first--;
    } else {
      arr[s[2] - 'A'].first++;
      arr[s[0] - 'A'].first--;
    }
  }
  sort(arr.begin(), arr.end());
  for (int i = 0; i < 2; i++)
    if (arr[i].first == arr[i + 1].first) {
      cout << "Impossible"
           << "\n";
      my_return(0);
    }
  for (int i = 0; i < 3; i++) cout << arr[i].second;
  cout << "\n";
  my_return(0);
}
