#include <stdio.h>
#include <math.h>

void dprint(double p[]){
    printf("%f %f\n",p[0],p[1]);
}

void cohho(int n,double p1[],double p5[]){
    if(n==0){return;}
    double p2[2],p3[2],p4[2];
    double th = M_PI/3;
    p2[0] = (p1[0]*2+p5[0])/3;
    p2[1] = (p1[1]*2+p5[1])/3;
    p4[0] = (p1[0]+p5[0]*2)/3;
    p4[1] = (p1[1]+p5[1]*2)/3;
    p3[0] = cos(th)*(p4[0]-p2[0])-sin(th)*(p4[1]-p2[1])+p2[0];
    p3[1] = sin(th)*(p4[0]-p2[0])+cos(th)*(p4[1]-p2[1])+p2[1];
    cohho(n-1,p1,p2);
    dprint(p2);
    cohho(n-1,p2,p3);
    dprint(p3);
    cohho(n-1,p3,p4);
    dprint(p4);
    cohho(n-1,p4,p5);
}

int main(void){
    int n;
    double p1[] = {0.0,0,0};
    double p2[] = {100.0,0,0};
    scanf("%d",&n);
    dprint(p1);
    cohho(n,p1,p2);
    dprint(p2);
    return 0;
}


