#include <bits/stdc++.h>
using namespace std;
string s[3];
int main() {
  for (int i = 0; i < 3; i++) cin >> s[i];
  vector<char> l, h;
  for (int i = 0; i < 3; i++) {
    if (s[i][0] == 'A') {
      if (s[i][1] == '<')
        h.push_back(s[i][2]);
      else
        l.push_back(s[i][2]);
    }
    if (s[i][2] == 'A') {
      if (s[i][1] == '<')
        l.push_back(s[i][0]);
      else
        h.push_back(s[i][0]);
    }
  }
  for (int i = 0; i < 3; i++)
    if (s[i].find("A") == -1) {
      if (h.size() == 2) {
        if (s[i][1] == '<')
          cout << "A" << s[i][0] << s[i][2];
        else
          cout << "A" << s[i][2] << s[i][0];
      } else if (l.size() == 2) {
        if (s[i][1] == '<')
          cout << s[i][0] << s[i][2] << "A";
        else
          cout << s[i][2] << s[i][0] << "A";
      } else {
        if (s[i][1] == '<') {
          if (s[i][0] == l[0])
            cout << l[0] << "A" << h[0];
          else
            cout << "Impossible";
        } else {
          if (s[i][0] == h[0])
            cout << l[0] << "A" << h[0];
          else
            cout << "Impossible";
        }
      }
    }
}
