import math

def main():
    n = input()

    p1 = [0., 0.]
    p2 = [100., 0.]
    a = [p1,p2]
    a = rec(a,n)

    for item in a:
        print item[0], item[1]
    
def rec(a,n):
    if n == 0:
        return a
    else:
        n -= 1
        b = []
        for i in range(len(a)-1):
            p1 = a[i]
            p2 = a[i+1]
            b += koch(p1,p2)
        b.append(a[-1])
        return rec(b,n)

def koch(p1,p2):
    s  = [p1[0]+(p2[0]-p1[0])/3.,    p1[1]+(p2[1]-p1[1])/3.]
    t  = [p1[0]+2.*(p2[0]-p1[0])/3., p1[1]+2.*(p2[1]-p1[1])/3.]
    st = [t[0]-s[0],t[1]-s[1]]
    u  = [s[0]+(st[0]-math.sqrt(3)*st[1])/2., s[1]+(math.sqrt(3)*st[0]+st[1])/2.]
    return [p1,s,u,t]
    
if __name__ == "__main__":
    main() import math math def main():
    n = input()

    p1 = [0., 0.]
    p2 = [100., 0.]
    a = [p1,p2]
    a = rec(a,n)

    for item in a:
        print item[0], item[1]
     main n = input() n input() input p1 = [0., 0.] p1 [0., 0.] 0. 0. p2 = [100., 0.] p2 [100., 0.] 100. 0. a = [p1,p2] a [p1,p2] p1 p2 a = rec(a,n) a rec(a,n) rec a n for item in a:
        print item[0], item[1]
     item a print item[0] item 0 item[1] item 1 def rec(a,n):
    if n == 0:
        return a
    else:
        n -= 1
        b = []
        for i in range(len(a)-1):
            p1 = a[i]
            p2 = a[i+1]
            b += koch(p1,p2)
        b.append(a[-1])
        return rec(b,n) rec if n == 0:
        return a
    else:
        n -= 1
        b = []
        for i in range(len(a)-1):
            p1 = a[i]
            p2 = a[i+1]
            b += koch(p1,p2)
        b.append(a[-1])
        return rec(b,n) n == 0 n 0 return a a n -= 1 n 1 b = [] b [] for i in range(len(a)-1):
            p1 = a[i]
            p2 = a[i+1]
            b += koch(p1,p2)
         i range(len(a)-1) range len(a)-1 len(a) len a 1 p1 = a[i] p1 a[i] a i p2 = a[i+1] p2 a[i+1] a i+1 i 1 b += koch(p1,p2) b koch(p1,p2) koch p1 p2 b.append(a[-1]) b.append b append a[-1] a -1 return rec(b,n) rec(b,n) rec b n a a n n def koch(p1,p2):
    s  = [p1[0]+(p2[0]-p1[0])/3.,    p1[1]+(p2[1]-p1[1])/3.]
    t  = [p1[0]+2.*(p2[0]-p1[0])/3., p1[1]+2.*(p2[1]-p1[1])/3.]
    st = [t[0]-s[0],t[1]-s[1]]
    u  = [s[0]+(st[0]-math.sqrt(3)*st[1])/2., s[1]+(math.sqrt(3)*st[0]+st[1])/2.]
    return [p1,s,u,t]
     koch s  = [p1[0]+(p2[0]-p1[0])/3.,    p1[1]+(p2[1]-p1[1])/3.] s [p1[0]+(p2[0]-p1[0])/3.,    p1[1]+(p2[1]-p1[1])/3.] p1[0]+(p2[0]-p1[0])/3. p1[0] p1 0 (p2[0]-p1[0])/3. p2[0]-p1[0] p2[0] p2 0 p1[0] p1 0 3. p1[1]+(p2[1]-p1[1])/3. p1[1] p1 1 (p2[1]-p1[1])/3. p2[1]-p1[1] p2[1] p2 1 p1[1] p1 1 3. t  = [p1[0]+2.*(p2[0]-p1[0])/3., p1[1]+2.*(p2[1]-p1[1])/3.] t [p1[0]+2.*(p2[0]-p1[0])/3., p1[1]+2.*(p2[1]-p1[1])/3.] p1[0]+2.*(p2[0]-p1[0])/3. p1[0] p1 0 2.*(p2[0]-p1[0])/3. 2.*(p2[0]-p1[0]) 2. p2[0]-p1[0] p2[0] p2 0 p1[0] p1 0 3. p1[1]+2.*(p2[1]-p1[1])/3. p1[1] p1 1 2.*(p2[1]-p1[1])/3. 2.*(p2[1]-p1[1]) 2. p2[1]-p1[1] p2[1] p2 1 p1[1] p1 1 3. st = [t[0]-s[0],t[1]-s[1]] st [t[0]-s[0],t[1]-s[1]] t[0]-s[0] t[0] t 0 s[0] s 0 t[1]-s[1] t[1] t 1 s[1] s 1 u  = [s[0]+(st[0]-math.sqrt(3)*st[1])/2., s[1]+(math.sqrt(3)*st[0]+st[1])/2.] u [s[0]+(st[0]-math.sqrt(3)*st[1])/2., s[1]+(math.sqrt(3)*st[0]+st[1])/2.] s[0]+(st[0]-math.sqrt(3)*st[1])/2. s[0] s 0 (st[0]-math.sqrt(3)*st[1])/2. st[0]-math.sqrt(3)*st[1] st[0] st 0 math.sqrt(3)*st[1] math.sqrt(3) math.sqrt math sqrt 3 st[1] st 1 2. s[1]+(math.sqrt(3)*st[0]+st[1])/2. s[1] s 1 (math.sqrt(3)*st[0]+st[1])/2. math.sqrt(3)*st[0]+st[1] math.sqrt(3)*st[0] math.sqrt(3) math.sqrt math sqrt 3 st[0] st 0 st[1] st 1 2. return [p1,s,u,t] [p1,s,u,t] p1 s u t p1 p1 p2 p2 if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def koch(p1,p2):
    s  = [p1[0]+(p2[0]-p1[0])/3.,    p1[1]+(p2[1]-p1[1])/3.]
    t  = [p1[0]+2.*(p2[0]-p1[0])/3., p1[1]+2.*(p2[1]-p1[1])/3.]
    st = [t[0]-s[0],t[1]-s[1]]
    u  = [s[0]+(st[0]-math.sqrt(3)*st[1])/2., s[1]+(math.sqrt(3)*st[0]+st[1])/2.]
    return [p1,s,u,t]
     def koch(p1,p2):
    s  = [p1[0]+(p2[0]-p1[0])/3.,    p1[1]+(p2[1]-p1[1])/3.]
    t  = [p1[0]+2.*(p2[0]-p1[0])/3., p1[1]+2.*(p2[1]-p1[1])/3.]
    st = [t[0]-s[0],t[1]-s[1]]
    u  = [s[0]+(st[0]-math.sqrt(3)*st[1])/2., s[1]+(math.sqrt(3)*st[0]+st[1])/2.]
    return [p1,s,u,t]
     koch def main():
    n = input()

    p1 = [0., 0.]
    p2 = [100., 0.]
    a = [p1,p2]
    a = rec(a,n)

    for item in a:
        print item[0], item[1]
     def main():
    n = input()

    p1 = [0., 0.]
    p2 = [100., 0.]
    a = [p1,p2]
    a = rec(a,n)

    for item in a:
        print item[0], item[1]
     main def rec(a,n):
    if n == 0:
        return a
    else:
        n -= 1
        b = []
        for i in range(len(a)-1):
            p1 = a[i]
            p2 = a[i+1]
            b += koch(p1,p2)
        b.append(a[-1])
        return rec(b,n) def rec(a,n):
    if n == 0:
        return a
    else:
        n -= 1
        b = []
        for i in range(len(a)-1):
            p1 = a[i]
            p2 = a[i+1]
            b += koch(p1,p2)
        b.append(a[-1])
        return rec(b,n) rec
import math

def main():
    n = input()

    p1 = [0., 0.]
    p2 = [100., 0.]
    a = [p1,p2]
    a = rec(a,n)

    for item in a:
        print item[0], item[1]
    
def rec(a,n):
    if n == 0:
        return a
    else:
        n -= 1
        b = []
        for i in range(len(a)-1):
            p1 = a[i]
            p2 = a[i+1]
            b += koch(p1,p2)
        b.append(a[-1])
        return rec(b,n)

def koch(p1,p2):
    s  = [p1[0]+(p2[0]-p1[0])/3.,    p1[1]+(p2[1]-p1[1])/3.]
    t  = [p1[0]+2.*(p2[0]-p1[0])/3., p1[1]+2.*(p2[1]-p1[1])/3.]
    st = [t[0]-s[0],t[1]-s[1]]
    u  = [s[0]+(st[0]-math.sqrt(3)*st[1])/2., s[1]+(math.sqrt(3)*st[0]+st[1])/2.]
    return [p1,s,u,t]
    
if __name__ == "__main__":
    main()