# -*- coding: utf-8 -*-
import math

class KochCurve(object):
	x = 0.0
	y = 0.0

	# ?§£???
	def koch(self, n, a, b):
		if n == 0:
			return 

		s = KochCurve()
		t = KochCurve()
		u = KochCurve()
		th = math.pi * 60.0 / 180.0

		s.x = (2.0 * a.x + 1.0 * b.x) / 3.0
		s.y = (2.0 * a.y + 1.0 * b.y) / 3.0
		t.x = (1.0 * a.x + 2.0 * b.x) / 3.0
		t.y = (1.0 * a.y + 2.0 * b.y) / 3.0
		u.x = (t.x - s.x) * math.cos(th) - (t.y - s.y) * math.sin(th) + s.x
		u.y = (t.x - s.x) * math.sin(th) + (t.y - s.y) * math.cos(th) + s.y
		
		KochCurve().koch(n - 1, a, s)
		msg = "%.8f %.8f" % (s.x, s.y)
		print(msg)
		KochCurve().koch(n - 1, s, u)
		msg = "%.8f %.8f" % (u.x, u.y)
		print(msg)
		KochCurve().koch(n - 1, u, t)
		msg = "%.8f %.8f" % (t.x, t.y)
		print(msg)
		KochCurve().koch(n - 1, t, b)


