#include <bits/stdc++.h>
using namespace std;
bool ok = false, a[5][5];
int u[5];
string p, maxs;
int pol(char s) {
  if (s == 'A') return 1;
  if (s == 'B') return 2;
  if (s == 'C') return 3;
}
string pol2(int s) {
  if (s == 1) return "A";
  if (s == 2) return "B";
  if (s == 3) return "C";
}
void dfs(int v) {
  if (ok) return;
  u[v] = 1;
  for (int i = 1; i <= 3; i++)
    if (a[v][i] && u[i] == 0)
      dfs(i);
    else if (a[v][i] && u[i] == 1)
      ok = true;
  u[v] = 2;
  p = p + pol2(v);
}
int main() {
  string s;
  for (int i = 1; i <= 3; i++) {
    cin >> s;
    if (s[1] == '>')
      a[pol(s[0])][pol(s[2])] = 1;
    else
      a[pol(s[2])][pol(s[0])] = 1;
  }
  for (int i = 1; i <= 3; i++) {
    for (int j = 1; j <= 3; j++) u[j] = 0;
    p = "";
    dfs(i);
    if (p.size() > maxs.size()) maxs = p;
  }
  if (ok)
    cout << "Impossible";
  else
    cout << maxs;
  return 0;
}
