#include<stdio.h>
#include<stdlib.h>
#include<math.h>
double fura(int n,double leftx,double lefty,double rightx,double righty){
 
  if(n!=0){
  double s[3][2];
  s[0][0]=(2*leftx+rightx)/3;
  s[0][1]=(2*lefty+righty)/3;
  s[2][0]=(leftx+2*rightx)/3;
  s[2][1]=(lefty+2*righty)/3;
 
  s[1][0]=(s[2][0]-s[0][0])/2-(s[2][1]-s[0][1])*sqrt(3)/2+s[0][0];
  s[1][1]=(s[2][0]-s[0][0])*sqrt(3)/2+(s[2][1]-s[0][1])/2+s[0][1];
   
  fura(n-1,leftx,lefty,s[0][0],s[0][1]);
  printf("%lf %lf\n",s[0][0],s[0][1]);
  fura(n-1,s[0][0],s[0][1],s[1][0],s[1][1]);
  printf("%lf %lf\n",s[1][0],s[1][1]);
  fura(n-1,s[1][0],s[1][1],s[2][0],s[2][1]);
  printf("%lf %lf\n",s[2][0],s[2][1]);
  fura(n-1,s[2][0],s[2][1],rightx,righty);
  }
  if(n==0){
    //    printf("%lf %lf\n",rightx,righty);
    return 0;
  }
}
int main(void){
  int n;
  scanf("%d",&n);

  double p1x=0,p1y=0,p2x=100,p2y=0;
  printf("%lf %lf\n",p1x,p1y);
  fura(n,p1x,p1y,p2x,p2y);
  printf("%lf %lf\n",p2x,p2y);
  return 0;
}
