#include using namespace std; #define REP(i,n) for(int i=0;i=0;i--) #define FOR(i,m,n) for(int i=m;i pii; typedef pair pll; typedef pair pdd; int vx[]={0,1,0,-1}; int vy[]={1,0,-1,0}; int dx[]={1,0,-1,1,-1,1,0,-1}; int dy[]={1,1,1,0,0,-1,-1,-1}; const ll mod=1e9+7; const int INF=INT_MAX/2; const int MAX=1e9; int main(){ char c[3]; int q; REP(i,3){ cin>>c[i]; if(c[i]=='?')q=i; } if(q==0){ if(c[1]