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

void getCurve(double l[2], double r[2], int i){
	if( i <= 0 ){ return; }
	double s[2], t[2], u[2];
	s[0] = l[0] + (r[0]-l[0])/3;
	s[1] = l[1] + (r[1]-l[1])/3;
	t[0] = l[0] + (r[0]-l[0])*2/3;
	t[1] = l[1] + (r[1]-l[1])*2/3;
	double dx = t[0]-s[0], dy = t[1]-s[1];
	u[0] = s[0] + dx * cos(M_PI/3) - dy * sin(M_PI/3);
	u[1] = s[1] + dx * sin(M_PI/3) + dy * cos(M_PI/3); 
	getCurve(l, s, i-1);
	printf("%.8lf %.8lf\n", s[0], s[1]);
	getCurve(s, u, i-1);
	printf("%.8lf %.8lf\n", u[0], u[1]);
	getCurve(u, t, i-1);
	printf("%.8lf %.8lf\n", t[0], t[1]);
	getCurve(t, r, i-1);
	return;
}

int main(){
	double l[2] = {0.0, 0.0}, r[2] = {100.0, 0.0};
	int n;
	scanf("%d", &n);
	printf("%.8lf %.8lf\n", l[0], l[1]);
	getCurve(l, r, n);
	printf("%.8lf %.8lf\n", r[0], r[1]);
	return 0;
}