#include<iostream>
#include<algorithm>
#include<map>
using namespace std;
int main(){
	map<char, int> cup;
	cup['A'] = 1;
	cup['B'] = 0;
	cup['C'] = 0;
	char c1, c2, delim;
	while( cin >> c1 >> delim >> c2 ){
		swap(cup['c1'] , cup['c2']);
	}
	if(	cup['A'] == 1) cout << A << '?\n';
	if(	cup['B'] == 1) cout << B << '?\n';
	if(	cup['C'] == 1) cout << C << '?\n';
}