#include <stdio.h>
#include <math.h>
struct s{
  double x;
  double y;
};
void kock(int n,struct s p1,struct s p2){
  struct s a,b,c;
  if (n>0){
    a.x=(2*p1.x+p2.x)/3;
    a.y=(2*p1.y+p2.y)/3;
    b.x=(p1.x+2*p2.x)/3;
    b.y=(p1.y+2*p2.y)/3;
    c.x=fabs((b.x-a.x)/2-(b.y-a.y)*sqrt(3)/2+a.x);
    c.y=fabs((b.x-a.x)*sqrt(3)/2+(b.y-a.y)/2+a.y);
    kock(n-1, p1, a);
    printf("%f %f\n",a.x,a.y);
    kock(n-1, a, c);
    printf("%f %f\n",c.x,c.y);
    kock(n-1, c, b);
    printf("%f %f\n",b.x,b.y);
    kock(n-1, b, p2);
  }
}
int main(){
  int n;
  struct s p1={0,0};
  struct s p2={100,0};
  scanf("%d",&n);
  printf("%f %f\n",p1.x,p1.y);
  kock(n, p1, p2);
  printf("%f %f\n",p2.x,p2.y);
  return 0;
}