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

typedef long long ll;
typedef pair<int,int> P;

#define p_ary(ary,a,b) do { cout << "["; for (int count = (a);count < (b);++count) cout << ary[count] << ((b)-1 == count ? "" : ", "); cout << "]\n"; } while(0)
#define p_map(map,it) do {cout << "{";for (auto (it) = map.begin();;++(it)) {if ((it) == map.end()) {cout << "}\n";break;}else cout << "" << (it)->first << "=>" << (it)->second << ", ";}}while(0)

template<typename T1,typename T2>ostream& operator<<(ostream& os,const pair<T1,T2>& a) {os << "(" << a.first << ", " << a.second << ")";return os;}

const char newl = '\n';

int main() {
    int n,m;
    cin >> n >> m;
    int l = n-1,r = 0;
    vector<P> ans;
    vector<bool> a(n+1,false);
    for (int i = 0;i < n/2;++i) {
        ans.push_back(make_pair(l,r));
        a[l-r] = a[n-(l-r)] = true;
        l--;r++;
        if (a[l-r] || a[n-(l-r)] || l-r == n-l+r) {
            l--;
            while (l > r) {
                ans.push_back(make_pair(l,r));
                l--;r++;
            }
            break;
        }
    }
    for (int i = 0;i < m;++i) cout << ans[i].first+1 << " " << ans[i].second+1 << newl;
}
#include <iostream>
#include <vector>
using namespace std;
int main(){
	int A, B;
	cin >> A >> B;
	vector<vector<char>> c(100, vector<char>(100));
	for (int i = 0; i < 50; i++){
		for (int j = 0; j < 100; j++){
			c[i][j] = '#';
		}
	}
	for (int i = 50; i < 100; i++){
		for (int j = 0; j < 100; j++){
			c[i][j] = '.';
		}
	}
	for (int i = 0; i < A - 1; i++){
		c[i / 50 * 2][i % 50 * 2] = '.';
	}
	for (int i = 0; i < B - 1; i++){
		c[99 - i / 50 * 2][i % 50 * 2] = '#';
	}
	cout << "100 100" << endl;
	for (int i = 0; i < 100; i++){
		for (int j = 0; j < 100; j++){
			cout << c[i][j];
		}
		cout << endl;
	}
}