#include <stdio.h>

#include <stdlib.h>

#include <math.h>
 
void def(int num, double x1, double y1, double x2, double y2);
 
int main()
{
  int num;

  double array1[2], array2[2];
 
  array1[0] = 0;

  array1[1] = 0;

  array2[0] = 100;

  array2[1] = 0;
 
  scanf("%d", &num);
 
  printf("%f %f\n", array1[0], array1[1]);
 
  def(num, array1[0], array1[1], array2[0], array2[1]);
 
  return 0;
}
 
  void def(int num, double x1, double y1, double x2, double y2)
{
  double arrs[2], arrt[2], arru[2];
  double arrr3 = sqrt(3.0);
 
  if (num == 0){

    printf("%f %f\n", x2, y2);

    return;
  }
 
  else {
    arrs[0] = x1 + (x2 - x1) / 3.0;
    arrs[1] = y1 + (y2 - y1) / 3.0;
    arrt[0] = x1 + 2*(x2 - x1) / 3.0; 
    arrt[1] = y1 + 2*(y2 - y1) / 3.0;
    arru[0] = arrs[0] + (-arrs[0] + arrr3 * arrs[1] + arrt[0] - arrr3 * arrt[1]) / 2.0; 
    arru[1] = arrs[1] + (-arrr3 * arrs[0] - arrs[1] + arrr3 * arrt[0] + arrt[1]) / 2.0; 
    def(num - 1, x1, y1, arrs[0], arrs[1]); 
    def(num - 1, arrs[0], arrs[1], arru[0], arru[1]); 
    def(num - 1, arru[0], arru[1], arrt[0], arrt[1]); 
   def(num - 1, arrt[0], arrt[1], x2, y2);
  }
}