if __name__ == '__main__':
	a = KochCurve()
	b = KochCurve()

	n = int(input())

	a.x = 0
	a.y = 0
	b.x = 100
	b.y = 0

	msg = "%.8f %.8f" % (a.x, a.y)
	print(msg)
	KochCurve().koch(n, a, b)
	msg = "%.8f %.8f" % (b.x, b.y)
	print(msg) import math math class KochCurve(object):
	x = 0.0
	y = 0.0

	# ?§£???
	def koch(self, n, a, b):
		if n == 0:
			return 

		s = KochCurve()
		t = KochCurve()
		u = KochCurve()
		th = math.pi * 60.0 / 180.0

		s.x = (2.0 * a.x + 1.0 * b.x) / 3.0
		s.y = (2.0 * a.y + 1.0 * b.y) / 3.0
		t.x = (1.0 * a.x + 2.0 * b.x) / 3.0
		t.y = (1.0 * a.y + 2.0 * b.y) / 3.0
		u.x = (t.x - s.x) * math.cos(th) - (t.y - s.y) * math.sin(th) + s.x
		u.y = (t.x - s.x) * math.sin(th) + (t.y - s.y) * math.cos(th) + s.y
		
		KochCurve().koch(n - 1, a, s)
		msg = "%.8f %.8f" % (s.x, s.y)
		print(msg)
		KochCurve().koch(n - 1, s, u)
		msg = "%.8f %.8f" % (u.x, u.y)
		print(msg)
		KochCurve().koch(n - 1, u, t)
		msg = "%.8f %.8f" % (t.x, t.y)
		print(msg)
		KochCurve().koch(n - 1, t, b) KochCurve x = 0.0 x 0.0 y = 0.0 y 0.0 def koch(self, n, a, b):
		if n == 0:
			return 

		s = KochCurve()
		t = KochCurve()
		u = KochCurve()
		th = math.pi * 60.0 / 180.0

		s.x = (2.0 * a.x + 1.0 * b.x) / 3.0
		s.y = (2.0 * a.y + 1.0 * b.y) / 3.0
		t.x = (1.0 * a.x + 2.0 * b.x) / 3.0
		t.y = (1.0 * a.y + 2.0 * b.y) / 3.0
		u.x = (t.x - s.x) * math.cos(th) - (t.y - s.y) * math.sin(th) + s.x
		u.y = (t.x - s.x) * math.sin(th) + (t.y - s.y) * math.cos(th) + s.y
		
		KochCurve().koch(n - 1, a, s)
		msg = "%.8f %.8f" % (s.x, s.y)
		print(msg)
		KochCurve().koch(n - 1, s, u)
		msg = "%.8f %.8f" % (u.x, u.y)
		print(msg)
		KochCurve().koch(n - 1, u, t)
		msg = "%.8f %.8f" % (t.x, t.y)
		print(msg)
		KochCurve().koch(n - 1, t, b) koch if n == 0:
			return 

		 n == 0 n 0 return s = KochCurve() s KochCurve() KochCurve t = KochCurve() t KochCurve() KochCurve u = KochCurve() u KochCurve() KochCurve th = math.pi * 60.0 / 180.0 th math.pi * 60.0 / 180.0 math.pi * 60.0 math.pi math pi 60.0 180.0 s.x = (2.0 * a.x + 1.0 * b.x) / 3.0 s.x s x (2.0 * a.x + 1.0 * b.x) / 3.0 2.0 * a.x + 1.0 * b.x 2.0 * a.x 2.0 a.x a x 1.0 * b.x 1.0 b.x b x 3.0 s.y = (2.0 * a.y + 1.0 * b.y) / 3.0 s.y s y (2.0 * a.y + 1.0 * b.y) / 3.0 2.0 * a.y + 1.0 * b.y 2.0 * a.y 2.0 a.y a y 1.0 * b.y 1.0 b.y b y 3.0 t.x = (1.0 * a.x + 2.0 * b.x) / 3.0 t.x t x (1.0 * a.x + 2.0 * b.x) / 3.0 1.0 * a.x + 2.0 * b.x 1.0 * a.x 1.0 a.x a x 2.0 * b.x 2.0 b.x b x 3.0 t.y = (1.0 * a.y + 2.0 * b.y) / 3.0 t.y t y (1.0 * a.y + 2.0 * b.y) / 3.0 1.0 * a.y + 2.0 * b.y 1.0 * a.y 1.0 a.y a y 2.0 * b.y 2.0 b.y b y 3.0 u.x = (t.x - s.x) * math.cos(th) - (t.y - s.y) * math.sin(th) + s.x u.x u x (t.x - s.x) * math.cos(th) - (t.y - s.y) * math.sin(th) + s.x (t.x - s.x) * math.cos(th) - (t.y - s.y) * math.sin(th) (t.x - s.x) * math.cos(th) t.x - s.x t.x t x s.x s x math.cos(th) math.cos math cos th (t.y - s.y) * math.sin(th) t.y - s.y t.y t y s.y s y math.sin(th) math.sin math sin th s.x s x u.y = (t.x - s.x) * math.sin(th) + (t.y - s.y) * math.cos(th) + s.y u.y u y (t.x - s.x) * math.sin(th) + (t.y - s.y) * math.cos(th) + s.y (t.x - s.x) * math.sin(th) + (t.y - s.y) * math.cos(th) (t.x - s.x) * math.sin(th) t.x - s.x t.x t x s.x s x math.sin(th) math.sin math sin th (t.y - s.y) * math.cos(th) t.y - s.y t.y t y s.y s y math.cos(th) math.cos math cos th s.y s y KochCurve().koch(n - 1, a, s) ().koch () KochCurve koch n - 1 n 1 a s msg = "%.8f %.8f" % (s.x, s.y) msg "%.8f %.8f" % (s.x, s.y) "%.8f %.8f" (s.x, s.y) s.x s x s.y s y print(msg) print msg KochCurve().koch(n - 1, s, u) ().koch () KochCurve koch n - 1 n 1 s u msg = "%.8f %.8f" % (u.x, u.y) msg "%.8f %.8f" % (u.x, u.y) "%.8f %.8f" (u.x, u.y) u.x u x u.y u y print(msg) print msg KochCurve().koch(n - 1, u, t) ().koch () KochCurve koch n - 1 n 1 u t msg = "%.8f %.8f" % (t.x, t.y) msg "%.8f %.8f" % (t.x, t.y) "%.8f %.8f" (t.x, t.y) t.x t x t.y t y print(msg) print msg KochCurve().koch(n - 1, t, b) ().koch () KochCurve koch n - 1 n 1 t b self self n n a a b b object if __name__ == '__main__':
	a = KochCurve()
	b = KochCurve()

	n = int(input())

	a.x = 0
	a.y = 0
	b.x = 100
	b.y = 0

	msg = "%.8f %.8f" % (a.x, a.y)
	print(msg)
	KochCurve().koch(n, a, b)
	msg = "%.8f %.8f" % (b.x, b.y)
	print(msg) __name__ == '__main__' __name__ '__main__' a = KochCurve() a KochCurve() KochCurve b = KochCurve() b KochCurve() KochCurve n = int(input()) n int(input()) int input() input a.x = 0 a.x a x 0 a.y = 0 a.y a y 0 b.x = 100 b.x b x 100 b.y = 0 b.y b y 0 msg = "%.8f %.8f" % (a.x, a.y) msg "%.8f %.8f" % (a.x, a.y) "%.8f %.8f" (a.x, a.y) a.x a x a.y a y print(msg) print msg KochCurve().koch(n, a, b) ().koch () KochCurve koch n a b msg = "%.8f %.8f" % (b.x, b.y) msg "%.8f %.8f" % (b.x, b.y) "%.8f %.8f" (b.x, b.y) b.x b x b.y b y print(msg) print msg msg = "%.8f %.8f" % (b.x, b.y) "%.8f %.8f" % (b.x, b.y) msg n = int(input()) int(input()) n class KochCurve(object):
	x = 0.0
	y = 0.0

	# ?§£???
	def koch(self, n, a, b):
		if n == 0:
			return 

		s = KochCurve()
		t = KochCurve()
		u = KochCurve()
		th = math.pi * 60.0 / 180.0

		s.x = (2.0 * a.x + 1.0 * b.x) / 3.0
		s.y = (2.0 * a.y + 1.0 * b.y) / 3.0
		t.x = (1.0 * a.x + 2.0 * b.x) / 3.0
		t.y = (1.0 * a.y + 2.0 * b.y) / 3.0
		u.x = (t.x - s.x) * math.cos(th) - (t.y - s.y) * math.sin(th) + s.x
		u.y = (t.x - s.x) * math.sin(th) + (t.y - s.y) * math.cos(th) + s.y
		
		KochCurve().koch(n - 1, a, s)
		msg = "%.8f %.8f" % (s.x, s.y)
		print(msg)
		KochCurve().koch(n - 1, s, u)
		msg = "%.8f %.8f" % (u.x, u.y)
		print(msg)
		KochCurve().koch(n - 1, u, t)
		msg = "%.8f %.8f" % (t.x, t.y)
		print(msg)
		KochCurve().koch(n - 1, t, b) class KochCurve(object):
	x = 0.0
	y = 0.0

	# ?§£???
	def koch(self, n, a, b):
		if n == 0:
			return 

		s = KochCurve()
		t = KochCurve()
		u = KochCurve()
		th = math.pi * 60.0 / 180.0

		s.x = (2.0 * a.x + 1.0 * b.x) / 3.0
		s.y = (2.0 * a.y + 1.0 * b.y) / 3.0
		t.x = (1.0 * a.x + 2.0 * b.x) / 3.0
		t.y = (1.0 * a.y + 2.0 * b.y) / 3.0
		u.x = (t.x - s.x) * math.cos(th) - (t.y - s.y) * math.sin(th) + s.x
		u.y = (t.x - s.x) * math.sin(th) + (t.y - s.y) * math.cos(th) + s.y
		
		KochCurve().koch(n - 1, a, s)
		msg = "%.8f %.8f" % (s.x, s.y)
		print(msg)
		KochCurve().koch(n - 1, s, u)
		msg = "%.8f %.8f" % (u.x, u.y)
		print(msg)
		KochCurve().koch(n - 1, u, t)
		msg = "%.8f %.8f" % (t.x, t.y)
		print(msg)
		KochCurve().koch(n - 1, t, b) KochCurve a = KochCurve() KochCurve() a b = KochCurve() KochCurve() b msg = "%.8f %.8f" % (a.x, a.y) "%.8f %.8f" % (a.x, a.y) msg
