# coding: utf-8

import math

n = int(raw_input())

def vector_rot(vector, radian):
	new_x = vector[0] * math.cos(radian) - vector[1] * math.sin(radian)
	new_y = vector[0] * math.sin(radian) + vector[1] * math.cos(radian)
	return [new_x, new_y]

def vector_add(v1, v2):
	new_v = []
	for i in range(2):
		add = v1[i] + v2[i]
		new_v.append(add)
	return new_v

def makepoint(p_A1, p_A2):
	x_p_C1 = (p_A2[0] - p_A1[0]) / 3 + p_A1[0]
	y_p_C1 = (p_A2[1] - p_A1[1]) / 3 + p_A1[1]
	x_p_C3 = (p_A2[0] - p_A1[0]) * 2 / 3 + p_A1[0]
	y_p_C3 = (p_A2[1] - p_A1[1]) * 2 / 3 + p_A1[1]

	p_C1 = [x_p_C1, y_p_C1]
	p_C3 = [x_p_C3, y_p_C3]

	v01 = [x_p_C1 - p_A1[0], y_p_C1 - p_A1[1]]
	rot_v01 = vector_rot(v01, 60 * math.pi / 180)
	v02 = vector_add(v01, rot_v01)
	p_C2 = vector_add(p_A1, v02)	
	
	C = [p_C1, p_C2, p_C3]
	return C

A = [[0., 0.],[100., 0.]]
for i in range(n):
	B = []
	for j in range(len(A)-1): #A[j]??¨A[j+1]
		C = makepoint(A[j], A[j+1]) #C = [p_C1, p_C2, p_C3]
		B.append(A[j])
		for p in C:
			B.append(p)
		#A[j+1]????¬????makepoint?????????append??????
	B.append(A[-1]) #??????????????\?????\??????
	A = B

