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

int main(){
	
	int n,m;
	cin>>n>>m;
	int r=0;
	int ai=1;
    int i=1;
    int p=m+1;
	int x;
	
	while(r<n){
		cout<<ai<<endl;;
		r++;
    }
    
    while(i<n && i<p){
    	cout<<i<<" "<<i+1<<endl;
    	i++;
	}
	
	x=1*(m*2);
	
	cout<<x<<endl;
    
	return 0;
}