#include <bits/stdc++.h>
using namespace std;
char a[3], b[3], c[3];
char ans[4];
int g[6];
int main() {
  string s, s1, s2;
  cin >> s >> s1 >> s2;
  bool bb = 0;
  g[s[0] - 'A']++;
  g[s1[0] - 'A']++;
  g[s2[0] - 'A']++;
  g[s[2] - 'A']++;
  g[s1[2] - 'A']++;
  g[s2[2] - 'A']++;
  if (s[1] == '>')
    g[4]++;
  else
    g[5]++;
  if (s1[1] == '>')
    g[4]++;
  else
    g[5]++;
  if (s2[1] == '>')
    g[4]++;
  else
    g[5]++;
  if (g[0] != 2 || g[1] != 2 || g[2] != 2 || g[4] + g[5] != 3) {
    cout << "Impossible";
    return 0;
  }
  if (s[0] == s[2]) {
    cout << "Impossible";
    return 0;
  }
  if (s1[0] == s1[2]) {
    cout << "Impossible";
    return 0;
  }
  if (s2[0] == s2[2]) {
    cout << "Impossible";
    return 0;
  }
  if (s[1] == '>') {
    a[1] = s[2];
    a[2] = s[0];
  } else {
    a[1] = s[0];
    a[2] = s[2];
  }
  if (s1[1] == '>') {
    b[1] = s1[2];
    b[2] = s1[0];
  } else {
    b[1] = s1[0];
    b[2] = s1[2];
  }
  if (s2[1] == '>') {
    c[1] = s2[2];
    c[2] = s2[0];
  } else {
    c[1] = s2[0];
    c[2] = s2[2];
  }
  if (a[2] == b[2]) {
    ans[3] = a[2];
    ans[2] = c[2];
    ans[1] = c[1];
    bb = 1;
  } else if (c[2] == b[2]) {
    ans[3] = c[2];
    ans[2] = a[2];
    ans[1] = a[1];
    bb = 1;
  } else if (a[2] == c[2]) {
    ans[3] = a[2];
    ans[2] = b[2];
    ans[1] = b[1];
    bb = 1;
  }
  if (bb)
    cout << ans[1] << ans[2] << ans[3];
  else
    cout << "Impossible";
}
