#include using namespace std; typedef long long ll; #define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i)) #define each(itr,c) for(__typeof(c.begin()) itr=c.begin(); itr!=c.end(); ++itr) #define all(x) (x).begin(),(x).end() #define pb push_back #define fi first #define se second typedef pair pi; void solve(int A, int B, int C, int D) { vector e; if(C0) e.pb(pi(b,A-C+1)); } else if(C==A && C==B) { if(C==1) { printf("-1\n"); return; } rep(i,C) e.pb(pi(i,(i+1)%C)); } else { // C==A or C==B int R=1; if(C==B) { R=0; swap(A,B); } // C==A e.pb(pi(R,!R)); for(int i=2; i<=A; ++i) e.pb(pi(!R,i)); if(C==B) e.pb(pi(!R,R)); else { for(int i=A+1; i>A >>B >>C >>D; solve(A,B,C,D); return 0; }