#include <bits/stdc++.h>
using namespace std;
map<char, int> m;
bool comp(char a, char b) { return m[a] < m[b]; }
int main(int argc, char const *argv[]) {
  int n = 3;
  while (n--) {
    string s;
    cin >> s;
    if (s[1] == '<') {
      m[s[2]] += 1;
      m[s[0]] += 0;
    } else {
      m[s[0]] += 1;
      m[s[2]] += 0;
    }
  }
  if (m['A'] == m['B'] && m['B'] == m['C'])
    cout << "Impossible"
         << "\n";
  else {
    vector<char> v;
    for (auto it = m.begin(); it != m.end(); it++) {
      v.push_back(it->first);
    }
    sort(v.begin(), v.end(), comp);
    for (auto a : v) cout << a;
    cout << "\n";
  }
  return 0;
}
