# include <iostream>
# include <cmath> 
using namespace std;
void dfs(int n,double x1,double y1,double x2,double y2)
{
	if(n == 0) return ;
	double x = sqrt(3)/2;
	double x3 = (2*x1+x2)/3,y3 = (2*y1+y2)/3;
	double x4 = (2*x2+x1)/3,y4 = (2*y2+y1)/3;
	double x5 = x3+(x4-x3)/2-(y4-y3)*x;
	double y5 = y3+(x4-x3)*x+(y4-y3)/2;
	dfs(n-1,x1,y1,x3,y3);
	printf("%.8f %.8f\n",x3,y3);
	dfs(n-1,x3,y3,x5,y5);
	printf("%.8f %.8f\n",x5,y5);
	dfs(n-1,x5,y5,x4,y4);
	printf("%.8f %.8f\n",x4,y4);
	dfs(n-1,x4,y4,x2,y2);
}
int main(void)
{
	int n;
	scanf("%d",&n);
	printf("0.00000000 0.00000000\n");
	dfs(n,0,0,100,0);
	printf("100.00000000 0.00000000\n");
	return 0;
}
