import java.util.*;
import java.io.*;
import java.math.*;
public class main
{
	static BigInteger shit;
	static Set set;
	static boolean check(BigInteger x,BigInteger y,BigInteger z)
	{
		if (x.compareTo(shit)>=0)return false;
		if (y.compareTo(shit)>=0)return false;
		if (z.compareTo(shit)>=0)return false;
		if (x.compareTo(BigInteger.ZERO)<=0)return false;
		if (y.compareTo(BigInteger.ZERO)<=0)return false;
		if (z.compareTo(BigInteger.ZERO)<=0)return false;
		if (x.compareTo(y)==0)return false;
		if (x.compareTo(z)==0)return false;
		if (y.compareTo(z)==0)return false;
		if (set.contains(x))return false;
		if (set.contains(y))return false;
		if (set.contains(z))return false;
		set.add(x); set.add(y); set.add(z);
		return true;
	}
	public static void main(String[] args)
	{
		shit=BigInteger.valueOf(1);
		for(int i=1;i<=100;i++)shit=shit.multiply(BigInteger.valueOf(10));
		set=new HashSet();
		Scanner cin=new Scanner(System.in);
		int n;
		BigInteger k;
		k=cin.nextBigInteger();
		n=cin.nextInt();
		int ans[]=new int[1010]; int cnt=0;
		BigInteger a[]=new BigInteger[810000];	
		BigInteger b[]=new BigInteger[810000];
		BigInteger c[]=new BigInteger[810000];
		
		BigInteger ans1[]=new BigInteger[8100];	
		BigInteger ans2[]=new BigInteger[8100];
		BigInteger ans3[]=new BigInteger[8100];
		int q[]=new int[810000];
		a[1]=BigInteger.valueOf(0);
		b[1]=BigInteger.valueOf(1);
		c[1]=k;
		
		int head=0;
		int tail=1;
		q[1]=0;
		int fuck=0;
		while (head!=tail)
		{	
			head=(head%700000)+1;
			
			BigInteger t1=a[head];
			BigInteger t2=b[head];
			BigInteger t3=c[head];
			
			if(t1.compareTo(t2)>=0)
			{
				if(t1.compareTo(t3)>=0)fuck=1;
				else fuck=3;
			}
			else
			{
				if(t2.compareTo(t3)>=0)fuck=2;
				else fuck=3;
			}
			
			if (check(t1,t2,t3))
			{ 
				ans1[++cnt]=t1; ans2[cnt]=t2; ans3[cnt]=t3; 
				//System.out.println(ans1[cnt]+" "+ans2[cnt]+" "+ans3[cnt]);
			} 
			if (cnt==n)break;
			
			BigInteger p1=t2.multiply(k).add(k.multiply(t3)).subtract(t1);
			if(fuck!=1)
			{
				tail=(tail%700000)+1;
				a[tail]=p1; b[tail]=t2; c[tail]=t3; 
			}
			
			BigInteger p2=t1.multiply(k).add(k.multiply(t3)).subtract(t2);
			if(fuck!=2)
			{
				tail=(tail%700000)+1;
				a[tail]=t1; b[tail]=p2; c[tail]=t3; 
			}
			BigInteger p3=t1.multiply(k).add(k.multiply(t2)).subtract(t3);
			if(fuck!=3)
			{	
				tail=(tail%700000)+1;
				a[tail]=t1; b[tail]=t2; c[tail]=p3; 
			}
		}
		
		for(int i=1;i<=n;i++)System.out.println(ans1[i]+" "+ans2[i]+" "+ans3[i]);
	}
}
