#include using namespace std; typedef unsigned int uint; typedef long long int ll; typedef unsigned long long int ull; #define debugv(v) printf("L%d %s => ",__LINE__,#v);for(auto e:v){cout< ",__LINE__,#m);for(int x=0;x<(w);x++){cout<<(m)[x]<<" ";}cout<>=1,k++)s=(s<<1)|(u&1);for(;0>=1)cout<<(s&1);}} #define TIME chrono::system_clock::now() #define MILLISEC(t) (chrono::duration_cast(t).count()) template ostream& operator <<(ostream &o,const pair p){o<<"("<> ai >> bi >> ci >> n; int abm = max(ai,bi); if (ai==ci && bi==ci){ // cycle if (n...->0->...) if (n1){ k++; printf("%d %d\n",0,k); for (i=0;i...->0->...) if (n1){ k=2; printf("%d %d\n",0,2); for (i=0;i1){ k++; printf("%d %d",1,k); for (i=0;i1){ k++; printf("%d %d\n",0,k); for (i=0;i