#include #define rep(i,n) for (int i=0; i<(n); ++i) using namespace std; using ll = long long; using P = pair; int main(){ int n; cin>>n; vectorok(12,true); vectora[12]; int d[7]={0,2,4,5,7,9,11}; rep(i,12)rep(j,7){ a[i].push_back((i+d[j])%12); } rep(i,n){ int t; cin>>t; rep(j,12){ bool exist=false; rep(k,7){ if(a[j][k]==t)exist=true; } if(!exist)ok[j]=false; } } int cnt=0; rep(i,12)if(ok[i])cnt++; if(cnt==1){ rep(i,12)if(ok[i])cout<