import java.io.*;
public class mc{
public static void main(String args[]){
Solute s = new Solute(3, 2);
System.out.println("no solution");
}
}
class Solute{
int n, k, sign=0;
static int count = 0;
int res[][];
public Solute(int x, int y){
n = x;
k = y;
res = new int[4*n][2];
solute(n, n, 1);
}
void solute(int m, int c, int s){
if(count<4*n){
res[count][0] = m;
res[count][1] = c;
if(count>1){
if(res[count-2][0]==res[count][0]&&res[count-2][1]==res[count][1])
return;
}
count++;
if(m==0&&c==0){
print();
System.exit(0);
}
if(s==0){
if(m+1<=n&&(m+1-c)*c*(n-m-1)==0)
solute(m+1, c, 1);
if(c+1<=n&&(c+1-m)*m*(n-m)==0)
solute(m, c+1, 1);
if(c+1<=n&&m+1<=n&&m>=c)
solute(m+1, c+1, 1);
}else{
if(m+c<=k)
solute(0, 0, 0);
for(int i=k;i>0;i--){
for(int j=0;j<i+1;j++){
if(m>=j&&c>=i-j&&((m-j)==(c-i+j)||m-j==0||m-j==n))
solute(m-j, c-i+j, 0);
}
}
}
count--;
}
}
void print(){
sign = 1;
for(int i=0;i<count;i++){
System.out.println("("+res[i][0]+","+res[i][1]+","+sign+")");
sign = 1 - sign;
}
}
}