#include <bits/stdc++.h>
using namespace std;
const long long N = 3e5 + 7;
const long long inf = 1e9;
const long long mod = 1e9 + 7;
int can;
string s;
int used[4];
vector<int> res;
vector<int> g[5];
void dfs(int v, int p) {
  used[v] = 2;
  for (auto x : g[v]) {
    if (x == p) {
      continue;
    }
    if (used[x] == 0) {
      dfs(x, v);
    }
    if (used[x] == 2) {
      can = 1;
    }
  }
  used[v] = 1;
  res.push_back(v);
}
int main() {
  ios_base::sync_with_stdio(0);
  for (int i = 1; i <= 3; i++) {
    cin >> s;
    if (s[1] == '<') {
      swap(s[0], s[2]);
    }
    g[s[0] - 'A'].push_back(s[2] - 'A');
  }
  for (int i = 'A'; i <= 'C'; i++) {
    if (!used[i - 'A']) {
      dfs(i - 'A', -1);
    }
  }
  if (can == 1) {
    cout << "Impossible";
    return 0;
  }
  for (auto x : res) {
    cout << char(x + 'A');
  }
}
