#include using namespace std; // Optimization stuff inline void debugMode() { #ifndef ONLINE_JUDGE freopen("debug.in", "r", stdin); #endif // ONLINE_JUDGE } inline void optimizeIt() { ios::sync_with_stdio(false); cin.tie(NULL); } // End optimization stuff inline double ABS(const int &x) { return max(x, -x); } inline bool isPrime(const int &x) { if(x == 1) return false; for(int d = 2; d * d <= x; d++) { if(x % d == 0) return false; } return true; } typedef long long int ll; const int NMax = 2e5 + 5; const int LIM = 1e9; const int MOD = 1e9 + 7; int main(){ debugMode(); optimizeIt(); int k, m, n; cin >> k >> n >> m; if(m == k && n <= k && (n != m || k == 1 || k > 3)) { cout << n - 1; for(int i = 1; i <= n; i++) cout << i << " " << i + 1 << "\n"; } else { if(n == k && m <= k && (n != m || k == 1 || k > 3)) { cout << (k * (k - 1) / 2) - (m - 1) << "\n"; for(int i = 1; i <= k; i++) { for(int j = 1 + i + int(i < m); j <= k; j++) { cout << i << " " << j << "\n"; } } } else { cout << -1; } } return 0; }