import math

class Pos:
	def __init__(self, x, y):
		self.x = x
		self.y = y
	def __str__(self):
		return str(self.x) + ' ' + str(self.y)

def koch_curve(i, n, start, end):
	if i < n:
		f = get_pos(start, end, 1/3)
		t = get_pos(start, end, 2/3)
		s = get_sec_pos(start, end, f, t)
		koch_curve(i + 1, n, start, f)
		print(f)
		koch_curve(i + 1, n, f, s)
		print(s)
		koch_curve(i + 1, n, s, t)
		print(t)
		koch_curve(i + 1, n, t, end)

def get_pos(start, end, m):
	dX = (end.x - start.x) * m
	dY = (end.y - start.y) * m
	return Pos(start.x + dX, start.y + dY)

def get_sec_pos(start, end, f, t):
	x = y = 0
	if f.y == t.y:
		x = start.x + (end.x - start.x) / 2
		len = math.fabs(t.x - f.x)
		h = math.sqrt(len**2 - (len/2)**2)
		if start.x < end.x:
			y = start.y + h
		else:
			y = start.y - h
	elif f.x < t.x and f.y < t.y:
		x = start.x
		y = t.y
	elif f.x > t.x and f.y < t.y:
		x = end.x
		y = f.y
	elif f.x > t.x and f.y > t.y:
		x = start.x
		y = t.y
	else:
		x = end.x
		y = f.y
	return Pos(x, y)
	
