#include<stdio.h>
#include<math.h>
#define NOT 0
struct Point{
  double a;
  double b;
};

void Koch(int x, struct Point a, struct Point b){


  struct Point s, t, u;







  if(x == 0) return;

  double radian = M_PI * 60.0 / 180.0;

  s.a = (2.0 * a.a + 1.0 * b.a) / 3.0;
  s.b = (2.0 * a.b + 1.0 * b.b) / 3.0;
  t.a = (1.0 * a.a + 2.0 * b.a) / 3.0;
  t.b = (1.0 * a.b + 2.0 * b.b) / 3.0;
  u.a = (t.a - s.a) * cos(radian) - (t.b - s.b) * sin(radian) + s.a;
  u.b = (t.a - s.a) * sin(radian) + (t.b - s.b) * cos(radian) + s.b;

  Koch(x - 1, a, s);

  printf("%.8f %.8f\n",s.a,s.b);


  Koch(x - 1, s, u);
  printf("%.8f %.8f\n",u.a,u.b);
  Koch(x - 1, u, t);
  printf("%.8f %.8f\n",t.a,t.b);
  Koch(x - 1, t, b);
}


int main(){
  int n;
  struct Point s, t;

  scanf("%d",&n);

  s.a = 0;
  s.b = 0;
  t.a = 100;
  t.b = 0;

  printf("%.8f %.8f\n",s.a,s.b);



  Koch(n, s, t);



  printf("%.8f %.8f\n",t.a,t.b);

  return NOT;
}

