#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<<"("<> q; set checker; Iroha(int n=100){ q.reserve(n); limit = n; } void insert(int a,int b){ q.emplace_back(a,b); checker.insert(a); checker.insert(b); maxvertex=max(maxvertex,max(a,b)+1); } bool check(){ int k=2; for (int e : checker){ if (e<2) continue; if (e!=k) return false; k++; } return (k == maxvertex); } void print(){ if (limit < q.size()){ cout << -1 << endl; }else{ assert(check()); printf("%d %d\n",maxvertex,q.size()); for (auto e:q){ printf("%d %d\n",e.first,e.second); } } } }; void halt(){ cout << -1 << endl; exit(0); } void wait(int ms){ for (auto t=TIME;MILLISEC(TIME-t)> ai >> bi >> ci >> n; Iroha graph(n); if (ai == 1 && bi==1 && ci==1) halt(); assert(ci<=min(ai,bi)); if (ai==ci && bi==ci){ // cycle for (i=1;i...->0->...) k=1; for (i=0;i1){ k++; graph.insert(0,k); for (i=0;i...->1->...) cerr<< "!" << endl; k=1; if (ai-ci>1){ k=2; graph.insert(0,2); for (i=0;i1){ k++; graph.insert(1,k); for (i=0;i1){ k++; graph.insert(0,k); for (i=0;i