import math

def koch_kurve(n, p1=[0, 0], p2=[100, 0]):
  if n == 0: return

  s, t, u = make_edge_list(p1, p2)

  koch_kurve(n-1, p1, s)
  # print(s)
  # print(s)
  print(" ".join([ str(i) for i in s ]))
  koch_kurve(n-1, s, u)
  print(" ".join([ str(i) for i in u ]))
  koch_kurve(n-1, u, t)
  print(" ".join([ str(i) for i in t ]))
  koch_kurve(n-1, t, p2)


def make_edge_list(p1, p2):
  sx = 2 / 3 * p1[0] + 1 / 3 * p2[0]
  sy = 2 / 3 * p1[1] + 1 / 3 * p2[1]
  # s = (sx, sy)
  s = [sx, sy]

  tx = 1 / 3 * p1[0] + 2 / 3 * p2[0]
  ty = 1 / 3 * p1[1] + 2 / 3 * p2[1]
  t = [tx, ty]

  theta = math.radians(60)
  ux = math.cos(theta) * (tx - sx) - math.sin(theta) * (ty - sy) + sx
  uy = math.sin(theta) * (tx - sx) + math.cos(theta) * (ty - sy) + sy
  u = [ux, uy]

  return s, t, u

n = int(input())
print("0 0")
koch_kurve(n)
print("100 0")

 import math math def koch_kurve(n, p1=[0, 0], p2=[100, 0]):
  if n == 0: return

  s, t, u = make_edge_list(p1, p2)

  koch_kurve(n-1, p1, s)
  # print(s)
  # print(s)
  print(" ".join([ str(i) for i in s ]))
  koch_kurve(n-1, s, u)
  print(" ".join([ str(i) for i in u ]))
  koch_kurve(n-1, u, t)
  print(" ".join([ str(i) for i in t ]))
  koch_kurve(n-1, t, p2) koch_kurve if n == 0: return

   n == 0 n 0 s, t, u = make_edge_list(p1, p2) s make_edge_list(p1, p2) make_edge_list p1 p2 t u koch_kurve(n-1, p1, s) koch_kurve n-1 n 1 p1 s str(i) for i in s for i in s i s for i in s str(i) str i print(" ".join([ str(i) for i in s ])) print " ".join([ str(i) for i in s ]) " ".join " " join [ str(i) for i in s ] koch_kurve(n-1, s, u) koch_kurve n-1 n 1 s u str(i) for i in u for i in u i u for i in u str(i) str i print(" ".join([ str(i) for i in u ])) print " ".join([ str(i) for i in u ]) " ".join " " join [ str(i) for i in u ] koch_kurve(n-1, u, t) koch_kurve n-1 n 1 u t str(i) for i in t for i in t i t for i in t str(i) str i print(" ".join([ str(i) for i in t ])) print " ".join([ str(i) for i in t ]) " ".join " " join [ str(i) for i in t ] koch_kurve(n-1, t, p2) koch_kurve n-1 n 1 t p2 n n p1=[0, 0] p1 [0, 0] 0 0 p2=[100, 0] p2 [100, 0] 100 0 def make_edge_list(p1, p2):
  sx = 2 / 3 * p1[0] + 1 / 3 * p2[0]
  sy = 2 / 3 * p1[1] + 1 / 3 * p2[1]
  # s = (sx, sy)
  s = [sx, sy]

  tx = 1 / 3 * p1[0] + 2 / 3 * p2[0]
  ty = 1 / 3 * p1[1] + 2 / 3 * p2[1]
  t = [tx, ty]

  theta = math.radians(60)
  ux = math.cos(theta) * (tx - sx) - math.sin(theta) * (ty - sy) + sx
  uy = math.sin(theta) * (tx - sx) + math.cos(theta) * (ty - sy) + sy
  u = [ux, uy]

  return s, t, u make_edge_list sx = 2 / 3 * p1[0] + 1 / 3 * p2[0] sx 2 / 3 * p1[0] + 1 / 3 * p2[0] 2 / 3 * p1[0] 2 / 3 2 3 p1[0] p1 0 1 / 3 * p2[0] 1 / 3 1 3 p2[0] p2 0 sy = 2 / 3 * p1[1] + 1 / 3 * p2[1] sy 2 / 3 * p1[1] + 1 / 3 * p2[1] 2 / 3 * p1[1] 2 / 3 2 3 p1[1] p1 1 1 / 3 * p2[1] 1 / 3 1 3 p2[1] p2 1 s = [sx, sy] s [sx, sy] sx sy tx = 1 / 3 * p1[0] + 2 / 3 * p2[0] tx 1 / 3 * p1[0] + 2 / 3 * p2[0] 1 / 3 * p1[0] 1 / 3 1 3 p1[0] p1 0 2 / 3 * p2[0] 2 / 3 2 3 p2[0] p2 0 ty = 1 / 3 * p1[1] + 2 / 3 * p2[1] ty 1 / 3 * p1[1] + 2 / 3 * p2[1] 1 / 3 * p1[1] 1 / 3 1 3 p1[1] p1 1 2 / 3 * p2[1] 2 / 3 2 3 p2[1] p2 1 t = [tx, ty] t [tx, ty] tx ty theta = math.radians(60) theta math.radians(60) math.radians math radians 60 ux = math.cos(theta) * (tx - sx) - math.sin(theta) * (ty - sy) + sx ux math.cos(theta) * (tx - sx) - math.sin(theta) * (ty - sy) + sx math.cos(theta) * (tx - sx) - math.sin(theta) * (ty - sy) math.cos(theta) * (tx - sx) math.cos(theta) math.cos math cos theta tx - sx tx sx math.sin(theta) * (ty - sy) math.sin(theta) math.sin math sin theta ty - sy ty sy sx uy = math.sin(theta) * (tx - sx) + math.cos(theta) * (ty - sy) + sy uy math.sin(theta) * (tx - sx) + math.cos(theta) * (ty - sy) + sy math.sin(theta) * (tx - sx) + math.cos(theta) * (ty - sy) math.sin(theta) * (tx - sx) math.sin(theta) math.sin math sin theta tx - sx tx sx math.cos(theta) * (ty - sy) math.cos(theta) math.cos math cos theta ty - sy ty sy sy u = [ux, uy] u [ux, uy] ux uy return s, t, u return s, t, u s t u p1 p1 p2 p2 n = int(input()) n int(input()) int input() input print("0 0") print "0 0" koch_kurve(n) koch_kurve n print("100 0") print "100 0" def make_edge_list(p1, p2):
  sx = 2 / 3 * p1[0] + 1 / 3 * p2[0]
  sy = 2 / 3 * p1[1] + 1 / 3 * p2[1]
  # s = (sx, sy)
  s = [sx, sy]

  tx = 1 / 3 * p1[0] + 2 / 3 * p2[0]
  ty = 1 / 3 * p1[1] + 2 / 3 * p2[1]
  t = [tx, ty]

  theta = math.radians(60)
  ux = math.cos(theta) * (tx - sx) - math.sin(theta) * (ty - sy) + sx
  uy = math.sin(theta) * (tx - sx) + math.cos(theta) * (ty - sy) + sy
  u = [ux, uy]

  return s, t, u def make_edge_list(p1, p2):
  sx = 2 / 3 * p1[0] + 1 / 3 * p2[0]
  sy = 2 / 3 * p1[1] + 1 / 3 * p2[1]
  # s = (sx, sy)
  s = [sx, sy]

  tx = 1 / 3 * p1[0] + 2 / 3 * p2[0]
  ty = 1 / 3 * p1[1] + 2 / 3 * p2[1]
  t = [tx, ty]

  theta = math.radians(60)
  ux = math.cos(theta) * (tx - sx) - math.sin(theta) * (ty - sy) + sx
  uy = math.sin(theta) * (tx - sx) + math.cos(theta) * (ty - sy) + sy
  u = [ux, uy]

  return s, t, u make_edge_list n = int(input()) int(input()) n def koch_kurve(n, p1=[0, 0], p2=[100, 0]):
  if n == 0: return

  s, t, u = make_edge_list(p1, p2)

  koch_kurve(n-1, p1, s)
  # print(s)
  # print(s)
  print(" ".join([ str(i) for i in s ]))
  koch_kurve(n-1, s, u)
  print(" ".join([ str(i) for i in u ]))
  koch_kurve(n-1, u, t)
  print(" ".join([ str(i) for i in t ]))
  koch_kurve(n-1, t, p2) def koch_kurve(n, p1=[0, 0], p2=[100, 0]):
  if n == 0: return

  s, t, u = make_edge_list(p1, p2)

  koch_kurve(n-1, p1, s)
  # print(s)
  # print(s)
  print(" ".join([ str(i) for i in s ]))
  koch_kurve(n-1, s, u)
  print(" ".join([ str(i) for i in u ]))
  koch_kurve(n-1, u, t)
  print(" ".join([ str(i) for i in t ]))
  koch_kurve(n-1, t, p2) koch_kurve
