#include<stdio.h>
#include<stdlib.h>
#include<math.h>

typedef struct{
 double x;
 double y;
} Point;

void kohho(Point,Point,int);

int main(){
 int n;
 Point p1={0.0,0.0},p2={100.0,0.0};

 scanf("%d",&n);

 printf("%f %f\n",p1.x,p1.y);
 kohho(p1,p2,n);
 printf("%f %f\n",p2.x,p2.y);

 return 0;
}

void kohho(Point p1,Point p2,int n){
 Point s,t,u;

 if(n==0) return;

 s.x=(p2.x+(2*p1.x))/3;
 s.y=(p2.y+(2*p1.y))/3;  

 t.x=((2*p2.x)+p1.x)/3;
 t.y=((2*p2.y)+p1.y)/3;

 u.x=(t.x-s.x)/2-(t.y-s.y)*(sqrt(3)/2)+s.x;
 u.y=(t.x-s.x)*(sqrt(3)/2)+(t.y-s.y)/2+s.y;

 kohho(p1,s,n-1);
 printf("%f %f\n",s.x,s.y);
 kohho(s,u,n-1);
 printf("%f %f\n",u.x,u.y);
 kohho(u,t,n-1); 
 printf("%f %f\n",t.x,t.y);
 kohho(t,p2,n-1); 

}



  
  
  
  

