#include<bits/stdc++.h>

using namespace std;

int aa[5],b[5];


int main(){

int a,n,ost;

cin>>n>>a;

if(n/3>=a){

    aa[0]=aa[1]=aa[2]=a;
    ost=n-3*a;

    while(ost>0)
    {
        for(int i=0;i<3;i++)
           {    if(b[i]+2<=aa[i]) b[i]++;
                 else aa[i]++;

                 ost--;
                 if(ost==0)break;

            }
    }


for(int i=0;i<3;i++)
    cout<<aa[i]<<" "<<b[i]<<endl;
}





}