import math

def koch_kurve(n, p1=[0, 0], p2=[100, 0]):
  if n == 0: return

  s, t, u = make_edge_list(p1, p2)

  koch_kurve(n-1, p1, s)
  # print(s)
  # print(s)
  print(" ".join([ str(i) for i in s ]))
  koch_kurve(n-1, s, u)
  print(" ".join([ str(i) for i in u ]))
  koch_kurve(n-1, u, t)
  print(" ".join([ str(i) for i in t ]))
  koch_kurve(n-1, t, p2)


def make_edge_list(p1, p2):
  sx = 2 / 3 * p1[0] + 1 / 3 * p2[0]
  sy = 2 / 3 * p1[1] + 1 / 3 * p2[1]
  # s = (sx, sy)
  s = [sx, sy]

  tx = 1 / 3 * p1[0] + 2 / 3 * p2[0]
  ty = 1 / 3 * p1[1] + 2 / 3 * p2[1]
  t = [tx, ty]

  theta = math.radians(60)
  ux = math.cos(theta) * (tx - sx) - math.sin(theta) * (ty - sy) + sx
  uy = math.sin(theta) * (tx - sx) + math.cos(theta) * (ty - sy) + sy
  u = [ux, uy]

  return s, t, u

n = int(input())
print("0 0")
koch_kurve(n)
print("100 0")