n = int(input())
start = Pos(0, 0)
end = Pos(100, 0)
print(start)
koch_curve(0, n, start, end)
print(end)
 import math math class Pos:
	def __init__(self, x, y):
		self.x = x
		self.y = y
	def __str__(self):
		return str(self.x) + ' ' + str(self.y) Pos def __init__(self, x, y):
		self.x = x
		self.y = y
	 __init__ self.x = x self.x self x x self.y = y self.y self y y self self x x y y def __str__(self):
		return str(self.x) + ' ' + str(self.y) __str__ return str(self.x) + ' ' + str(self.y) str(self.x) + ' ' + str(self.y) str(self.x) + ' ' str(self.x) str self.x self x ' ' str(self.y) str self.y self y self self def koch_curve(i, n, start, end):
	if i < n:
		f = get_pos(start, end, 1/3)
		t = get_pos(start, end, 2/3)
		s = get_sec_pos(start, end, f, t)
		koch_curve(i + 1, n, start, f)
		print(f)
		koch_curve(i + 1, n, f, s)
		print(s)
		koch_curve(i + 1, n, s, t)
		print(t)
		koch_curve(i + 1, n, t, end) koch_curve if i < n:
		f = get_pos(start, end, 1/3)
		t = get_pos(start, end, 2/3)
		s = get_sec_pos(start, end, f, t)
		koch_curve(i + 1, n, start, f)
		print(f)
		koch_curve(i + 1, n, f, s)
		print(s)
		koch_curve(i + 1, n, s, t)
		print(t)
		koch_curve(i + 1, n, t, end) i < n i n f = get_pos(start, end, 1/3) f get_pos(start, end, 1/3) get_pos start end 1/3 1 3 t = get_pos(start, end, 2/3) t get_pos(start, end, 2/3) get_pos start end 2/3 2 3 s = get_sec_pos(start, end, f, t) s get_sec_pos(start, end, f, t) get_sec_pos start end f t koch_curve(i + 1, n, start, f) koch_curve i + 1 i 1 n start f print(f) print f koch_curve(i + 1, n, f, s) koch_curve i + 1 i 1 n f s print(s) print s koch_curve(i + 1, n, s, t) koch_curve i + 1 i 1 n s t print(t) print t koch_curve(i + 1, n, t, end) koch_curve i + 1 i 1 n t end i i n n start start end end def get_pos(start, end, m):
	dX = (end.x - start.x) * m
	dY = (end.y - start.y) * m
	return Pos(start.x + dX, start.y + dY) get_pos dX = (end.x - start.x) * m dX (end.x - start.x) * m end.x - start.x end.x end x start.x start x m dY = (end.y - start.y) * m dY (end.y - start.y) * m end.y - start.y end.y end y start.y start y m return Pos(start.x + dX, start.y + dY) Pos(start.x + dX, start.y + dY) Pos start.x + dX start.x start x dX start.y + dY start.y start y dY start start end end m m def get_sec_pos(start, end, f, t):
	x = y = 0
	if f.y == t.y:
		x = start.x + (end.x - start.x) / 2
		len = math.fabs(t.x - f.x)
		h = math.sqrt(len**2 - (len/2)**2)
		if start.x < end.x:
			y = start.y + h
		else:
			y = start.y - h
	elif f.x < t.x and f.y < t.y:
		x = start.x
		y = t.y
	elif f.x > t.x and f.y < t.y:
		x = end.x
		y = f.y
	elif f.x > t.x and f.y > t.y:
		x = start.x
		y = t.y
	else:
		x = end.x
		y = f.y
	return Pos(x, y)
	 get_sec_pos x = y = 0 x 0 = y = 0 y 0 if f.y == t.y:
		x = start.x + (end.x - start.x) / 2
		len = math.fabs(t.x - f.x)
		h = math.sqrt(len**2 - (len/2)**2)
		if start.x < end.x:
			y = start.y + h
		else:
			y = start.y - h
	elif f.x < t.x and f.y < t.y:
		x = start.x
		y = t.y
	elif f.x > t.x and f.y < t.y:
		x = end.x
		y = f.y
	elif f.x > t.x and f.y > t.y:
		x = start.x
		y = t.y
	else:
		x = end.x
		y = f.y
	 f.y == t.y f.y f y t.y t y x = start.x + (end.x - start.x) / 2 x start.x + (end.x - start.x) / 2 start.x start x (end.x - start.x) / 2 end.x - start.x end.x end x start.x start x 2 len = math.fabs(t.x - f.x) len math.fabs(t.x - f.x) math.fabs math fabs t.x - f.x t.x t x f.x f x h = math.sqrt(len**2 - (len/2)**2) h math.sqrt(len**2 - (len/2)**2) math.sqrt math sqrt len**2 - (len/2)**2 len**2 len 2 (len/2)**2 len/2 len 2 2 if start.x < end.x:
			y = start.y + h
		else:
			y = start.y - h
	 start.x < end.x start.x start x end.x end x y = start.y + h y start.y + h start.y start y h y = start.y - h y start.y - h start.y start y h elif f.x < t.x and f.y < t.y:
		x = start.x
		y = t.y
	 f.x < t.x and f.y < t.y f.x < t.x f.x f x t.x t x f.y < t.y f.y f y t.y t y x = start.x x start.x start x y = t.y y t.y t y elif f.x > t.x and f.y < t.y:
		x = end.x
		y = f.y
	 f.x > t.x and f.y < t.y f.x > t.x f.x f x t.x t x f.y < t.y f.y f y t.y t y x = end.x x end.x end x y = f.y y f.y f y elif f.x > t.x and f.y > t.y:
		x = start.x
		y = t.y
	 f.x > t.x and f.y > t.y f.x > t.x f.x f x t.x t x f.y > t.y f.y f y t.y t y x = start.x x start.x start x y = t.y y t.y t y x = end.x x end.x end x y = f.y y f.y f y return Pos(x, y) Pos(x, y) Pos x y start start end end f f t t n = int(input()) n int(input()) int input() input start = Pos(0, 0) start Pos(0, 0) Pos 0 0 end = Pos(100, 0) end Pos(100, 0) Pos 100 0 print(start) print start koch_curve(0, n, start, end) koch_curve 0 n start end print(end) print end def koch_curve(i, n, start, end):
	if i < n:
		f = get_pos(start, end, 1/3)
		t = get_pos(start, end, 2/3)
		s = get_sec_pos(start, end, f, t)
		koch_curve(i + 1, n, start, f)
		print(f)
		koch_curve(i + 1, n, f, s)
		print(s)
		koch_curve(i + 1, n, s, t)
		print(t)
		koch_curve(i + 1, n, t, end) def koch_curve(i, n, start, end):
	if i < n:
		f = get_pos(start, end, 1/3)
		t = get_pos(start, end, 2/3)
		s = get_sec_pos(start, end, f, t)
		koch_curve(i + 1, n, start, f)
		print(f)
		koch_curve(i + 1, n, f, s)
		print(s)
		koch_curve(i + 1, n, s, t)
		print(t)
		koch_curve(i + 1, n, t, end) koch_curve class Pos:
	def __init__(self, x, y):
		self.x = x
		self.y = y
	def __str__(self):
		return str(self.x) + ' ' + str(self.y) class Pos:
	def __init__(self, x, y):
		self.x = x
		self.y = y
	def __str__(self):
		return str(self.x) + ' ' + str(self.y) Pos def get_pos(start, end, m):
	dX = (end.x - start.x) * m
	dY = (end.y - start.y) * m
	return Pos(start.x + dX, start.y + dY) def get_pos(start, end, m):
	dX = (end.x - start.x) * m
	dY = (end.y - start.y) * m
	return Pos(start.x + dX, start.y + dY) get_pos n = int(input()) int(input()) n def get_sec_pos(start, end, f, t):
	x = y = 0
	if f.y == t.y:
		x = start.x + (end.x - start.x) / 2
		len = math.fabs(t.x - f.x)
		h = math.sqrt(len**2 - (len/2)**2)
		if start.x < end.x:
			y = start.y + h
		else:
			y = start.y - h
	elif f.x < t.x and f.y < t.y:
		x = start.x
		y = t.y
	elif f.x > t.x and f.y < t.y:
		x = end.x
		y = f.y
	elif f.x > t.x and f.y > t.y:
		x = start.x
		y = t.y
	else:
		x = end.x
		y = f.y
	return Pos(x, y)
	 def get_sec_pos(start, end, f, t):
	x = y = 0
	if f.y == t.y:
		x = start.x + (end.x - start.x) / 2
		len = math.fabs(t.x - f.x)
		h = math.sqrt(len**2 - (len/2)**2)
		if start.x < end.x:
			y = start.y + h
		else:
			y = start.y - h
	elif f.x < t.x and f.y < t.y:
		x = start.x
		y = t.y
	elif f.x > t.x and f.y < t.y:
		x = end.x
		y = f.y
	elif f.x > t.x and f.y > t.y:
		x = start.x
		y = t.y
	else:
		x = end.x
		y = f.y
	return Pos(x, y)
	 get_sec_pos start = Pos(0, 0) Pos(0, 0) start end = Pos(100, 0) Pos(100, 0) end
