#include <bits/stdc++.h>
using namespace std;

int i, j, k, n, m;
vector<pair<int, int>> e;

int main() {
  ios_base::sync_with_stdio(0);

  cin >> k >> n >> m;

  if(n == k && m == 1) {
    for(i = 1; i <= n; ++i)
      for(j = i + 1; j <= n; ++j)
        e.push_back(make_pair(i, j));

    cout << e.size() << '\n';
    for(auto it : e) cout << it.first << ' ' << it.second << '\n';

    return 0;
  }

  if(n == 1 && m == k) return cout << "0\n", 0;

  cout << "-1\n";

  return 0;
}