#include <stdio.h>
#include <math.h>
 
typedef struct{
  double x;
  double y;
}P;
 
void k( int num , P a , P b ){
  if( num == 0 ){
	return ; 
	}
 
  P c,d,e;
 
 
  c.x = ( 2.0 * a.x + 1.0 * b.x ) / 3.0;
  c.y = ( 2.0 * a.y + 1.0 * b.y ) / 3.0;
  d.x = ( 1.0 * a.x + 2.0 * b.x ) / 3.0;
  d.y = ( 1.0 * a.y + 2.0 * b.y ) / 3.0;
  e.x = ( d.x - c.x ) * cos( M_PI/3 ) - (d.y - c.y ) * sin( M_PI/3 ) + c.x;
  e.y = ( d.x - c.x ) * sin( M_PI/3 ) + (d.y - c.y ) * cos( M_PI/3 ) + c.y;
 
  k( num - 1 , a , c );
  printf("%.8f %.8f\n" , c.x , c.y );

  k( num - 1 , c , e );
  printf("%.8f %.8f\n" , e.x , e.y );

  k( num - 1 , e , d );
  printf("%.8f %.8f\n" , d.x , d.y );

  k( num - 1 , d , b );
}

int main ( void ){
 
  int n;
 
  scanf("%d" , &n );
 
  P a = {0.0, 0.0};
  P b = {100.0, 0.0};
 
  printf("%.8f %.8f\n" , a.x , a.y );
  koch( n , a , b );
  printf("%.8f %.8f\n" , b.x , b.y );
 
  return 0;
}