# コッホ曲線
from math import sin, cos, tan, pi

n = int(input())

def koch(n, a, b):
	if n == 0:
		return
	s = [0, 0]
	t = [0, 0]
	u = [0, 0]
	th = pi * 60 / 180

	s[0] = (2 * a[0] + 1 * b[0]) / 3
	s[1] = (2 * a[1] + 1 * b[1]) / 3
	t[0] = (1 * a[0] + 2 * b[0]) / 3
	t[1] = (1 * a[1] + 2 * b[1]) / 3
	u[0] = (t[0] - s[0]) * cos(th) - (t[1] - s[1]) * sin(th) + s[0]
	u[1] = (t[0] - s[0]) * sin(th) + (t[1] - s[1]) * cos(th) + s[1]
	
	koch(n - 1, a, s)
	print(s[0], s[1])
# 	print('{:.8f} {:.8f}'.format(s[0], s[1]))
	koch(n - 1, s, u)
	print(u[0], u[1])
# 	print('{:.8f} {:.8f}'.format(u[0], u[1]))
	koch(n - 1, u, t)
	print(t[0], t[1])
# 	print('{:.8f} {:.8f}'.format(t[0], t[1]))
	koch(n - 1, t, b)

a = [0.0, 0.0]
b = [100.0, 0.0]
print(a[0], a[1])
# print('{:.8f} {:.8f}'.format(a[0], a[1]))
koch(n, a, b)
print(b[0], b[1])
# print('{:.8f} {:.8f}'.format(b[0], b[1])) from math import sin, cos, tan, pi n = int(input()) n int(input()) int input() input def koch(n, a, b):
	if n == 0:
		return
	s = [0, 0]
	t = [0, 0]
	u = [0, 0]
	th = pi * 60 / 180

	s[0] = (2 * a[0] + 1 * b[0]) / 3
	s[1] = (2 * a[1] + 1 * b[1]) / 3
	t[0] = (1 * a[0] + 2 * b[0]) / 3
	t[1] = (1 * a[1] + 2 * b[1]) / 3
	u[0] = (t[0] - s[0]) * cos(th) - (t[1] - s[1]) * sin(th) + s[0]
	u[1] = (t[0] - s[0]) * sin(th) + (t[1] - s[1]) * cos(th) + s[1]
	
	koch(n - 1, a, s)
	print(s[0], s[1])
# 	print('{:.8f} {:.8f}'.format(s[0], s[1]))
	koch(n - 1, s, u)
	print(u[0], u[1])
# 	print('{:.8f} {:.8f}'.format(u[0], u[1]))
	koch(n - 1, u, t)
	print(t[0], t[1])
# 	print('{:.8f} {:.8f}'.format(t[0], t[1]))
	koch(n - 1, t, b) koch if n == 0:
		return
	 n == 0 n 0 return s = [0, 0] s [0, 0] 0 0 t = [0, 0] t [0, 0] 0 0 u = [0, 0] u [0, 0] 0 0 th = pi * 60 / 180 th pi * 60 / 180 pi * 60 pi 60 180 s[0] = (2 * a[0] + 1 * b[0]) / 3 s[0] s 0 (2 * a[0] + 1 * b[0]) / 3 2 * a[0] + 1 * b[0] 2 * a[0] 2 a[0] a 0 1 * b[0] 1 b[0] b 0 3 s[1] = (2 * a[1] + 1 * b[1]) / 3 s[1] s 1 (2 * a[1] + 1 * b[1]) / 3 2 * a[1] + 1 * b[1] 2 * a[1] 2 a[1] a 1 1 * b[1] 1 b[1] b 1 3 t[0] = (1 * a[0] + 2 * b[0]) / 3 t[0] t 0 (1 * a[0] + 2 * b[0]) / 3 1 * a[0] + 2 * b[0] 1 * a[0] 1 a[0] a 0 2 * b[0] 2 b[0] b 0 3 t[1] = (1 * a[1] + 2 * b[1]) / 3 t[1] t 1 (1 * a[1] + 2 * b[1]) / 3 1 * a[1] + 2 * b[1] 1 * a[1] 1 a[1] a 1 2 * b[1] 2 b[1] b 1 3 u[0] = (t[0] - s[0]) * cos(th) - (t[1] - s[1]) * sin(th) + s[0] u[0] u 0 (t[0] - s[0]) * cos(th) - (t[1] - s[1]) * sin(th) + s[0] (t[0] - s[0]) * cos(th) - (t[1] - s[1]) * sin(th) (t[0] - s[0]) * cos(th) t[0] - s[0] t[0] t 0 s[0] s 0 cos(th) cos th (t[1] - s[1]) * sin(th) t[1] - s[1] t[1] t 1 s[1] s 1 sin(th) sin th s[0] s 0 u[1] = (t[0] - s[0]) * sin(th) + (t[1] - s[1]) * cos(th) + s[1] u[1] u 1 (t[0] - s[0]) * sin(th) + (t[1] - s[1]) * cos(th) + s[1] (t[0] - s[0]) * sin(th) + (t[1] - s[1]) * cos(th) (t[0] - s[0]) * sin(th) t[0] - s[0] t[0] t 0 s[0] s 0 sin(th) sin th (t[1] - s[1]) * cos(th) t[1] - s[1] t[1] t 1 s[1] s 1 cos(th) cos th s[1] s 1 koch(n - 1, a, s) koch n - 1 n 1 a s print(s[0], s[1]) print s[0] s 0 s[1] s 1 koch(n - 1, s, u) koch n - 1 n 1 s u print(u[0], u[1]) print u[0] u 0 u[1] u 1 koch(n - 1, u, t) koch n - 1 n 1 u t print(t[0], t[1]) print t[0] t 0 t[1] t 1 koch(n - 1, t, b) koch n - 1 n 1 t b n n a a b b a = [0.0, 0.0] a [0.0, 0.0] 0.0 0.0 b = [100.0, 0.0] b [100.0, 0.0] 100.0 0.0 print(a[0], a[1]) print a[0] a 0 a[1] a 1 koch(n, a, b) koch n a b print(b[0], b[1]) print b[0] b 0 b[1] b 1 n = int(input()) int(input()) n a = [0.0, 0.0] [0.0, 0.0] a b = [100.0, 0.0] [100.0, 0.0] b def koch(n, a, b):
	if n == 0:
		return
	s = [0, 0]
	t = [0, 0]
	u = [0, 0]
	th = pi * 60 / 180

	s[0] = (2 * a[0] + 1 * b[0]) / 3
	s[1] = (2 * a[1] + 1 * b[1]) / 3
	t[0] = (1 * a[0] + 2 * b[0]) / 3
	t[1] = (1 * a[1] + 2 * b[1]) / 3
	u[0] = (t[0] - s[0]) * cos(th) - (t[1] - s[1]) * sin(th) + s[0]
	u[1] = (t[0] - s[0]) * sin(th) + (t[1] - s[1]) * cos(th) + s[1]
	
	koch(n - 1, a, s)
	print(s[0], s[1])
