//MARX DANIEL - HUNGARY

#include <fstream.h>
#include <math.h>

#define min(x,y) ((x)<(y)?(x):(y))
#define max(x,y) ((x)>(y)?(x):(y))
#define sgn(x) ((x)>0?1:((x)<0?-1:0))

int patch[]=
	{
	1,1,1,2,1,2,1,2,2,2,
	1,3,1,2,2,3
	};

int main()
	{
//	ofstream ofile("con",ios::out);
	ofstream ofile("objects.dat",ios::out);
	if (!ofile)
		{
		cout << "Can't open output file!\n";
		return -1;
		}
	int n,mode;
	cin >> mode >> n;
	int i;
	if (mode==1)
		{
		int d=1;
		i=0;
		while (d<=n)
			{
			ofile << "(" << d << "," << i/2+1 << ") ";
			i++;
			d<<=1;
			}
		}
	else
		{
		int d;
		int j;
		for (j=1;j<=n;j++)
			{
			d=1;
			int t=j;
			if (j<=16)
				{
				ofile << "(" << j << "," << patch[j-1] << ") ";
				continue;
				}
			for (i=2;i<=j>>2;i++)
				{
				if (!(t%i))
					{
					int c=0;
					while (!(t%i))
						{
						c++;
						t/=i;
						}
					d*=c+1;
					}
				}
			if (t!=1) d<<=1;
//			cout << j << " ";
			ofile << "(" << j << "," << (d+1)/2 << ") ";
			}
		}
	ofile << "\n";
    }
