#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, count = 0, sum = 0, temp1, temp2;
  int temp;
  string s, t, r;
  unordered_map<char, int> u;
  u['A'] = 5;
  u['B'] = 5;
  u['C'] = 5;
  map<int, char> u1;
  for (int i = 0; i < 3; ++i) {
    cin >> s;
    if (s[1] == '<') {
      u[s[0]]--;
    } else {
      u[s[2]]--;
    }
  }
  for (auto i : u) {
    u1[i.second] = i.first;
  }
  if (u1.size() < 3) {
    cout << "Impossible" << '\n';
  } else {
    for (auto i : u1) {
      cout << i.second;
    }
    cout << '\n';
  }
  return 0;
}