# 	print('{:.8f} {:.8f}'.format(s[0], s[1]))
	koch(n - 1, s, u)
	print(u[0], u[1])
# 	print('{:.8f} {:.8f}'.format(u[0], u[1]))
	koch(n - 1, u, t)
	print(t[0], t[1])
# 	print('{:.8f} {:.8f}'.format(t[0], t[1]))
	koch(n - 1, t, b) def koch(n, a, b):
	if n == 0:
		return
	s = [0, 0]
	t = [0, 0]
	u = [0, 0]
	th = pi * 60 / 180

	s[0] = (2 * a[0] + 1 * b[0]) / 3
	s[1] = (2 * a[1] + 1 * b[1]) / 3
	t[0] = (1 * a[0] + 2 * b[0]) / 3
	t[1] = (1 * a[1] + 2 * b[1]) / 3
	u[0] = (t[0] - s[0]) * cos(th) - (t[1] - s[1]) * sin(th) + s[0]
	u[1] = (t[0] - s[0]) * sin(th) + (t[1] - s[1]) * cos(th) + s[1]
	
	koch(n - 1, a, s)
	print(s[0], s[1])
# 	print('{:.8f} {:.8f}'.format(s[0], s[1]))
	koch(n - 1, s, u)
	print(u[0], u[1])
# 	print('{:.8f} {:.8f}'.format(u[0], u[1]))
	koch(n - 1, u, t)
	print(t[0], t[1])
# 	print('{:.8f} {:.8f}'.format(t[0], t[1]))
	koch(n - 1, t, b) koch
# コッホ曲線
from math import sin, cos, tan, pi

n = int(input())

def koch(n, a, b):
	if n == 0:
		return
	s = [0, 0]
	t = [0, 0]
	u = [0, 0]
	th = pi * 60 / 180

	s[0] = (2 * a[0] + 1 * b[0]) / 3
	s[1] = (2 * a[1] + 1 * b[1]) / 3
	t[0] = (1 * a[0] + 2 * b[0]) / 3
	t[1] = (1 * a[1] + 2 * b[1]) / 3
	u[0] = (t[0] - s[0]) * cos(th) - (t[1] - s[1]) * sin(th) + s[0]
	u[1] = (t[0] - s[0]) * sin(th) + (t[1] - s[1]) * cos(th) + s[1]
	
	koch(n - 1, a, s)
	print(s[0], s[1])
# 	print('{:.8f} {:.8f}'.format(s[0], s[1]))
	koch(n - 1, s, u)
	print(u[0], u[1])
# 	print('{:.8f} {:.8f}'.format(u[0], u[1]))
	koch(n - 1, u, t)
	print(t[0], t[1])
# 	print('{:.8f} {:.8f}'.format(t[0], t[1]))
	koch(n - 1, t, b)

a = [0.0, 0.0]
b = [100.0, 0.0]
print(a[0], a[1])
# print('{:.8f} {:.8f}'.format(a[0], a[1]))
koch(n, a, b)
print(b[0], b[1])
# print('{:.8f} {:.8f}'.format(b[0], b[1]))
