#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string s;
  map<char, int> mi, ma;
  for (int i = 0; i < 3; i++) {
    cin >> s;
    if (s[1] == '>')
      mi[s[2]]++, ma[s[0]]++;
    else if (s[1] == '<')
      mi[s[0]]++, ma[s[2]]++;
  }
  char ans1, ans2, ans3;
  int a = INT_MIN, b = INT_MIN;
  for (auto x : mi)
    if (x.second > a) a = x.second, ans1 = x.first;
  for (auto x : ma)
    if (x.second > b) b = x.second, ans2 = x.first;
  if ((ans1 == 'A' && ans2 == 'B') || (ans1 == 'B' && ans2 == 'A')) ans3 = 'C';
  if ((ans1 == 'A' && ans2 == 'C') || (ans1 == 'C' && ans2 == 'A')) ans3 = 'B';
  if ((ans1 == 'C' && ans2 == 'B') || (ans1 == 'B' && ans2 == 'C')) ans3 = 'A';
  if (ans1 == ans2 || ans2 == ans3 || ans1 == ans3) {
    cout << "Impossible";
    return 0;
  }
  cout << ans1 << ans3 << ans2;
  return 0;
}