import math

class Pos:
	def __init__(self, x, y):
		self.x = x
		self.y = y
	def __str__(self):
		return str(self.x) + ' ' + str(self.y)

def koch_curve(i, n, start, end):
	if i < n:
		f = get_pos(start, end, 1/3)
		t = get_pos(start, end, 2/3)
		s = get_sec_pos(start, end, f, t)
		koch_curve(i + 1, n, start, f)
		print(f)
		koch_curve(i + 1, n, f, s)
		print(s)
		koch_curve(i + 1, n, s, t)
		print(t)
		koch_curve(i + 1, n, t, end)

def get_pos(start, end, m):
	dX = (end.x - start.x) * m
	dY = (end.y - start.y) * m
	return Pos(start.x + dX, start.y + dY)

def get_sec_pos(start, end, f, t):
	x = y = 0
	if f.y == t.y:
		x = start.x + (end.x - start.x) / 2
		len = math.fabs(t.x - f.x)
		h = math.sqrt(len**2 - (len/2)**2)
		if start.x < end.x:
			y = start.y + h
		else:
			y = start.y - h
	elif f.x < t.x and f.y < t.y:
		x = start.x
		y = t.y
	elif f.x > t.x and f.y < t.y:
		x = end.x
		y = f.y
	elif f.x > t.x and f.y > t.y:
		x = start.x
		y = t.y
	else:
		x = end.x
		y = f.y
	return Pos(x, y)
	
n = int(input())
start = Pos(0, 0)
end = Pos(100, 0)
print(start)
koch_curve(0, n, start, end)
print(end)

