

#include <stdio.h>
#include <math.h>
#define M M_PI/3
#define N 500001

typedef struct{
    double x,y;
}Point;
void print(Point p){
    printf("%.10f %.10f\n",p.x,p.y);
}
Point rota(Point p1,Point p2){
    double x=p2.x-p1.x;
    double y=p2.y-p1.y;
    Point p={x*cos(M)-y*sin(M)+p1.x,x*sin(M)+y*cos(M)+p1.y};
    return p;
}
void sen(int n,Point p1,Point p2){
    if(n==0) return;
    Point s={p1.x+(p2.x-p1.x)/3.0,p1.y+(p2.y-p1.y)/3.0};
    Point t={p1.x+(p2.x-p1.x)*2.0/3.0,p1.y+(p2.y-p1.y)*2.0/3.0};
    Point u = rota(s,t);
    sen(n-1,p1,s);
    print(s);
    sen(n-1,s,u);
    print(u);
    sen(n-1,u,t);
    print(t);
    sen(n-1,t,p2);
}
int main()
{
  int n;
  Point p1={0,0};
  Point p2={100,0};
  scanf("%d",&n);
  print(p1);
  if(n>0){
      sen(n,p1,p2);
  }
  print(p2);
  return 0;
}

