n,d,k=[int(x) for x in raw_input().split()]

p=1
a=1
k1=k
l=1
while(k1>0 and l<=d/2):
   if(a>n):
       break
   p=p*k1
   a=a+p
   k1=k-1
   l=l+1

k1=k   
if(d%2):
     a=a+k-1
if(a<n or n-1<d):
    print("NO")

else:    
    l=[0 for i in range(0,1000000)]
    f=2
    i=0
    h=0
    g=d-2*h-1
    g1=d-2*h-1
    t=0;
    print("YES")
    l[t]=1
    l[t+1]=-1
    t=2
    q=0
    while f<=n :
        j=l[i]
        if(j==-1):
            l[t]=-1
            t=t+1
            k=k1-1
            i=i+1
            h=h+1
            q=0
            g=d-2*h
            g1=d-2*h
            continue
        c=0
        if(f+g-1==n):
            
            #print h,g,f
            while(f<=n):
                print j,f
                j=f
                f=f+1
        if(q==1):
            g=g1-1
        while(c<k and f<=n and f+g-1<n):
            q=1
            print j,f
            l[t]=f
            f=f+1
            c=c+1
            t=t+1
        if(c==k):    
           i=i+1  
