#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 1;
bool comp(pair<int, int> a, pair<int, int> b) { return a.second <= b.second; }
int main() {
  ios::sync_with_stdio(0), cin.tie(nullptr), cout.tie(nullptr);
  int c[3] = {};
  char q[3];
  string z[3];
  cin >> z[0] >> z[1] >> z[2];
  for (int i = 0; i < 3; ++i) {
    if (z[i][1] == '>') c[z[i][0] - 'A']++;
    if (z[i][1] == '<') c[z[i][2] - 'A']++;
  }
  if (c[0] == c[1]) {
    cout << "Impossible";
    return 0;
  }
  for (int i = 0; i < 3; i++) {
    q[c[i]] = 'A' + i;
  }
  cout << q[0] << q[1] << q[2];
  return 0;
}
