#include<stdio.h>
#include<math.h>
typedef struct
{
  double x;
  double y;
} point;
void func(point,point,int);
void printPoint(point);
int main(void)
{
  int n;//input
  point p1,p2;
  p1.x=0.0;
  p1.y=0.0;
  p2.x=100.0;
  p2.y=0.0;
  scanf("%d",&n);
  printPoint(p1);
  func(p1,p2,n);
  return 0;
}
void func(point p1,point p2,int n)
{
  point p3,p4,p5;
  if(n==0) printPoint(p2);
  else
    {
      p3.x=p1.x+(p2.x-p1.x)/3.0;
      p3.y=p1.y+(p2.y-p1.y)/3.0;
      p5.x=p1.x+(p2.x-p1.x)*2.0/3.0;
      p5.y=p1.y+(p2.y-p1.y)*2.0/3.0;
      p4.x=p3.x+(p5.x-p3.x)*1.0/2.0-(p5.y-p3.y)*sqrt(3.0)/2.0;
      p4.y=p3.y+(p5.x-p3.x)*sqrt(3.0)/2.0+(p5.y-p3.y)*1.0/2.0;
      func(p1,p3,n-1);
      func(p3,p4,n-1);
      func(p4,p5,n-1);
      func(p5,p2,n-1);
    }
}
void printPoint(point p)
{
  printf("%f %f\n",p.x,p.y);
}

