#include <bits/stdc++.h>
using namespace std;
string second;
int x, y, z;
int main() {
  cin >> second;
  if (second[1] == '>') {
    if (second[0] == 'A')
      x++;
    else if (second[0] == 'B')
      y++;
    else if (second[0] == 'C')
      z++;
  } else {
    if (second[2] == 'A')
      x++;
    else if (second[2] == 'B')
      y++;
    else if (second[2] == 'C')
      z++;
  }
  cin >> second;
  if (second[1] == '>') {
    if (second[0] == 'A')
      x++;
    else if (second[0] == 'B')
      y++;
    else if (second[0] == 'C')
      z++;
  } else {
    if (second[2] == 'A')
      x++;
    else if (second[2] == 'B')
      y++;
    else if (second[2] == 'C')
      z++;
  }
  cin >> second;
  if (second[1] == '>') {
    if (second[0] == 'A')
      x++;
    else if (second[0] == 'B')
      y++;
    else if (second[0] == 'C')
      z++;
  } else {
    if (second[2] == 'A')
      x++;
    else if (second[2] == 'B')
      y++;
    else if (second[2] == 'C')
      z++;
  }
  if (x == y || y == z || x == z)
    cout << "Impossible";
  else {
    int mi2, mi = min(min(x, y), z);
    if (mi == x)
      if (y > z)
        cout << 'A' << 'C' << 'B';
      else
        cout << 'A' << 'B' << 'C';
    else if (mi == y)
      if (x > z)
        cout << 'B' << 'C' << 'A';
      else
        cout << 'B' << 'A' << 'C';
    else if (y > x)
      cout << 'C' << 'A' << 'B';
    else
      cout << 'C' << 'B' << 'A';
  }
  return 0;
}
