#include <stdio.h>
#include <math.h>
  
typedef struct k{
  double x;
  double y;
}k; 
 
int c(k, k, int);
 
int main()
{
 
  k p1,p2;
  int n;
  p1.x = 0.0;
  p1.y = 0.0;
  p2.x = 100.0;
  p2.y = 0.0;
 
  scanf("%d",&n); 
 
  printf("%f %f\n",p1.x,p1.y);
  c(p1,p2,n);
  printf("%f %f\n",p2.x,p2.y);
 
  return 0;
 
}
  
int c(k p1, k p2, int n)
{
 
  k a,b,d;
 
  if(n==0){
    return 0;
  }
  a.x=(p2.x-p1.x)/3.0+p1.x;
  a.y=(p2.y - p1.y)/3.0+p1.y;
  b.x=2.0*(p2.x-p1.x)/3.0+p1.x;
  b.y=2.0*(p2.y-p1.y)/3.0+p1.y;
  d.x=(1.0/2.0)*(a.x-a.x)-(sqrt(3.0)/2.0)*(b.y-a.y)+a.x;
  d.y=(sqrt(3.0)/2.0)*(b.x-a.x)+(1.0/2.0)*(b.y-a.y)+a.y;
   
  c(p1,a,n-1);
  printf("%f %f\n",a.x,a.y);
  c(a,d,n-1);
  printf("%f %f\n",d.x,d.y);
  c(b,b,n-1);
  printf("%f %f\n",b.x,b.y);
  c(d,p2,n-1);
}