#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 7;
int cnt[3];
int main() {
  ios::sync_with_stdio(false);
  for (int i = 0; i < 3; i++) {
    string s;
    cin >> s;
    if (s[1] == '>')
      cnt[s[0] - 'A']++;
    else
      cnt[s[2] - 'A']++;
  }
  for (int i = 0; i < 3; i++)
    for (int j = i + 1; j < 3; j++)
      if (cnt[j] == cnt[i]) {
        cout << "Impossible\n";
        return 0;
      }
  for (int i = 0; i < 3; i++)
    for (int j = 0; j < 3; j++)
      if (cnt[j] == i) cout << (char)(j + 'A');
  cout << "\n";
  return 0;
}
