import math

def koch(n, p1, p2):
    if n == 0:
        return False

    #p1, p2??????s, t, u????¨????
    s = [0 for i in range(2)]
    t = [0 for i in range(2)]
    u = [0 for i in range(2)]
    s[0] = (2*p1[0] + 1*p2[0]) / 3
    s[1] = (2*p1[1] + 1*p2[1]) / 3
    t[0] = (1*p1[0] + 2*p2[0]) / 3
    t[1] = (1*p1[1] + 2*p2[1]) / 3
    u[0] = (t[0]-s[0]) * math.cos(60 * math.pi / 180) - (t[1]-s[1]) * math.sin(60 * math.pi / 180) + s[0]
    u[1] = (t[0]-s[0]) * math.sin(60 * math.pi / 180) + (t[1]-s[1]) * math.cos(60 * math.pi / 180) + 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)

p1 = [0, 0]
p2 = [100,0]
n = int(input())
print("0.00000 0.00000")
koch(n, p1, p2)
print("100.0000 0.0000") import math math def koch(n, p1, p2):
    if n == 0:
        return False

    #p1, p2??????s, t, u????¨????
    s = [0 for i in range(2)]
    t = [0 for i in range(2)]
    u = [0 for i in range(2)]
    s[0] = (2*p1[0] + 1*p2[0]) / 3
    s[1] = (2*p1[1] + 1*p2[1]) / 3
    t[0] = (1*p1[0] + 2*p2[0]) / 3
    t[1] = (1*p1[1] + 2*p2[1]) / 3
    u[0] = (t[0]-s[0]) * math.cos(60 * math.pi / 180) - (t[1]-s[1]) * math.sin(60 * math.pi / 180) + s[0]
    u[1] = (t[0]-s[0]) * math.sin(60 * math.pi / 180) + (t[1]-s[1]) * math.cos(60 * math.pi / 180) + 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 False

    #p1, p2??????s, t, u????¨????
     n == 0 n 0 return False False 0 for i in range(2) for i in range(2) i range(2) range 2 for i in range(2) 0 s = [0 for i in range(2)] s [0 for i in range(2)] 0 for i in range(2) for i in range(2) i range(2) range 2 for i in range(2) 0 t = [0 for i in range(2)] t [0 for i in range(2)] 0 for i in range(2) for i in range(2) i range(2) range 2 for i in range(2) 0 u = [0 for i in range(2)] u [0 for i in range(2)] s[0] = (2*p1[0] + 1*p2[0]) / 3 s[0] s 0 (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 s[1] = (2*p1[1] + 1*p2[1]) / 3 s[1] s 1 (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 t[0] = (1*p1[0] + 2*p2[0]) / 3 t[0] t 0 (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 t[1] = (1*p1[1] + 2*p2[1]) / 3 t[1] t 1 (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 u[0] = (t[0]-s[0]) * math.cos(60 * math.pi / 180) - (t[1]-s[1]) * math.sin(60 * math.pi / 180) + s[0] u[0] u 0 (t[0]-s[0]) * math.cos(60 * math.pi / 180) - (t[1]-s[1]) * math.sin(60 * math.pi / 180) + s[0] (t[0]-s[0]) * math.cos(60 * math.pi / 180) - (t[1]-s[1]) * math.sin(60 * math.pi / 180) (t[0]-s[0]) * math.cos(60 * math.pi / 180) t[0]-s[0] t[0] t 0 s[0] s 0 math.cos(60 * math.pi / 180) math.cos math cos 60 * math.pi / 180 60 * math.pi 60 math.pi math pi 180 (t[1]-s[1]) * math.sin(60 * math.pi / 180) t[1]-s[1] t[1] t 1 s[1] s 1 math.sin(60 * math.pi / 180) math.sin math sin 60 * math.pi / 180 60 * math.pi 60 math.pi math pi 180 s[0] s 0 u[1] = (t[0]-s[0]) * math.sin(60 * math.pi / 180) + (t[1]-s[1]) * math.cos(60 * math.pi / 180) + s[1] u[1] u 1 (t[0]-s[0]) * math.sin(60 * math.pi / 180) + (t[1]-s[1]) * math.cos(60 * math.pi / 180) + s[1] (t[0]-s[0]) * math.sin(60 * math.pi / 180) + (t[1]-s[1]) * math.cos(60 * math.pi / 180) (t[0]-s[0]) * math.sin(60 * math.pi / 180) t[0]-s[0] t[0] t 0 s[0] s 0 math.sin(60 * math.pi / 180) math.sin math sin 60 * math.pi / 180 60 * math.pi 60 math.pi math pi 180 (t[1]-s[1]) * math.cos(60 * math.pi / 180) t[1]-s[1] t[1] t 1 s[1] s 1 math.cos(60 * math.pi / 180) math.cos math cos 60 * math.pi / 180 60 * math.pi 60 math.pi math pi 180 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 p1 = [0, 0] p1 [0, 0] 0 0 p2 = [100,0] p2 [100,0] 100 0 n = int(input()) n int(input()) int input() input print("0.00000 0.00000") print "0.00000 0.00000" koch(n, p1, p2) koch n p1 p2 print("100.0000 0.0000") print "100.0000 0.0000" p2 = [100,0] [100,0] p2 n = int(input()) int(input()) n def koch(n, p1, p2):
    if n == 0:
        return False

    #p1, p2??????s, t, u????¨????
    s = [0 for i in range(2)]
    t = [0 for i in range(2)]
    u = [0 for i in range(2)]
    s[0] = (2*p1[0] + 1*p2[0]) / 3
    s[1] = (2*p1[1] + 1*p2[1]) / 3
    t[0] = (1*p1[0] + 2*p2[0]) / 3
    t[1] = (1*p1[1] + 2*p2[1]) / 3
    u[0] = (t[0]-s[0]) * math.cos(60 * math.pi / 180) - (t[1]-s[1]) * math.sin(60 * math.pi / 180) + s[0]
    u[1] = (t[0]-s[0]) * math.sin(60 * math.pi / 180) + (t[1]-s[1]) * math.cos(60 * math.pi / 180) + 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 False

    #p1, p2??????s, t, u????¨????
    s = [0 for i in range(2)]
    t = [0 for i in range(2)]
    u = [0 for i in range(2)]
    s[0] = (2*p1[0] + 1*p2[0]) / 3
    s[1] = (2*p1[1] + 1*p2[1]) / 3
    t[0] = (1*p1[0] + 2*p2[0]) / 3
    t[1] = (1*p1[1] + 2*p2[1]) / 3
    u[0] = (t[0]-s[0]) * math.cos(60 * math.pi / 180) - (t[1]-s[1]) * math.sin(60 * math.pi / 180) + s[0]
    u[1] = (t[0]-s[0]) * math.sin(60 * math.pi / 180) + (t[1]-s[1]) * math.cos(60 * math.pi / 180) + 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 p1 = [0, 0] [0, 0] p1
import math

def koch(n, p1, p2):
    if n == 0:
        return False

    #p1, p2??????s, t, u????¨????
    s = [0 for i in range(2)]
    t = [0 for i in range(2)]
    u = [0 for i in range(2)]
    s[0] = (2*p1[0] + 1*p2[0]) / 3
    s[1] = (2*p1[1] + 1*p2[1]) / 3
    t[0] = (1*p1[0] + 2*p2[0]) / 3
    t[1] = (1*p1[1] + 2*p2[1]) / 3
    u[0] = (t[0]-s[0]) * math.cos(60 * math.pi / 180) - (t[1]-s[1]) * math.sin(60 * math.pi / 180) + s[0]
    u[1] = (t[0]-s[0]) * math.sin(60 * math.pi / 180) + (t[1]-s[1]) * math.cos(60 * math.pi / 180) + 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)

p1 = [0, 0]
p2 = [100,0]
n = int(input())
print("0.00000 0.00000")
koch(n, p1, p2)
print("100.0000 0.0000")