#include <bits/stdc++.h>
using namespace std;
template <class T>
T gcd(T x, T y) {
  while (T t = x % y) x = y, y = t;
  return y;
}
const double eps = 1e-10;
const double PI = acos(-1.);
const int INF = 1000000000;
const int MOD = 1000000007;
const double E = 2.7182818284590452353602874713527;
bool isdig(char x) { return x >= '0' && x <= '9'; }
bool isup(char x) { return x >= 'A' && x <= 'Z'; }
bool islow(char x) { return x >= 'a' && x <= 'z'; }
bool islet(char x) { return isup(x) || islow(x); }
int in[10005];
bool eg[30][30];
bool app[26];
int N;
void get_data() {
  memset(app, 0, sizeof(app));
  ;
  memset(in, 0, sizeof(in));
  ;
  string a;
  while (cin >> a) {
    if (((int)(a).size()) == 1) break;
    int i, j;
    i = a[0] - 'A';
    j = a[2] - 'A';
    app[i]++;
    app[j]++;
    if (a[1] == '>')
      eg[j][i] = 1, in[i]++;
    else
      eg[i][j] = 1, in[j]++;
  }
  N = 0;
  for (int i = 0; i < 26; i++) N += app[i];
}
vector<char> res;
bool mk[30];
void bfs(int u) {
  int v;
  mk[u] = 1;
  res.push_back(char(u + 'A'));
  for (int i = 0; i < 26; i++) {
    if (!eg[u][i]) continue;
    v = i;
    in[v]--;
    if (!in[v]) bfs(v);
  }
}
void run() {
  memset(mk, 0, sizeof(mk));
  ;
  res.clear();
  for (int i = 0; i < 26; i++) {
    if (mk[i]) continue;
    if (!app[i]) continue;
    if (in[i]) continue;
    bfs(i);
  }
  if (((int)(res).size()) < N) {
    cout << "Impossible" << endl;
    return;
  }
  for (int i = 0; i < ((int)(res).size()); i++) cout << res[i];
  cout << endl;
}
int main(int argc, char *argv[]) {
  {
    get_data();
    run();
  }
  return EXIT_SUCCESS;
}
