#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 5;
const long long inf = 1e9 + 77;
const int MOD = 1e8 + 7;
const double eps = 1e-7;
int main() {
  string s1, s2, s3;
  cin >> s1 >> s2 >> s3;
  int A = 0, B = 0, C = 0;
  if (s1[1] == '>') {
    switch (s1[0]) {
      case 'A':
        A += 1;
        break;
      case 'B':
        B += 1;
        break;
      case 'C':
        C += 1;
        break;
    }
  } else {
    switch (s1[2]) {
      case 'A':
        A += 1;
        break;
      case 'B':
        B += 1;
        break;
      case 'C':
        C += 1;
        break;
    }
  }
  if (s2[1] == '>') {
    switch (s2[0]) {
      case 'A':
        A += 1;
        break;
      case 'B':
        B += 1;
        break;
      case 'C':
        C += 1;
        break;
    }
  } else {
    switch (s2[2]) {
      case 'A':
        A += 1;
        break;
      case 'B':
        B += 1;
        break;
      case 'C':
        C += 1;
        break;
    }
  }
  if (s3[1] == '>') {
    switch (s3[0]) {
      case 'A':
        A += 1;
        break;
      case 'B':
        B += 1;
        break;
      case 'C':
        C += 1;
        break;
    }
  } else {
    switch (s3[2]) {
      case 'A':
        A += 1;
        break;
      case 'B':
        B += 1;
        break;
      case 'C':
        C += 1;
        break;
    }
  }
  if (A == B || B == C || A == C) {
    cout << "Impossible";
    return 0;
  }
  if (A > B && A > C) {
    if (B > C) {
      cout << "CBA";
    } else
      cout << "BCA";
  } else if (B > A && B > C) {
    if (A > C)
      cout << "CAB";
    else
      cout << "ACB";
  } else {
    if (A > B)
      cout << "BAC";
    else
      cout << "ABC";
  }
  return 0;
}
