#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#define MAX 11111111


typedef struct point{
  double x;
  double y;
} node;

void az(int n, node c, node d){
  node a1,a2,a3;
  double r = M_PI / 3.0;

  if(n == 0){
    printf("%.8f %.8f\n",c.x,c.y);
    return;
  }

  a1.x = (2.0 * c.x + 1.0 * d.x) / 3.0;
  a1.y = (2.0 * c.y + 1.0 * d.y) / 3.0;
  a3.x = (1.0 * c.x + 2.0 * d.x) / 3.0;
  a3.y = (1.0 * c.y + 2.0 * d.y) / 3.0;
  a2.x = (a3.x - a1.x) * cos(r) - (a3.y - a1.y) * sin(r) + a1.x;
  a2.y = (a3.x - a1.x) * sin(r) + (a3.y - a1.y) * cos(r) + a1.y;

  az(n - 1, c, a1);
  az(n - 1, a1, a2);
  az(n - 1, a2, a3);
  az(n - 1, a3, d);
}



int main(){
  int n;
  node a,b;

  scanf("%d",&n);

  a.x = 0;
  a.y = 0;
  b.x = 100;
  b.y = 0;
  
  az(n,a,b);
  printf("%.8f %.8f\n",b.x,b.y);

  return 0;
}


