import bisect import copy import decimal import fractions import heapq import itertools import math import random import sys import time from collections import Counter,deque,defaultdict from functools import lru_cache,reduce from heapq import heappush,heappop,heapify,heappushpop,_heappop_max,_heapify_max def _heappush_max(heap,item): heap.append(item) heapq._siftdown_max(heap, 0, len(heap)-1) def _heappushpop_max(heap, item): if heap and item < heap[0]: item, heap[0] = heap[0], item heapq._siftup_max(heap, 0) return item from math import gcd as GCD read=sys.stdin.read readline=sys.stdin.readline readlines=sys.stdin.readlines write=sys.stdout.write A,B,C,D=map(int,readline().split()) if A==C and B==C: N=C ans_lst=[(i,i%N) for i in range(N)] elif A==C: ans_lst=[] ans_lst.append((0,1)) for i in range(2,B+1): ans_lst.append((1,i)) for i in range(B+1,A): ans_lst.append((0,i)) N=A elif B==C: ans_lst=[] ans_lst.append((1,0)) for i in range(2,A+1): ans_lst.append((0,i)) for i in range(A+1,B): ans_lst.append((1,i)) N=B else: ans_lst=[] if C: ans_lst.append((0,2)) ans_lst.append((1,2)) for i in range(2,C+1): ans_lst.append((i,i+1)) if A-C-1: ans_lst.append((0,C+2)) for i in range(C+2,C+2+(A-C-2)): ans_lst.append((i,i+1)) if B-C-1: ans_lst.append((1,A+1)) for i in range(A+1,A+1+(B-C-2)): ans_lst.append((i,i+1)) N=A+B-C M=len(ans_lst) if D