#include <bits/stdc++.h>
using namespace std;
int id[5];
vector<int> edges[5];
int main() {
  ios::sync_with_stdio(false);
  unordered_map<char, int> hash{
      {'A', 1},
      {'B', 2},
      {'C', 3},
  };
  for (int i = 0; i < 3; ++i) {
    string str;
    cin >> str;
    int u = hash[str[0]], v = hash[str[2]];
    if (str[1] == '>')
      edges[u].push_back(v), id[v]++;
    else
      edges[v].push_back(u), id[u]++;
  }
  queue<int> q;
  for (int i = 1; i <= 3; ++i)
    if (id[i] == 0) q.push(i);
  vector<int> res;
  while (q.size() > 0) {
    int curr = q.front();
    res.push_back(curr);
    q.pop();
    for (auto el : edges[curr]) {
      id[el]--;
      if (id[el] == 0) q.push(el);
    }
  }
  if (res.size() == 3)
    for (int i = 2; i >= 0; --i) cout << char(res[i] - 1 + 'A');
  else
    cout << "Impossible";
  cout << endl;
  return 0;
}
