#include using namespace std; #define FOR(i,a,b) for (int i=(a);i<(b);i++) #define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--) #define REP(i,n) for (int i=0;i<(n);i++) #define RREP(i,n) for (int i=(n)-1;i>=0;i--) int check[11]; int num[4]; int c[11]; int main(){ REP(i,10){ int x,y; cout<<(i)%10<<" "<<(i+1)%10<<" "<<(i+2)%10<<" "<<(i+3)%10<>x>>y; if(x==4&&y==0)return 0; check[(i)%10]=x+y; } int count=0; REP(i,10){ REP(j,10){ REP(k,10){ REP(l,10){ if(i==j||i==k||j==k||i==l||j==l||k==l)continue; REP(s,10)c[s]=0; c[i]++;c[j]++;c[k]++;c[l]++; bool cc=true;; REP(s,10){ if(check[s]!=c[s%10]+c[(s+1)%10]+c[(s+2)%10]+c[(s+3)%10]){ cc=false; } } if(cc){ num[0]=i; num[1]=j; num[2]=k; num[3]=l; } } } } } //ć…šćˆ—æŒ™ REP(i,4){ REP(j,4){ if(i==j)continue; REP(k,4){ if(i==k||j==k)continue; REP(l,4){ if(i==l||j==l||k==l)continue; cout<>x>>y; if(x==4&&y==0)return 0; } } } } return(0); }