# -*- coding: utf-8 -*-
import math

class KochCurve(object):
	x = 0.0
	y = 0.0

	# ?§£???
	def koch(self, n, a, b):
		if n == 0:
			return 

		s = KochCurve()
		t = KochCurve()
		u = KochCurve()
		th = math.pi * 60.0 / 180.0

		s.x = (2.0 * a.x + 1.0 * b.x) / 3.0
		s.y = (2.0 * a.y + 1.0 * b.y) / 3.0
		t.x = (1.0 * a.x + 2.0 * b.x) / 3.0
		t.y = (1.0 * a.y + 2.0 * b.y) / 3.0
		u.x = (t.x - s.x) * math.cos(th) - (t.y - s.y) * math.sin(th) + s.x
		u.y = (t.x - s.x) * math.sin(th) + (t.y - s.y) * math.cos(th) + s.y
		
		KochCurve().koch(n - 1, a, s)
		msg = "%.8f %.8f" % (s.x, s.y)
		print(msg)
		KochCurve().koch(n - 1, s, u)
		msg = "%.8f %.8f" % (u.x, u.y)
		print(msg)
		KochCurve().koch(n - 1, u, t)
		msg = "%.8f %.8f" % (t.x, t.y)
		print(msg)
		KochCurve().koch(n - 1, t, b)


if __name__ == '__main__':
	a = KochCurve()
	b = KochCurve()

	n = int(input())

	a.x = 0
	a.y = 0
	b.x = 100
	b.y = 0

	msg = "%.8f %.8f" % (a.x, a.y)
	print(msg)
	KochCurve().koch(n, a, b)
	msg = "%.8f %.8f" % (b.x, b.y)
	print(msg)