#include using namespace std; #define ALL(x) x.begin(),x.end() #define rep(i,n) for(int i=0;i<(n);i++) #define debug(v) cout<<#v<<":";for(auto x:v){cout<bool chmax(T &a,const T &b){if(abool chmin(T &a,const T &b){if(b ostream &operator<<(ostream &os,const pair&p){ os< ostream &operator<<(ostream &os,const vector&v){ for(int i=0;i<(int)v.size();i++) os<>n; int t[n]; rep(i,n) cin>>t[i]; auto check=[&](int d){ rep(i,n){ if(t[i]==d or t[i]==((d+2)%12) or t[i]==((d+4)%12) or t[i]==((d+5)%12) or t[i]==((d+7)%12) or t[i]==((d+9)%12) or t[i]==((d+11))%12) continue; return false; } return true; }; vector ans; for(int i=0;i<12;i++){ if(check(i)) ans.push_back(i); } if(ans.size()==1) cout<