#include <iostream>

using namespace std;

int main() {
	int k,n,m;
	cin >> k >> n >> m;
	if (n==k && m==k && (k==2 || k==3)) {
		cout << -1 << endl;
		return 0;
	}
	if (m==k) {
		cout << n-1 << endl;
		for(int i=1;i<n;i++){
			cout << i << " " << i+1 << endl;
		}
	} else if (n==k) {
		cout << k * (k - 1) / 2 - (m - 1) << endl;
		for(int i=1;i<=k;i++){
			for(int j=i+1;j<=k;j++){
				if (i<m && j==i+1) {
					continue;
				}
				cout << i << " " << j << endl;
			}
		}
	} else {
		cout << -1 << endl;
	}
	
	return 0;
}