for x in A:
	print("{:.8f}".format(x[0])),
	print("{:.8f}".format(x[1])) import math math n = int(raw_input()) n int(raw_input()) int raw_input() raw_input def vector_rot(vector, radian):
	new_x = vector[0] * math.cos(radian) - vector[1] * math.sin(radian)
	new_y = vector[0] * math.sin(radian) + vector[1] * math.cos(radian)
	return [new_x, new_y] vector_rot new_x = vector[0] * math.cos(radian) - vector[1] * math.sin(radian) new_x vector[0] * math.cos(radian) - vector[1] * math.sin(radian) vector[0] * math.cos(radian) vector[0] vector 0 math.cos(radian) math.cos math cos radian vector[1] * math.sin(radian) vector[1] vector 1 math.sin(radian) math.sin math sin radian new_y = vector[0] * math.sin(radian) + vector[1] * math.cos(radian) new_y vector[0] * math.sin(radian) + vector[1] * math.cos(radian) vector[0] * math.sin(radian) vector[0] vector 0 math.sin(radian) math.sin math sin radian vector[1] * math.cos(radian) vector[1] vector 1 math.cos(radian) math.cos math cos radian return [new_x, new_y] [new_x, new_y] new_x new_y vector vector radian radian def vector_add(v1, v2):
	new_v = []
	for i in range(2):
		add = v1[i] + v2[i]
		new_v.append(add)
	return new_v vector_add new_v = [] new_v [] for i in range(2):
		add = v1[i] + v2[i]
		new_v.append(add)
	 i range(2) range 2 add = v1[i] + v2[i] add v1[i] + v2[i] v1[i] v1 i v2[i] v2 i new_v.append(add) new_v.append new_v append add return new_v new_v v1 v1 v2 v2 def makepoint(p_A1, p_A2):
	x_p_C1 = (p_A2[0] - p_A1[0]) / 3 + p_A1[0]
	y_p_C1 = (p_A2[1] - p_A1[1]) / 3 + p_A1[1]
	x_p_C3 = (p_A2[0] - p_A1[0]) * 2 / 3 + p_A1[0]
	y_p_C3 = (p_A2[1] - p_A1[1]) * 2 / 3 + p_A1[1]

	p_C1 = [x_p_C1, y_p_C1]
	p_C3 = [x_p_C3, y_p_C3]

	v01 = [x_p_C1 - p_A1[0], y_p_C1 - p_A1[1]]
	rot_v01 = vector_rot(v01, 60 * math.pi / 180)
	v02 = vector_add(v01, rot_v01)
	p_C2 = vector_add(p_A1, v02)	
	
	C = [p_C1, p_C2, p_C3]
	return C makepoint x_p_C1 = (p_A2[0] - p_A1[0]) / 3 + p_A1[0] x_p_C1 (p_A2[0] - p_A1[0]) / 3 + p_A1[0] (p_A2[0] - p_A1[0]) / 3 p_A2[0] - p_A1[0] p_A2[0] p_A2 0 p_A1[0] p_A1 0 3 p_A1[0] p_A1 0 y_p_C1 = (p_A2[1] - p_A1[1]) / 3 + p_A1[1] y_p_C1 (p_A2[1] - p_A1[1]) / 3 + p_A1[1] (p_A2[1] - p_A1[1]) / 3 p_A2[1] - p_A1[1] p_A2[1] p_A2 1 p_A1[1] p_A1 1 3 p_A1[1] p_A1 1 x_p_C3 = (p_A2[0] - p_A1[0]) * 2 / 3 + p_A1[0] x_p_C3 (p_A2[0] - p_A1[0]) * 2 / 3 + p_A1[0] (p_A2[0] - p_A1[0]) * 2 / 3 (p_A2[0] - p_A1[0]) * 2 p_A2[0] - p_A1[0] p_A2[0] p_A2 0 p_A1[0] p_A1 0 2 3 p_A1[0] p_A1 0 y_p_C3 = (p_A2[1] - p_A1[1]) * 2 / 3 + p_A1[1] y_p_C3 (p_A2[1] - p_A1[1]) * 2 / 3 + p_A1[1] (p_A2[1] - p_A1[1]) * 2 / 3 (p_A2[1] - p_A1[1]) * 2 p_A2[1] - p_A1[1] p_A2[1] p_A2 1 p_A1[1] p_A1 1 2 3 p_A1[1] p_A1 1 p_C1 = [x_p_C1, y_p_C1] p_C1 [x_p_C1, y_p_C1] x_p_C1 y_p_C1 p_C3 = [x_p_C3, y_p_C3] p_C3 [x_p_C3, y_p_C3] x_p_C3 y_p_C3 v01 = [x_p_C1 - p_A1[0], y_p_C1 - p_A1[1]] v01 [x_p_C1 - p_A1[0], y_p_C1 - p_A1[1]] x_p_C1 - p_A1[0] x_p_C1 p_A1[0] p_A1 0 y_p_C1 - p_A1[1] y_p_C1 p_A1[1] p_A1 1 rot_v01 = vector_rot(v01, 60 * math.pi / 180) rot_v01 vector_rot(v01, 60 * math.pi / 180) vector_rot v01 60 * math.pi / 180 60 * math.pi 60 math.pi math pi 180 v02 = vector_add(v01, rot_v01) v02 vector_add(v01, rot_v01) vector_add v01 rot_v01 p_C2 = vector_add(p_A1, v02) p_C2 vector_add(p_A1, v02) vector_add p_A1 v02 C = [p_C1, p_C2, p_C3] C [p_C1, p_C2, p_C3] p_C1 p_C2 p_C3 return C C p_A1 p_A1 p_A2 p_A2 A = [[0., 0.],[100., 0.]] A [[0., 0.],[100., 0.]] [0., 0.] 0. 0. [100., 0.] 100. 0. for i in range(n):
	B = []
	for j in range(len(A)-1): #A[j]??¨A[j+1]
		C = makepoint(A[j], A[j+1]) #C = [p_C1, p_C2, p_C3]
		B.append(A[j])
		for p in C:
			B.append(p)
		#A[j+1]????¬????makepoint?????????append??????
	B.append(A[-1]) #??????????????\?????\??????
	A = B i range(n) range n B = [] B [] for j in range(len(A)-1): #A[j]??¨A[j+1]
		C = makepoint(A[j], A[j+1]) #C = [p_C1, p_C2, p_C3]
		B.append(A[j])
		for p in C:
			B.append(p)
		#A[j+1]????¬????makepoint?????????append??????
	 j range(len(A)-1) range len(A)-1 len(A) len A 1 C = makepoint(A[j], A[j+1]) C makepoint(A[j], A[j+1]) makepoint A[j] A j A[j+1] A j+1 j 1 B.append(A[j]) B.append B append A[j] A j for p in C:
			B.append(p)
		#A[j+1]????¬????makepoint?????????append??????
	 p C B.append(p) B.append B append p B.append(A[-1]) B.append B append A[-1] A -1 A = B A B for x in A:
	print("{:.8f}".format(x[0])),
	print("{:.8f}".format(x[1])) x A print("{:.8f}".format(x[0])) print "{:.8f}".format(x[0]) "{:.8f}".format "{:.8f}" format x[0] x 0 print("{:.8f}".format(x[1])) print "{:.8f}".format(x[1]) "{:.8f}".format "{:.8f}" format x[1] x 1 B = [] [] B A = [[0., 0.],[100., 0.]] [[0., 0.],[100., 0.]] A A = B B A def vector_add(v1, v2):
	new_v = []
	for i in range(2):
		add = v1[i] + v2[i]
		new_v.append(add)
	return new_v def vector_add(v1, v2):
	new_v = []
	for i in range(2):
		add = v1[i] + v2[i]
		new_v.append(add)
	return new_v vector_add def makepoint(p_A1, p_A2):
	x_p_C1 = (p_A2[0] - p_A1[0]) / 3 + p_A1[0]
	y_p_C1 = (p_A2[1] - p_A1[1]) / 3 + p_A1[1]
	x_p_C3 = (p_A2[0] - p_A1[0]) * 2 / 3 + p_A1[0]
	y_p_C3 = (p_A2[1] - p_A1[1]) * 2 / 3 + p_A1[1]

	p_C1 = [x_p_C1, y_p_C1]
	p_C3 = [x_p_C3, y_p_C3]

	v01 = [x_p_C1 - p_A1[0], y_p_C1 - p_A1[1]]
	rot_v01 = vector_rot(v01, 60 * math.pi / 180)
	v02 = vector_add(v01, rot_v01)
	p_C2 = vector_add(p_A1, v02)	
	
	C = [p_C1, p_C2, p_C3]
	return C def makepoint(p_A1, p_A2):
	x_p_C1 = (p_A2[0] - p_A1[0]) / 3 + p_A1[0]
	y_p_C1 = (p_A2[1] - p_A1[1]) / 3 + p_A1[1]
	x_p_C3 = (p_A2[0] - p_A1[0]) * 2 / 3 + p_A1[0]
	y_p_C3 = (p_A2[1] - p_A1[1]) * 2 / 3 + p_A1[1]

	p_C1 = [x_p_C1, y_p_C1]
	p_C3 = [x_p_C3, y_p_C3]

	v01 = [x_p_C1 - p_A1[0], y_p_C1 - p_A1[1]]
	rot_v01 = vector_rot(v01, 60 * math.pi / 180)
	v02 = vector_add(v01, rot_v01)
	p_C2 = vector_add(p_A1, v02)	
	
	C = [p_C1, p_C2, p_C3]
	return C makepoint n = int(raw_input()) int(raw_input()) n C = makepoint(A[j], A[j+1]) makepoint(A[j], A[j+1]) C def vector_rot(vector, radian):
	new_x = vector[0] * math.cos(radian) - vector[1] * math.sin(radian)
	new_y = vector[0] * math.sin(radian) + vector[1] * math.cos(radian)
	return [new_x, new_y] def vector_rot(vector, radian):
	new_x = vector[0] * math.cos(radian) - vector[1] * math.sin(radian)
	new_y = vector[0] * math.sin(radian) + vector[1] * math.cos(radian)
	return [new_x, new_y] vector_rot
