#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline T sqr(T x) {
  return x * x;
}
template <typename T>
inline T abs(T x) {
  return x < 0 ? -x : x;
}
template <typename T>
inline T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
template <typename T>
inline bool chmin(T& x, const T& y) {
  if (x > y) {
    x = y;
    return 1;
  }
  return 0;
}
template <typename T>
inline bool chmax(T& x, const T& y) {
  if (x < y) {
    x = y;
    return 1;
  }
  return 0;
}
inline void read(int& n) {
  n = 0;
  bool neg = 0;
  register int c = getchar();
  while ((c < 48 || c > 57) && c != '-') c = getchar();
  if (c == '-') neg = 1, c = getchar();
  while (c > 47 && c < 58) n = (n << 3) + (n << 1) + (c ^ 48), c = getchar();
  if (neg) n = -n;
}
void solve() {
  string s1, s2, s3;
  cin >> s1;
  cin >> s2;
  cin >> s3;
  char a[3], b[3];
  if (s1[1] == '>') {
    a[0] = s1[0];
    b[0] = s1[2];
  } else if (s1[1] == '<') {
    a[0] = s1[2];
    b[0] = s1[0];
  }
  if (s2[1] == '>') {
    a[1] = s2[0];
    b[1] = s2[2];
  } else if (s2[1] == '<') {
    a[1] = s2[2];
    b[1] = s2[0];
  }
  if (s3[1] == '>') {
    a[2] = s3[0];
    b[2] = s3[2];
  } else if (s3[1] == '<') {
    a[2] = s3[2];
    b[2] = s3[0];
  }
  int i = 0, c1 = 0, c2 = 0, c3 = 0;
  while (i < 3) {
    if (a[i] == 'A')
      c1++;
    else if (a[i] == 'B')
      c2++;
    else
      c3++;
    i++;
  }
  if (c1 == 2 && c2 == 1 && c3 == 0)
    cout << "CBA";
  else if (c1 == 2 && c2 == 0 && c3 == 1)
    cout << "BCA";
  else if (c1 == 0 && c2 == 2 && c3 == 1)
    cout << "ACB";
  else if (c1 == 1 && c2 == 2 && c3 == 0)
    cout << "CAB";
  else if (c1 == 0 && c2 == 1 && c3 == 2)
    cout << "ABC";
  else if (c1 == 1 && c2 == 0 && c3 == 2)
    cout << "BAC";
  else
    cout << "Impossible";
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  solve();
}
