#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <bitset>
using namespace std;
 
#ifdef LOCAL
	#define eprintf(...) fprintf(stderr, __VA_ARGS__);fflush(stderr);
#else
	#define eprintf(...) 42
#endif
 
using ll = long long;
using ld = long double;
using uint = unsigned int;
using ull = unsigned long long;
template<typename T>
using pair2 = pair<T, T>;
using pii = pair<int, int>;
using pli = pair<ll, int>;
using pll = pair<ll, ll>;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll myRand(ll B) {
	return (ull)rng() % B;
}
 
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
 
clock_t startTime;
double getCurrentTime() {
	return (double)(clock() - startTime) / CLOCKS_PER_SEC;
}
 
int main()
{
	startTime = clock();
//	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);
 
	int n, m;
	scanf("%d%d", &n, &m);
	if (n == 1) {
		if (m != 0) {
			printf("-1\n");
		} else {
			printf("1 2\n");
		}
		return 0;
	}
	if (m < 0 || m > n - 2) {
		printf("-1\n");
		return 0;
	}
	printf("1 10000000\n");
	int x = 2;
	int k = n - m - 2;
	for (int i = 0; i < k + 1; i++)
		printf("%d %d\n", x + i, x + k + 1 + i);
	x += 2 * (k + 1);
	for (int i = 0; i < m; i++) {
		printf("%d %d\n", x, x + 1);
		x += 2;
	}
 
	return 0;
}

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define rep1(i,n) for(int i=1;i<=(int)n;i++)
#define sp(n) cout << fixed << setprecision(n)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
typedef long long ll;
using namespace std;
const ll mod = 998244353;
long long modpow(long long a, long long n){
  long long r = 1;
  while (n) {
    r = r * ( (n%2)?a:1 ) %mod;
    a = a * a % mod;
    n >>= 1;
  }
  return r;
}

int main(void){
    ll n,m,k;cin>>n>>m>>k;
    ll res=0;
    if(m==1){
        ll res=modpow(k,n);
        cout<<res<<endl;
        return 0;
    }
    else if(n==1){
        ll res=modpow(k,m);
        cout<<res<<endl;
        return 0;
    }
    rep(i,k){
        ll buf1=modpow(k-i,m),buf2=modpow(k-i-1,m);
        ll buf3=modpow(i+1,n);
        ll buf4=(((buf1-buf2+mod)%mod)*buf3)%mod;
        res+=buf4;
        res%=mod;
    }
    cout<<res<<endl;
}