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

struct Point{
  double x, y;
};

void Shuto(struct Point, struct Point, int);

int main(){

  struct Point p1, p2;
  int n;

  p1.x = 0;
  p1.y = 0;
  p2.x = 100;
  p2.y = 0;

  scanf("%d",&n);
  if(n > 6)exit(1);

  printf("%.8f %.8f\n",p1.x, p1.y);
  Shuto(p1,p2,n);
  printf("%.8f %.8f\n",p2.x, p2.y);

  return 0;
}

void Shuto(struct Point p1, struct Point p2, int n){

  if(n == 0) return;

  struct Point a, b, c;
  double rad=M_PI/3;

  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 = (b.x - a.x) * cos(rad) - (b.y - a.y) * sin(rad) + a.x;
  c.y = (b.x - a.x) * sin(rad) + (b.y - a.y) * cos(rad) + a.y;

  Shuto(p1,a,n-1);
  printf("%.8f %.8f\n", a.x, a.y);
  Shuto(a,c,n-1);
  printf("%.8f %.8f\n", c.x, c.y);
  Shuto(c,b,n-1);
  printf("%.8f %.8f\n", b.x, b.y);
  Shuto(b,p2,n-1);
}

