import math

pi = math.pi

n = int(input())
p1 = [0,0]
p2 = [100,0]

def koch(n, p1, p2):
    if n == 0:
        return
    s = [(2*p1[0]+p2[0])/3.0,(2*p1[1]+p2[1])/3.0]
    t = [(1*p1[0]+2*p2[0])/3.0,(p1[1]+2*p2[1])/3.0]
    u = [(t[0]-s[0])*math.cos(pi/3) - (t[1]-s[1])*math.sin(pi/3) + s[0], 
         (t[0]-s[0])*math.sin(pi/3) + (t[1]-s[1])*math.cos(pi/3) + s[1]]
         

    koch(n - 1, p1, s)
    print(*s)
    koch(n - 1, s, u)
    print(*u)
    koch(n - 1, u, t)
    print(*t)
    koch(n - 1, t, p2)

print(*p1)
koch(n, p1, p2)
print(*p2) import math math pi = math.pi pi math.pi math pi n = int(input()) n int(input()) int input() input p1 = [0,0] p1 [0,0] 0 0 p2 = [100,0] p2 [100,0] 100 0 def koch(n, p1, p2):
    if n == 0:
        return
    s = [(2*p1[0]+p2[0])/3.0,(2*p1[1]+p2[1])/3.0]
    t = [(1*p1[0]+2*p2[0])/3.0,(p1[1]+2*p2[1])/3.0]
    u = [(t[0]-s[0])*math.cos(pi/3) - (t[1]-s[1])*math.sin(pi/3) + s[0], 
         (t[0]-s[0])*math.sin(pi/3) + (t[1]-s[1])*math.cos(pi/3) + s[1]]
         

    koch(n - 1, p1, s)
    print(*s)
    koch(n - 1, s, u)
    print(*u)
    koch(n - 1, u, t)
    print(*t)
    koch(n - 1, t, p2) koch if n == 0:
        return
     n == 0 n 0 return s = [(2*p1[0]+p2[0])/3.0,(2*p1[1]+p2[1])/3.0] s [(2*p1[0]+p2[0])/3.0,(2*p1[1]+p2[1])/3.0] (2*p1[0]+p2[0])/3.0 2*p1[0]+p2[0] 2*p1[0] 2 p1[0] p1 0 p2[0] p2 0 3.0 (2*p1[1]+p2[1])/3.0 2*p1[1]+p2[1] 2*p1[1] 2 p1[1] p1 1 p2[1] p2 1 3.0 t = [(1*p1[0]+2*p2[0])/3.0,(p1[1]+2*p2[1])/3.0] t [(1*p1[0]+2*p2[0])/3.0,(p1[1]+2*p2[1])/3.0] (1*p1[0]+2*p2[0])/3.0 1*p1[0]+2*p2[0] 1*p1[0] 1 p1[0] p1 0 2*p2[0] 2 p2[0] p2 0 3.0 (p1[1]+2*p2[1])/3.0 p1[1]+2*p2[1] p1[1] p1 1 2*p2[1] 2 p2[1] p2 1 3.0 u = [(t[0]-s[0])*math.cos(pi/3) - (t[1]-s[1])*math.sin(pi/3) + s[0], 
         (t[0]-s[0])*math.sin(pi/3) + (t[1]-s[1])*math.cos(pi/3) + s[1]] u [(t[0]-s[0])*math.cos(pi/3) - (t[1]-s[1])*math.sin(pi/3) + s[0], 
         (t[0]-s[0])*math.sin(pi/3) + (t[1]-s[1])*math.cos(pi/3) + s[1]] (t[0]-s[0])*math.cos(pi/3) - (t[1]-s[1])*math.sin(pi/3) + s[0] (t[0]-s[0])*math.cos(pi/3) - (t[1]-s[1])*math.sin(pi/3) (t[0]-s[0])*math.cos(pi/3) t[0]-s[0] t[0] t 0 s[0] s 0 math.cos(pi/3) math.cos math cos pi/3 pi 3 (t[1]-s[1])*math.sin(pi/3) t[1]-s[1] t[1] t 1 s[1] s 1 math.sin(pi/3) math.sin math sin pi/3 pi 3 s[0] s 0 (t[0]-s[0])*math.sin(pi/3) + (t[1]-s[1])*math.cos(pi/3) + s[1] (t[0]-s[0])*math.sin(pi/3) + (t[1]-s[1])*math.cos(pi/3) (t[0]-s[0])*math.sin(pi/3) t[0]-s[0] t[0] t 0 s[0] s 0 math.sin(pi/3) math.sin math sin pi/3 pi 3 (t[1]-s[1])*math.cos(pi/3) t[1]-s[1] t[1] t 1 s[1] s 1 math.cos(pi/3) math.cos math cos pi/3 pi 3 s[1] s 1 koch(n - 1, p1, s) koch n - 1 n 1 p1 s print(*s) print *s s koch(n - 1, s, u) koch n - 1 n 1 s u print(*u) print *u u koch(n - 1, u, t) koch n - 1 n 1 u t print(*t) print *t t koch(n - 1, t, p2) koch n - 1 n 1 t p2 n n p1 p1 p2 p2 print(*p1) print *p1 p1 koch(n, p1, p2) koch n p1 p2 print(*p2) print *p2 p2 p2 = [100,0] [100,0] p2 pi = math.pi math.pi pi def koch(n, p1, p2):
    if n == 0:
        return
    s = [(2*p1[0]+p2[0])/3.0,(2*p1[1]+p2[1])/3.0]
    t = [(1*p1[0]+2*p2[0])/3.0,(p1[1]+2*p2[1])/3.0]
    u = [(t[0]-s[0])*math.cos(pi/3) - (t[1]-s[1])*math.sin(pi/3) + s[0], 
         (t[0]-s[0])*math.sin(pi/3) + (t[1]-s[1])*math.cos(pi/3) + s[1]]
         

    koch(n - 1, p1, s)
    print(*s)
    koch(n - 1, s, u)
    print(*u)
    koch(n - 1, u, t)
    print(*t)
    koch(n - 1, t, p2) def koch(n, p1, p2):
    if n == 0:
        return
    s = [(2*p1[0]+p2[0])/3.0,(2*p1[1]+p2[1])/3.0]
    t = [(1*p1[0]+2*p2[0])/3.0,(p1[1]+2*p2[1])/3.0]
    u = [(t[0]-s[0])*math.cos(pi/3) - (t[1]-s[1])*math.sin(pi/3) + s[0], 
         (t[0]-s[0])*math.sin(pi/3) + (t[1]-s[1])*math.cos(pi/3) + s[1]]
         

    koch(n - 1, p1, s)
    print(*s)
    koch(n - 1, s, u)
    print(*u)
    koch(n - 1, u, t)
    print(*t)
    koch(n - 1, t, p2) koch n = int(input()) int(input()) n p1 = [0,0] [0,0] p1
import math

pi = math.pi

n = int(input())
p1 = [0,0]
p2 = [100,0]

def koch(n, p1, p2):
    if n == 0:
        return
    s = [(2*p1[0]+p2[0])/3.0,(2*p1[1]+p2[1])/3.0]
    t = [(1*p1[0]+2*p2[0])/3.0,(p1[1]+2*p2[1])/3.0]
    u = [(t[0]-s[0])*math.cos(pi/3) - (t[1]-s[1])*math.sin(pi/3) + s[0], 
         (t[0]-s[0])*math.sin(pi/3) + (t[1]-s[1])*math.cos(pi/3) + s[1]]
         

    koch(n - 1, p1, s)
    print(*s)
    koch(n - 1, s, u)
    print(*u)
    koch(n - 1, u, t)
    print(*t)
    koch(n - 1, t, p2)

print(*p1)
koch(n, p1, p2)
print(*p2)