#include <bits/stdc++.h>
using namespace std;
long long power(long long a, long long n) {
  long long ans = 1;
  if (n == 0) return 1;
  if (n == 1) return a;
  if (n & 1) {
    return (a % 1000000007 * power(a, n - 1) % 1000000007) % 1000000007;
  } else
    return power((a * a) % 1000000007, n / 2) % 1000000007;
}
void towerofhanoi(int n, int a, int b, int c) {
  if (n > 0) {
    towerofhanoi(n - 1, a, c, b);
    cout << a << " " << c << "\n";
    towerofhanoi(n - 1, b, a, c);
  }
}
bool sortbysecond(const pair<int, int> &a, const pair<int, int> &b) {
  return (a.second < b.second);
}
long long seq(long long n) {
  if (n == 1) return 1;
  long long sum = 1;
  for (long long i = (n * (n + 1)) / 2; i > (n * (n + 1)) / 2 - n; i--) {
    sum *= i;
  }
  return sum + seq(n - 1);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  string s;
  map<char, int> m;
  m.insert({'A', 0});
  m.insert({'B', 0});
  m.insert({'C', 0});
  cin >> s;
  if (s[1] == '>')
    m[s[0]]++;
  else
    m[s[2]]++;
  cin >> s;
  if (s[1] == '>')
    m[s[0]]++;
  else
    m[s[2]]++;
  cin >> s;
  if (s[1] == '>')
    m[s[0]]++;
  else
    m[s[2]]++;
  if (m['A'] == 1 && m['B'] == 1 && m['C'] == 1) {
    cout << "Impossible";
    return 0;
  } else {
    if (m['A'] == 0)
      cout << 'A';
    else if (m['B'] == 0)
      cout << 'B';
    else if (m['C'] == 0)
      cout << 'C';
    if (m['A'] == 1)
      cout << 'A';
    else if (m['B'] == 1)
      cout << 'B';
    else if (m['C'] == 1)
      cout << 'C';
    if (m['A'] == 2)
      cout << 'A';
    else if (m['B'] == 2)
      cout << 'B';
    else if (m['C'] == 2)
      cout << 'C';
  }
  return 0;
}
