import math
def kochCurve(d, p1, p2):
    if d <= 0:
        return
    s = [(2.0*p1[0]+1.0*p2[0])/3.0, (2.0*p1[1]+1.0*p2[1])/3.0]
    t = [(1.0*p1[0]+2.0*p2[0])/3.0, (1.0*p1[1]+2.0*p2[1])/3.0]
    u = [(t[0]-s[0])*math.cos(math.radians(60))-(t[1]-s[1])*math.sin(math.radians(60))+s[0], (t[0]-s[0])*math.sin(math.radians(60))+(t[1]-s[1])*math.cos(math.radians(60))+s[1]]
    kochCurve(d-1, p1, s)
    print(s[0], s[1])
    kochCurve(d-1, s, u)
    print(u[0], u[1])
    kochCurve(d-1, u, t)
    print(t[0], t[1])
    kochCurve(d-1, t, p2)
n = int(input())
s = [0.00000000, 0.00000000]
e = [100.00000000, 0.00000000]
print(s[0],s[1])
if n != 0:
    kochCurve(n,s,e)
print(e[0],e[1]) import math math def kochCurve(d, p1, p2):
    if d <= 0:
        return
    s = [(2.0*p1[0]+1.0*p2[0])/3.0, (2.0*p1[1]+1.0*p2[1])/3.0]
    t = [(1.0*p1[0]+2.0*p2[0])/3.0, (1.0*p1[1]+2.0*p2[1])/3.0]
    u = [(t[0]-s[0])*math.cos(math.radians(60))-(t[1]-s[1])*math.sin(math.radians(60))+s[0], (t[0]-s[0])*math.sin(math.radians(60))+(t[1]-s[1])*math.cos(math.radians(60))+s[1]]
    kochCurve(d-1, p1, s)
    print(s[0], s[1])
    kochCurve(d-1, s, u)
    print(u[0], u[1])
    kochCurve(d-1, u, t)
    print(t[0], t[1])
    kochCurve(d-1, t, p2) kochCurve if d <= 0:
        return
     d <= 0 d 0 return s = [(2.0*p1[0]+1.0*p2[0])/3.0, (2.0*p1[1]+1.0*p2[1])/3.0] s [(2.0*p1[0]+1.0*p2[0])/3.0, (2.0*p1[1]+1.0*p2[1])/3.0] (2.0*p1[0]+1.0*p2[0])/3.0 2.0*p1[0]+1.0*p2[0] 2.0*p1[0] 2.0 p1[0] p1 0 1.0*p2[0] 1.0 p2[0] p2 0 3.0 (2.0*p1[1]+1.0*p2[1])/3.0 2.0*p1[1]+1.0*p2[1] 2.0*p1[1] 2.0 p1[1] p1 1 1.0*p2[1] 1.0 p2[1] p2 1 3.0 t = [(1.0*p1[0]+2.0*p2[0])/3.0, (1.0*p1[1]+2.0*p2[1])/3.0] t [(1.0*p1[0]+2.0*p2[0])/3.0, (1.0*p1[1]+2.0*p2[1])/3.0] (1.0*p1[0]+2.0*p2[0])/3.0 1.0*p1[0]+2.0*p2[0] 1.0*p1[0] 1.0 p1[0] p1 0 2.0*p2[0] 2.0 p2[0] p2 0 3.0 (1.0*p1[1]+2.0*p2[1])/3.0 1.0*p1[1]+2.0*p2[1] 1.0*p1[1] 1.0 p1[1] p1 1 2.0*p2[1] 2.0 p2[1] p2 1 3.0 u = [(t[0]-s[0])*math.cos(math.radians(60))-(t[1]-s[1])*math.sin(math.radians(60))+s[0], (t[0]-s[0])*math.sin(math.radians(60))+(t[1]-s[1])*math.cos(math.radians(60))+s[1]] u [(t[0]-s[0])*math.cos(math.radians(60))-(t[1]-s[1])*math.sin(math.radians(60))+s[0], (t[0]-s[0])*math.sin(math.radians(60))+(t[1]-s[1])*math.cos(math.radians(60))+s[1]] (t[0]-s[0])*math.cos(math.radians(60))-(t[1]-s[1])*math.sin(math.radians(60))+s[0] (t[0]-s[0])*math.cos(math.radians(60))-(t[1]-s[1])*math.sin(math.radians(60)) (t[0]-s[0])*math.cos(math.radians(60)) t[0]-s[0] t[0] t 0 s[0] s 0 math.cos(math.radians(60)) math.cos math cos math.radians(60) math.radians math radians 60 (t[1]-s[1])*math.sin(math.radians(60)) t[1]-s[1] t[1] t 1 s[1] s 1 math.sin(math.radians(60)) math.sin math sin math.radians(60) math.radians math radians 60 s[0] s 0 (t[0]-s[0])*math.sin(math.radians(60))+(t[1]-s[1])*math.cos(math.radians(60))+s[1] (t[0]-s[0])*math.sin(math.radians(60))+(t[1]-s[1])*math.cos(math.radians(60)) (t[0]-s[0])*math.sin(math.radians(60)) t[0]-s[0] t[0] t 0 s[0] s 0 math.sin(math.radians(60)) math.sin math sin math.radians(60) math.radians math radians 60 (t[1]-s[1])*math.cos(math.radians(60)) t[1]-s[1] t[1] t 1 s[1] s 1 math.cos(math.radians(60)) math.cos math cos math.radians(60) math.radians math radians 60 s[1] s 1 kochCurve(d-1, p1, s) kochCurve d-1 d 1 p1 s print(s[0], s[1]) print s[0] s 0 s[1] s 1 kochCurve(d-1, s, u) kochCurve d-1 d 1 s u print(u[0], u[1]) print u[0] u 0 u[1] u 1 kochCurve(d-1, u, t) kochCurve d-1 d 1 u t print(t[0], t[1]) print t[0] t 0 t[1] t 1 kochCurve(d-1, t, p2) kochCurve d-1 d 1 t p2 d d p1 p1 p2 p2 n = int(input()) n int(input()) int input() input s = [0.00000000, 0.00000000] s [0.00000000, 0.00000000] 0.00000000 0.00000000 e = [100.00000000, 0.00000000] e [100.00000000, 0.00000000] 100.00000000 0.00000000 print(s[0],s[1]) print s[0] s 0 s[1] s 1 if n != 0:
    kochCurve(n,s,e) n != 0 n 0 kochCurve(n,s,e) kochCurve n s e print(e[0],e[1]) print e[0] e 0 e[1] e 1 def kochCurve(d, p1, p2):
    if d <= 0:
        return
    s = [(2.0*p1[0]+1.0*p2[0])/3.0, (2.0*p1[1]+1.0*p2[1])/3.0]
    t = [(1.0*p1[0]+2.0*p2[0])/3.0, (1.0*p1[1]+2.0*p2[1])/3.0]
    u = [(t[0]-s[0])*math.cos(math.radians(60))-(t[1]-s[1])*math.sin(math.radians(60))+s[0], (t[0]-s[0])*math.sin(math.radians(60))+(t[1]-s[1])*math.cos(math.radians(60))+s[1]]
    kochCurve(d-1, p1, s)
    print(s[0], s[1])
    kochCurve(d-1, s, u)
    print(u[0], u[1])
    kochCurve(d-1, u, t)
    print(t[0], t[1])
    kochCurve(d-1, t, p2) def kochCurve(d, p1, p2):
    if d <= 0:
        return
    s = [(2.0*p1[0]+1.0*p2[0])/3.0, (2.0*p1[1]+1.0*p2[1])/3.0]
    t = [(1.0*p1[0]+2.0*p2[0])/3.0, (1.0*p1[1]+2.0*p2[1])/3.0]
    u = [(t[0]-s[0])*math.cos(math.radians(60))-(t[1]-s[1])*math.sin(math.radians(60))+s[0], (t[0]-s[0])*math.sin(math.radians(60))+(t[1]-s[1])*math.cos(math.radians(60))+s[1]]
    kochCurve(d-1, p1, s)
    print(s[0], s[1])
    kochCurve(d-1, s, u)
    print(u[0], u[1])
    kochCurve(d-1, u, t)
    print(t[0], t[1])
    kochCurve(d-1, t, p2) kochCurve s = [0.00000000, 0.00000000] [0.00000000, 0.00000000] s n = int(input()) int(input()) n e = [100.00000000, 0.00000000] [100.00000000, 0.00000000] e
import math
def kochCurve(d, p1, p2):
    if d <= 0:
        return
    s = [(2.0*p1[0]+1.0*p2[0])/3.0, (2.0*p1[1]+1.0*p2[1])/3.0]
    t = [(1.0*p1[0]+2.0*p2[0])/3.0, (1.0*p1[1]+2.0*p2[1])/3.0]
    u = [(t[0]-s[0])*math.cos(math.radians(60))-(t[1]-s[1])*math.sin(math.radians(60))+s[0], (t[0]-s[0])*math.sin(math.radians(60))+(t[1]-s[1])*math.cos(math.radians(60))+s[1]]
    kochCurve(d-1, p1, s)
    print(s[0], s[1])
    kochCurve(d-1, s, u)
    print(u[0], u[1])
    kochCurve(d-1, u, t)
    print(t[0], t[1])
    kochCurve(d-1, t, p2)
n = int(input())
s = [0.00000000, 0.00000000]
e = [100.00000000, 0.00000000]
print(s[0],s[1])
if n != 0:
    kochCurve(n,s,e)
print(e[0],e[1])
