#include <bits/stdc++.h>
using namespace std;
vector<int> Merge(vector<int> a, vector<int> b) {
  int n = a.size(), m = b.size();
  int i = 0, j = 0;
  vector<int> d;
  while (i < n || j < m) {
    while (i < n && (j == m || a[i] <= b[j])) {
      d.push_back(a[i++]);
    }
    while (j < m && (i == n || a[i] > b[j])) {
      d.push_back(b[j++]);
    }
  }
  return d;
}
void MergeSort(vector<int> &A) {
  if (A.size() == 1) return;
  int h = A.size() / 2;
  vector<int> m, k;
  for (int i = 0; i < h; i++) m.push_back(A[i]);
  for (int i = h; i < A.size(); i++) k.push_back(A[i]);
  MergeSort(m);
  MergeSort(k);
  A = Merge(m, k);
}
int partition(vector<int> &A, vector<int> &B, int l, int r) {
  int x = A[l];
  int j = l;
  for (int i = l + 1; i < r; i++) {
    if (A[i] <= x) {
      swap(A[i], A[++j]);
      swap(B[i], B[j]);
    }
  }
  swap(A[l], A[j]);
  swap(B[l], B[j]);
  return j;
}
void QuickSort(vector<int> &A, vector<int> &B, int l, int r) {
  if (l >= r) return;
  int m = partition(A, B, l, r);
  QuickSort(A, B, l, m - 1);
  QuickSort(A, B, m + 1, r);
}
bool log2(long long n) {
  while (n != 1) {
    if (n % 2 != 0) return 0;
    n /= 2;
  }
  return true;
}
int main() {
  string a, b, c;
  cin >> a >> b >> c;
  vector<int> x(3), y(3), z(3);
  if (a[1] == '>') {
    x[int(a[0]) - 65] = 2;
    x[int(a[2]) - 65] = 1;
  } else {
    x[int(a[2]) - 65] = 2;
    x[int(a[0]) - 65] = 1;
  }
  if (b[1] == '>') {
    y[int(b[0]) - 65] = 2;
    y[int(b[2]) - 65] = 1;
  } else {
    y[int(b[2]) - 65] = 2;
    y[int(b[0]) - 65] = 1;
  }
  if (c[1] == '>') {
    z[int(c[0]) - 65] = 2;
    z[int(c[2]) - 65] = 1;
  } else {
    z[int(c[2]) - 65] = 2;
    z[int(c[0]) - 65] = 1;
  }
  int A, B, C;
  A = x[0] + y[0] + z[0];
  B = x[1] + y[1] + z[1];
  C = x[2] + y[2] + z[2];
  if (A == B && A == C)
    cout << "Impossible" << endl;
  else {
    if (A > C && A > B)
      if (B > C)
        cout << "CBA" << endl;
      else
        cout << "BCA" << endl;
    else if (B > C && B > A)
      if (C > A)
        cout << "ACB" << endl;
      else
        cout << "CAB" << endl;
    else if (C > B && C > A)
      if (A > B)
        cout << "BAC" << endl;
      else
        cout << "ABC" << endl;
  }
  return 0;
}
