#include<bits/stdc++.h>
using namespace std;
#define int long long

void foo(int n, double p1[2], double p2[2]){
	if(!n) return ;
	double th = M_PI * 60.0 / 180.0;
	double s[2] = {(p1[0]*2+p2[0])/3.0,(p1[1]*2+p2[1])/3.0}, t[2] = {(p1[0]+p2[0]*2)/3.0,(p1[1]+p2[1]*2)/3.0};
	double u[2] = {(t[0]-s[0])*cos(th) - (t[1]-s[1])*sin(th)+s[0], (t[0]-s[0])*sin(th) + (t[1]-s[1])*cos(th)+s[1]};
	foo(n-1,p1, s);
	printf("%.8f %.8f\n", s[0], s[1]);
	foo(n-1,s,u);
	printf("%.8f %.8f\n", u[0], u[1]);
	foo(n-1,u,t);
	printf("%.8f %.8f\n", t[0], t[1]);
	foo(n-1,t,p2);
}

signed main(){
	int n;
	double p1[2]={}, p2[2] ={100,0};
	cin>>n;
	printf("%.8f %.8f\n", p1[0], p1[1]);
	foo(n,p1,p2);
	printf("%.8f %.8f\n", p2[0], p2[1]);
	return 0;
}

