import math
def kock(n, p1, p2):
 if n == 0:
  return

 #p1.p2??????s,t,u????¨????
 sx = (2 * p1[0] + 1 * p2[0]) / 3
 sy = (2 * p1[1] + 1 * p2[1]) / 3
 s = [sx, sy]
 tx = (1 * p1[0] + 2 * p2[0]) / 3
 ty = (1 * p1[1] + 2 * p2[1]) / 3
 t = [tx, ty]
 ux = (tx-sx) * math.cos(math.radians(60)) - (ty-sy) * math.sin(math.radians(60)) + sx
 uy = (tx-sx) * math.sin(math.radians(60)) + (ty-sy) * math.cos(math.radians(60)) + sy
 u = [ux, uy]

 kock(n-1,p1,s)
 print(" ".join(['{:.5f}'.format(i) for i in s]))
 kock(n-1,s,u)
 print(" ".join(['{:.5f}'.format(i) for i in u]))
 kock(n-1,u,t)
 print(" ".join(['{:.5f}'.format(i) for i in t]))
 kock(n-1,t,p2)

n = float(input())
print("0.00000 0.00000")
kock(n, [0,0], [100,0])
print("100.00000 0.00000") import math math def kock(n, p1, p2):
 if n == 0:
  return

 #p1.p2??????s,t,u????¨????
 sx = (2 * p1[0] + 1 * p2[0]) / 3
 sy = (2 * p1[1] + 1 * p2[1]) / 3
 s = [sx, sy]
 tx = (1 * p1[0] + 2 * p2[0]) / 3
 ty = (1 * p1[1] + 2 * p2[1]) / 3
 t = [tx, ty]
 ux = (tx-sx) * math.cos(math.radians(60)) - (ty-sy) * math.sin(math.radians(60)) + sx
 uy = (tx-sx) * math.sin(math.radians(60)) + (ty-sy) * math.cos(math.radians(60)) + sy
 u = [ux, uy]

 kock(n-1,p1,s)
 print(" ".join(['{:.5f}'.format(i) for i in s]))
 kock(n-1,s,u)
 print(" ".join(['{:.5f}'.format(i) for i in u]))
 kock(n-1,u,t)
 print(" ".join(['{:.5f}'.format(i) for i in t]))
 kock(n-1,t,p2) kock if n == 0:
  return

 #p1.p2??????s,t,u????¨????
  n == 0 n 0 return sx = (2 * p1[0] + 1 * p2[0]) / 3 sx (2 * p1[0] + 1 * p2[0]) / 3 2 * p1[0] + 1 * p2[0] 2 * p1[0] 2 p1[0] p1 0 1 * p2[0] 1 p2[0] p2 0 3 sy = (2 * p1[1] + 1 * p2[1]) / 3 sy (2 * p1[1] + 1 * p2[1]) / 3 2 * p1[1] + 1 * p2[1] 2 * p1[1] 2 p1[1] p1 1 1 * p2[1] 1 p2[1] p2 1 3 s = [sx, sy] s [sx, sy] sx sy tx = (1 * p1[0] + 2 * p2[0]) / 3 tx (1 * p1[0] + 2 * p2[0]) / 3 1 * p1[0] + 2 * p2[0] 1 * p1[0] 1 p1[0] p1 0 2 * p2[0] 2 p2[0] p2 0 3 ty = (1 * p1[1] + 2 * p2[1]) / 3 ty (1 * p1[1] + 2 * p2[1]) / 3 1 * p1[1] + 2 * p2[1] 1 * p1[1] 1 p1[1] p1 1 2 * p2[1] 2 p2[1] p2 1 3 t = [tx, ty] t [tx, ty] tx ty ux = (tx-sx) * math.cos(math.radians(60)) - (ty-sy) * math.sin(math.radians(60)) + sx ux (tx-sx) * math.cos(math.radians(60)) - (ty-sy) * math.sin(math.radians(60)) + sx (tx-sx) * math.cos(math.radians(60)) - (ty-sy) * math.sin(math.radians(60)) (tx-sx) * math.cos(math.radians(60)) tx-sx tx sx math.cos(math.radians(60)) math.cos math cos math.radians(60) math.radians math radians 60 (ty-sy) * math.sin(math.radians(60)) ty-sy ty sy math.sin(math.radians(60)) math.sin math sin math.radians(60) math.radians math radians 60 sx uy = (tx-sx) * math.sin(math.radians(60)) + (ty-sy) * math.cos(math.radians(60)) + sy uy (tx-sx) * math.sin(math.radians(60)) + (ty-sy) * math.cos(math.radians(60)) + sy (tx-sx) * math.sin(math.radians(60)) + (ty-sy) * math.cos(math.radians(60)) (tx-sx) * math.sin(math.radians(60)) tx-sx tx sx math.sin(math.radians(60)) math.sin math sin math.radians(60) math.radians math radians 60 (ty-sy) * math.cos(math.radians(60)) ty-sy ty sy math.cos(math.radians(60)) math.cos math cos math.radians(60) math.radians math radians 60 sy u = [ux, uy] u [ux, uy] ux uy kock(n-1,p1,s) kock n-1 n 1 p1 s '{:.5f}'.format(i) for i in s for i in s i s for i in s '{:.5f}'.format(i) '{:.5f}'.format '{:.5f}' format i print(" ".join(['{:.5f}'.format(i) for i in s])) print " ".join(['{:.5f}'.format(i) for i in s]) " ".join " " join ['{:.5f}'.format(i) for i in s] kock(n-1,s,u) kock n-1 n 1 s u '{:.5f}'.format(i) for i in u for i in u i u for i in u '{:.5f}'.format(i) '{:.5f}'.format '{:.5f}' format i print(" ".join(['{:.5f}'.format(i) for i in u])) print " ".join(['{:.5f}'.format(i) for i in u]) " ".join " " join ['{:.5f}'.format(i) for i in u] kock(n-1,u,t) kock n-1 n 1 u t '{:.5f}'.format(i) for i in t for i in t i t for i in t '{:.5f}'.format(i) '{:.5f}'.format '{:.5f}' format i print(" ".join(['{:.5f}'.format(i) for i in t])) print " ".join(['{:.5f}'.format(i) for i in t]) " ".join " " join ['{:.5f}'.format(i) for i in t] kock(n-1,t,p2) kock n-1 n 1 t p2 n n p1 p1 p2 p2 n = float(input()) n float(input()) float input() input print("0.00000 0.00000") print "0.00000 0.00000" kock(n, [0,0], [100,0]) kock n [0,0] 0 0 [100,0] 100 0 print("100.00000 0.00000") print "100.00000 0.00000" n = float(input()) float(input()) n def kock(n, p1, p2):
 if n == 0:
  return

 #p1.p2??????s,t,u????¨????
 sx = (2 * p1[0] + 1 * p2[0]) / 3
 sy = (2 * p1[1] + 1 * p2[1]) / 3
 s = [sx, sy]
 tx = (1 * p1[0] + 2 * p2[0]) / 3
 ty = (1 * p1[1] + 2 * p2[1]) / 3
 t = [tx, ty]
 ux = (tx-sx) * math.cos(math.radians(60)) - (ty-sy) * math.sin(math.radians(60)) + sx
 uy = (tx-sx) * math.sin(math.radians(60)) + (ty-sy) * math.cos(math.radians(60)) + sy
 u = [ux, uy]

 kock(n-1,p1,s)
 print(" ".join(['{:.5f}'.format(i) for i in s]))
 kock(n-1,s,u)
 print(" ".join(['{:.5f}'.format(i) for i in u]))
 kock(n-1,u,t)
 print(" ".join(['{:.5f}'.format(i) for i in t]))
 kock(n-1,t,p2) def kock(n, p1, p2):
 if n == 0:
  return

 #p1.p2??????s,t,u????¨????
 sx = (2 * p1[0] + 1 * p2[0]) / 3
 sy = (2 * p1[1] + 1 * p2[1]) / 3
 s = [sx, sy]
 tx = (1 * p1[0] + 2 * p2[0]) / 3
 ty = (1 * p1[1] + 2 * p2[1]) / 3
 t = [tx, ty]
 ux = (tx-sx) * math.cos(math.radians(60)) - (ty-sy) * math.sin(math.radians(60)) + sx
 uy = (tx-sx) * math.sin(math.radians(60)) + (ty-sy) * math.cos(math.radians(60)) + sy
 u = [ux, uy]

 kock(n-1,p1,s)
 print(" ".join(['{:.5f}'.format(i) for i in s]))
 kock(n-1,s,u)
 print(" ".join(['{:.5f}'.format(i) for i in u]))
 kock(n-1,u,t)
 print(" ".join(['{:.5f}'.format(i) for i in t]))
 kock(n-1,t,p2) kock
import math
def kock(n, p1, p2):
 if n == 0:
  return

 #p1.p2??????s,t,u????¨????
 sx = (2 * p1[0] + 1 * p2[0]) / 3
 sy = (2 * p1[1] + 1 * p2[1]) / 3
 s = [sx, sy]
 tx = (1 * p1[0] + 2 * p2[0]) / 3
 ty = (1 * p1[1] + 2 * p2[1]) / 3
 t = [tx, ty]
 ux = (tx-sx) * math.cos(math.radians(60)) - (ty-sy) * math.sin(math.radians(60)) + sx
 uy = (tx-sx) * math.sin(math.radians(60)) + (ty-sy) * math.cos(math.radians(60)) + sy
 u = [ux, uy]

 kock(n-1,p1,s)
 print(" ".join(['{:.5f}'.format(i) for i in s]))
 kock(n-1,s,u)
 print(" ".join(['{:.5f}'.format(i) for i in u]))
 kock(n-1,u,t)
 print(" ".join(['{:.5f}'.format(i) for i in t]))
 kock(n-1,t,p2)

n = float(input())
print("0.00000 0.00000")
kock(n, [0,0], [100,0])
print("100.00000 0.00000")