# coding: utf-8

import math

n = int(raw_input())

def vector_rot(vector, radian):
	new_x = vector[0] * math.cos(radian) - vector[1] * math.sin(radian)
	new_y = vector[0] * math.sin(radian) + vector[1] * math.cos(radian)
	return [new_x, new_y]

def vector_add(v1, v2):
	new_v = []
	for i in range(2):
		add = v1[i] + v2[i]
		new_v.append(add)
	return new_v

def makepoint(p_A1, p_A2):
	x_p_C1 = (p_A2[0] - p_A1[0]) / 3 + p_A1[0]
	y_p_C1 = (p_A2[1] - p_A1[1]) / 3 + p_A1[1]
	x_p_C3 = (p_A2[0] - p_A1[0]) * 2 / 3 + p_A1[0]
	y_p_C3 = (p_A2[1] - p_A1[1]) * 2 / 3 + p_A1[1]

	p_C1 = [x_p_C1, y_p_C1]
	p_C3 = [x_p_C3, y_p_C3]

	v01 = [x_p_C1 - p_A1[0], y_p_C1 - p_A1[1]]
	rot_v01 = vector_rot(v01, 60 * math.pi / 180)
	v02 = vector_add(v01, rot_v01)
	p_C2 = vector_add(p_A1, v02)	
	
	C = [p_C1, p_C2, p_C3]
	return C

A = [[0., 0.],[100., 0.]]
for i in range(n):
	B = []
	for j in range(len(A)-1): #A[j]??¨A[j+1]
		C = makepoint(A[j], A[j+1]) #C = [p_C1, p_C2, p_C3]
		B.append(A[j])
		for p in C:
			B.append(p)
		#A[j+1]????¬????makepoint?????????append??????
	B.append(A[-1]) #??????????????\?????\??????
	A = B

for x in A:
	print("{:.8f}".format(x[0])),
	print("{:.8f}".format(x[1]))