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



typedef struct tyouten{
   struct tyouten *next;
   double x;
   double y;
}tyouten;

typedef struct{
  double x;
  double y;
}bek;

tyouten *mk_tyouten(double x,double y){
  tyouten *p;
  p=malloc(sizeof(tyouten));
  p->x=x;
  p->y=y;
  p->next=NULL;
  return p;
}



double zettaiti(tyouten *p,tyouten *q){
  return pow(pow(p->x - q->x,2) +pow(p->y - q->y,2) ,0.5);
}


bek *mk_bek(tyouten *p,tyouten *q){
  double a;
  a=zettaiti(p,q);
  bek *P;
  P=malloc(sizeof(bek));
  P->x=(q->x -p->x)/a;
  P->y=(q->y - p->y)/a;
  return P;
}




/*?????°????????????????????????????????¨??????????¬???????????????????????????????????????£????§???¢????????????
?¬????????????????????????????????????????????¬?????????????????????´??????NULL?????????*/
tyouten *mk_tri(tyouten *p){
  bek *pq;
  double kyori;
  tyouten *q;
  q=p->next;
  if(q==NULL) return q;
  kyori=zettaiti(p,q)/3;
  pq=mk_bek(p,q);
  p->next=mk_tyouten(p->x + kyori*(pq->x),p->y + kyori*(pq->y));/*?????¨???????????????*/
  p->next->next=mk_tyouten(p->next->x + ((pq->x)*0.5 - (pq->y)*pow(3,0.5)*0.5)*kyori,p->next->y + (pq->x*pow(3,0.5)*0.5 + 0.5*pq->y)*kyori);/*?????????????????????*/
  p->next->next->next=mk_tyouten(p->x + 2*kyori*(pq->x),p->y + 2*kyori*(pq->y));/*??????????????????*/
  p->next->next->next->next=q;
  return q;
}


int main(){
  tyouten *p1,*p2,*q;
  int n,i;
  p1=mk_tyouten(0.0,0.0);
  p2=mk_tyouten(100.0,0.0);
  p1->next=p2;
  scanf("%d",&n);
  for(i=1;i<=n;i++){
    q=p1;
    while(q!=NULL) q=mk_tri(q);
  }
  q=p1;
  while(q!=NULL){
    printf("%lf %lf\n",q->x,q->y);
    q=q->next;
  }
  return 0;
}