#include<bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
using namespace std;
// typedef tree<pair<int,int>, null_type, less<pair<int,int>>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
#define ll long long 
#define scn(n) scanf("%d",&n)
#define lscn(n) scanf("%lld",&n)
#define lpri(n) printf("%lld",n)
#define pri(n) printf("%d",n)
#define pln() printf("\n")
#define priln(n) printf("%d\n",n)
#define lpriln(n) printf("%lld\n",n)
#define rep(i,init,n) for(int i=init;i<n;i++)
#define pb push_back     
#define mp make_pair
#define F first
#define S second
#define gcd __gcd
#define inf INT_MAX
#define ninf INT_MIN   
#define inf INT_MAX
#define linf LLONG_MAX
#define lninf LLONG_MIN   
const ll mod = 1e9 + 7;
const int N = 1e6 + 4;

int solve()
{	
	int n, k; scn(n); scn(k);

	if(k == 0)
	{
		int temp = 1;

		while(n--)
		{
			printf("%d %d\n", temp + 1, temp + 2);

			temp += 2;
		}

		return 0;
	}

	if(k < 0 or k >= n - 1)
	{
		pri(-1); return 0;
	}

	k++;

	int l = 1, r = (int)1e8;

	printf("%d %d\n", l, r);

	n--;	

	while(k--)
	{
		n--;

		printf("%d %d\n", l + 1, l + 2); l += 2;
	}

	while(n > 0)
	{
		n--;

		printf("%d %d\n", r + 1, r + 2); r += 2;
	}

	return 0;
}

//be careful whether to take the input for testcases or not
int main()                  
{
	int t = 1; //scn(t);

	while(t--)
	{
		solve();
	}

    return 0;
}
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
 
//const ll MAX = 4e5;
//const int MOD = 3;
 
void fast_io() {
  cin.tie(NULL);
  ios_base::sync_with_stdio(false);
}
 
//int bf[MAX + 1], bg[MAX + 1];
 
char colorOnTop(char c0, char c1) {
  if (c0 == c1) return c0;
  if (c0 == 'W' && c1 == 'B') return 'R';
  if (c0 == 'W' && c1 == 'R') return 'B';
  if (c0 == 'B' && c1 == 'W') return 'R';
  if (c0 == 'B' && c1 == 'R') return 'W';
  if (c0 == 'R' && c1 == 'W') return 'B';
  if (c0 == 'R' && c1 == 'B') return 'W';
}
 
char getTopColor(int n, string s) {
  if (n == 1) return s[0];
 
  int k = 1;
  while (3 * k < n) k *= 3;
 
  string ns = "";
  for (int i = 0; i + k < n; i++) ns += colorOnTop(s[i], s[i + k]);
  return getTopColor(n - k, ns);
}
 
int main() {
  fast_io();
 
  int n;
  string s;
  cin >> n >> s;
  cout << getTopColor(n, s);
}