#include <bits/stdc++.h>
using namespace std;
int main() {
  string s[3];
  for (int i = 0; i < 3; ++i) cin >> s[i];
  map<char, int> m;
  string t = "ABC";
  for (int i = 0; i < 3; ++i) {
    for (int j = 0; j < s[i].size(); ++j) {
      if (s[i][j] == '>')
        m[s[i][j - 1]]++;
      else if (s[i][j] == '<')
        m[s[i][j + 1]]++;
    }
  }
  string g = "";
  int cnt = 0;
  char ch = ' ', ch1 = ' ';
  for (auto i : m) {
    if (i.second == 2)
      ch = i.first;
    else
      ch1 = i.first;
    if (i.second == 1) cnt++;
  }
  if (cnt == 3) return puts("Impossible"), 0;
  g += ch1;
  g += ch;
  int f = g.find('A');
  if (f == -1) return cout << 'A' + g, 0;
  f = g.find('B');
  if (f == -1) return cout << 'B' + g, 0;
  f = g.find('C');
  if (f == -1) return cout << 'C' + g, 0;
}
