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

#define MAX 100000
#define ?? 3.141592

void calc(float vertex[][2], int deep, int min, int max);

int main() {
	int deep;
	int min, max;
	float vertex[MAX][2];
	int i;
	for (i = 0; i < MAX; i++) {
		vertex[i][0] = -1; //-1??§?????????
	}
	vertex[0][0] = 0;
	vertex[0][1] = 0;
	vertex[MAX - 1][0] = 100;
	vertex[MAX - 1][1] = 0;
	min = 0;
	max = MAX - 1;

	scanf("%d", &deep);

	calc(vertex, deep, min, max);
	
	for (i = 0; i < MAX; i++) {
		if (vertex[i][0] != -1) {
			printf("%lf %lf\n", vertex[i][0], vertex[i][1]);
		}
	}

	return 0;
}

void calc(float vertex[][2], int deep, int min, int max) {
	int s, t, u;
	if (deep <= 0) {
		return;
	}

	s = (max - min) / 3 + min;
	vertex[s][0] = (vertex[max][0] - vertex[min][0]) / 3.0;
	vertex[s][1] = (vertex[max][1] - vertex[min][1]) / 3.0;
	t = (max - min) * 2 / 3 + min;
	vertex[t][0] = (vertex[max][0] - vertex[min][0]) * 2.0 / 3.0;
	vertex[t][1] = (vertex[max][1] - vertex[min][1]) * 2.0 / 3.0;
	u = (max - min) / 2 + min;
	vertex[u][0] = vertex[s][0] + ((vertex[t][0] - vertex[s][0]) * cos(??/3) - (vertex[t][1] - vertex[s][1]) * sin(??/3));
	vertex[u][1] = vertex[s][1] + ((vertex[t][0] - vertex[s][0]) * sin(??/3) + (vertex[t][1] - vertex[s][1]) * cos(?? / 3));

	calc(vertex, deep - 1, min, s);
	calc(vertex, deep - 1, s, u);
	calc(vertex, deep - 1, u, t);
	calc(vertex, deep - 1, t, max);
}