#include<iostream>
#include<vector>
#include<cstring>
#include<cmath>

using namespace std;

typedef long long ll;

int rec[10]={0};
vector<int> v;
ll ans=0;
bool flag=0;
ll fac[19];

void display(int sum){
	cout<<"display:\n";
	for(int i=0;i<v.size();i++)
		cout<<rec[i]<<" ";
	cout<<"\n"<<sum<<"\n";
}

int n,d,k,count,parent[400005];

void make(int v, int rem){
	if(count<n && rem>0){
		for(int i=1;i<k && count<n;i++){
			parent[++count]=v;
			make(count,rem-1);
		}
	}
}
		

int main(){
	cin>>n>>d>>k;
	if(n==1){
		if(d!=0 || k!=0)
			return cout<<"NO",0;
		else
			return cout<<"YES\n1",0;
	}
	if(n==2){
		if(d!=1 || k!=1)
			return cout<<"NO",0;
		else
			return cout<<"YES\n1 2\n2 3",0;
	}
	if(k==1 || n<=d)
		return cout<<"NO",0;
	for(int i=2;i<=d+1;i++)
		parent[i]=i-1;
	count=d+1;
	for(int i=2;i<=d;i++){
		for(int j=1;j<k-1 && count<n;j++){
			parent[++count]=i;
			make(count,min(i-2,d-i));
		}
	}
	if(count>n)
		cout<<5/0;
	if(count<n){
		cout<<"NO";
	}
	else{
		cout<<"YES\n";
		for(int i=2;i<=n;i++)
			cout<<i<<" "<<parent[i]<<"\n";
	}
	return 0;
}
	