#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\n",p1);
  kohho(p1,p2,n);
  printf("%f\n",p2);

  return 0;
}

void kohho(Point p1,Point p2,int n){
  Point s,t,u;
  int a,b,c,d;

  if(n==0) return;

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

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

  u.x=(t.x−s.x)×cos(60)−(t.y−s.y)×sin(60)+s.x;
  u.y=(t.x−s.x)×sin(60)+(t.y−s.y)×cos(60)+s.y;

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

}



  
  
  
  

