import math

def kochCurve(p1, p2, n):
  if n == 0:
    print(p2[0], p2[1])
    return

  v = [(p2[0]-p1[0])/3, (p2[1]-p1[1])/3]
  s = [p1[0]+v[0], p1[1]+v[1]]
  t = [s[0]+v[0], s[1]+v[1]]

  theta = math.atan2(v[1], v[0]) + math.pi/2

  a = math.sqrt((t[0]-s[0])**2+(t[1]-s[1])**2)
  h = 3**(1/2)*a/2
  u = [s[0]+(t[0]-s[0])/2+h*math.cos(theta), s[1]+(t[1]-s[1])/2+h*math.sin(theta)]

  n -= 1
  kochCurve(p1, s, n)
  kochCurve(s, u, n)
  kochCurve(u, t, n)
  kochCurve(t, p2, n)

if __name__ == "__main__":
  n = int(input())
  print(0, 0)
  kochCurve([0, 0], [100, 0], n) import math math def kochCurve(p1, p2, n):
  if n == 0:
    print(p2[0], p2[1])
    return

  v = [(p2[0]-p1[0])/3, (p2[1]-p1[1])/3]
  s = [p1[0]+v[0], p1[1]+v[1]]
  t = [s[0]+v[0], s[1]+v[1]]

  theta = math.atan2(v[1], v[0]) + math.pi/2

  a = math.sqrt((t[0]-s[0])**2+(t[1]-s[1])**2)
  h = 3**(1/2)*a/2
  u = [s[0]+(t[0]-s[0])/2+h*math.cos(theta), s[1]+(t[1]-s[1])/2+h*math.sin(theta)]

  n -= 1
  kochCurve(p1, s, n)
  kochCurve(s, u, n)
  kochCurve(u, t, n)
  kochCurve(t, p2, n) kochCurve if n == 0:
    print(p2[0], p2[1])
    return

   n == 0 n 0 print(p2[0], p2[1]) print p2[0] p2 0 p2[1] p2 1 return v = [(p2[0]-p1[0])/3, (p2[1]-p1[1])/3] v [(p2[0]-p1[0])/3, (p2[1]-p1[1])/3] (p2[0]-p1[0])/3 p2[0]-p1[0] p2[0] p2 0 p1[0] p1 0 3 (p2[1]-p1[1])/3 p2[1]-p1[1] p2[1] p2 1 p1[1] p1 1 3 s = [p1[0]+v[0], p1[1]+v[1]] s [p1[0]+v[0], p1[1]+v[1]] p1[0]+v[0] p1[0] p1 0 v[0] v 0 p1[1]+v[1] p1[1] p1 1 v[1] v 1 t = [s[0]+v[0], s[1]+v[1]] t [s[0]+v[0], s[1]+v[1]] s[0]+v[0] s[0] s 0 v[0] v 0 s[1]+v[1] s[1] s 1 v[1] v 1 theta = math.atan2(v[1], v[0]) + math.pi/2 theta math.atan2(v[1], v[0]) + math.pi/2 math.atan2(v[1], v[0]) math.atan2 math atan2 v[1] v 1 v[0] v 0 math.pi/2 math.pi math pi 2 a = math.sqrt((t[0]-s[0])**2+(t[1]-s[1])**2) a math.sqrt((t[0]-s[0])**2+(t[1]-s[1])**2) math.sqrt math sqrt (t[0]-s[0])**2+(t[1]-s[1])**2 (t[0]-s[0])**2 t[0]-s[0] t[0] t 0 s[0] s 0 2 (t[1]-s[1])**2 t[1]-s[1] t[1] t 1 s[1] s 1 2 h = 3**(1/2)*a/2 h 3**(1/2)*a/2 3**(1/2)*a 3**(1/2) 3 1/2 1 2 a 2 u = [s[0]+(t[0]-s[0])/2+h*math.cos(theta), s[1]+(t[1]-s[1])/2+h*math.sin(theta)] u [s[0]+(t[0]-s[0])/2+h*math.cos(theta), s[1]+(t[1]-s[1])/2+h*math.sin(theta)] s[0]+(t[0]-s[0])/2+h*math.cos(theta) s[0]+(t[0]-s[0])/2 s[0] s 0 (t[0]-s[0])/2 t[0]-s[0] t[0] t 0 s[0] s 0 2 h*math.cos(theta) h math.cos(theta) math.cos math cos theta s[1]+(t[1]-s[1])/2+h*math.sin(theta) s[1]+(t[1]-s[1])/2 s[1] s 1 (t[1]-s[1])/2 t[1]-s[1] t[1] t 1 s[1] s 1 2 h*math.sin(theta) h math.sin(theta) math.sin math sin theta n -= 1 n 1 kochCurve(p1, s, n) kochCurve p1 s n kochCurve(s, u, n) kochCurve s u n kochCurve(u, t, n) kochCurve u t n kochCurve(t, p2, n) kochCurve t p2 n p1 p1 p2 p2 n n if __name__ == "__main__":
  n = int(input())
  print(0, 0)
  kochCurve([0, 0], [100, 0], n) __name__ == "__main__" __name__ "__main__" n = int(input()) n int(input()) int input() input print(0, 0) print 0 0 kochCurve([0, 0], [100, 0], n) kochCurve [0, 0] 0 0 [100, 0] 100 0 n n = int(input()) int(input()) n def kochCurve(p1, p2, n):
  if n == 0:
    print(p2[0], p2[1])
    return

  v = [(p2[0]-p1[0])/3, (p2[1]-p1[1])/3]
  s = [p1[0]+v[0], p1[1]+v[1]]
  t = [s[0]+v[0], s[1]+v[1]]

  theta = math.atan2(v[1], v[0]) + math.pi/2

  a = math.sqrt((t[0]-s[0])**2+(t[1]-s[1])**2)
  h = 3**(1/2)*a/2
  u = [s[0]+(t[0]-s[0])/2+h*math.cos(theta), s[1]+(t[1]-s[1])/2+h*math.sin(theta)]

  n -= 1
  kochCurve(p1, s, n)
  kochCurve(s, u, n)
  kochCurve(u, t, n)
  kochCurve(t, p2, n) def kochCurve(p1, p2, n):
  if n == 0:
    print(p2[0], p2[1])
    return

  v = [(p2[0]-p1[0])/3, (p2[1]-p1[1])/3]
  s = [p1[0]+v[0], p1[1]+v[1]]
  t = [s[0]+v[0], s[1]+v[1]]

  theta = math.atan2(v[1], v[0]) + math.pi/2

  a = math.sqrt((t[0]-s[0])**2+(t[1]-s[1])**2)
  h = 3**(1/2)*a/2
  u = [s[0]+(t[0]-s[0])/2+h*math.cos(theta), s[1]+(t[1]-s[1])/2+h*math.sin(theta)]

  n -= 1
  kochCurve(p1, s, n)
  kochCurve(s, u, n)
  kochCurve(u, t, n)
  kochCurve(t, p2, n) kochCurve
import math

def kochCurve(p1, p2, n):
  if n == 0:
    print(p2[0], p2[1])
    return

  v = [(p2[0]-p1[0])/3, (p2[1]-p1[1])/3]
  s = [p1[0]+v[0], p1[1]+v[1]]
  t = [s[0]+v[0], s[1]+v[1]]

  theta = math.atan2(v[1], v[0]) + math.pi/2

  a = math.sqrt((t[0]-s[0])**2+(t[1]-s[1])**2)
  h = 3**(1/2)*a/2
  u = [s[0]+(t[0]-s[0])/2+h*math.cos(theta), s[1]+(t[1]-s[1])/2+h*math.sin(theta)]

  n -= 1
  kochCurve(p1, s, n)
  kochCurve(s, u, n)
  kochCurve(u, t, n)
  kochCurve(t, p2, n)

if __name__ == "__main__":
  n = int(input())
  print(0, 0)
  kochCurve([0, 0], [100, 0], n)