#include <bits/stdc++.h>
using namespace std;
void printVec(vector<char>& v) {
for (char c : v) {
cout << c;
}
cout << endl;
}
int main() {
int t;
cin >> t;
for(int i=0;i<t;i++){
vector<char> v;
string s;
cin >> s;
for(int i=0;i<s.size();i++){
v.push_back(s[i]);
}
sort(v.begin(),v.end());
//printVec(v);
if(v.back() - v.front() == 2){
cout << "?";
}else if(v.front() == '<'){
cout << v[0];
}else if(v.back() == '>'){
cout << '>';
}else{
cout << "=";
}
cout << endl;
}
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7Cgp2b2lkIHByaW50VmVjKHZlY3RvcjxjaGFyPiYgdikgewogICAgZm9yIChjaGFyIGMgOiB2KSB7CiAgICAgICAgY291dCA8PCBjOyAKICAgIH0KICAgIGNvdXQgPDwgZW5kbDsgCn0KCmludCBtYWluKCkgewoJaW50IHQ7CgljaW4gPj4gdDsKCWZvcihpbnQgaT0wO2k8dDtpKyspewoJCXZlY3RvcjxjaGFyPiB2OwoJCXN0cmluZyBzOwoJCWNpbiA+PiBzOwoJCWZvcihpbnQgaT0wO2k8cy5zaXplKCk7aSsrKXsKCQkJdi5wdXNoX2JhY2soc1tpXSk7CgkJfQoJCXNvcnQodi5iZWdpbigpLHYuZW5kKCkpOwoJCS8vcHJpbnRWZWModik7CgkJaWYodi5iYWNrKCkgLSB2LmZyb250KCkgPT0gMil7CgkJCWNvdXQgPDwgIj8iOwoJCX1lbHNlIGlmKHYuZnJvbnQoKSA9PSAnPCcpewoJCQljb3V0IDw8IHZbMF07CgkJfWVsc2UgaWYodi5iYWNrKCkgPT0gJz4nKXsKCQkJY291dCA8PCAnPic7CgkJfWVsc2V7CgkJCWNvdXQgPDwgIj0iOwoJCX0KCQljb3V0IDw8IGVuZGw7Cgl9CgkKCXJldHVybiAwOwp9