import math

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

    s_x = (2 * p1[0] + 1 * p2[0])/3
    s_y = (2 * p1[1] + 1 * p2[1])/3
    s = [s_x, s_y]
    t_x = (1 * p1[0] + 2 * p2[0])/3
    t_y = (1 * p1[1] + 2 * p2[1])/3
    t = [t_x, t_y]
    rotated = math.pi * 60 / 180
    u_x = (t_x - s_x) * math.cos(rotated) - (t_y - s_y) * math.sin(rotated) + s_x
    u_y = (t_x - s_x) * math.sin(rotated) + (t_y - s_y) * math.cos(rotated) + s_y
    u = [u_x, u_y]

    koch(d-1, p1, s)
    print(' '.join(map(str, s)))
    koch(d-1, s, u)
    print(' '.join(map(str, u)))
    koch(d-1, u, t)
    print(' '.join(map(str, t)))
    koch(d-1, t, p2)
    

def main():
    n  = int(input())
    p1 = [0.00000000,0.00000000]
    p2 = [100.00000000,0.00000000]
    print(' '.join(map(str, p1)))
    koch(n, p1, p2)
    print(' '.join(map(str, p2)))
if __name__=='__main__':
    main() import math math def koch(d, p1, p2):
    if d == 0:
        return

    s_x = (2 * p1[0] + 1 * p2[0])/3
    s_y = (2 * p1[1] + 1 * p2[1])/3
    s = [s_x, s_y]
    t_x = (1 * p1[0] + 2 * p2[0])/3
    t_y = (1 * p1[1] + 2 * p2[1])/3
    t = [t_x, t_y]
    rotated = math.pi * 60 / 180
    u_x = (t_x - s_x) * math.cos(rotated) - (t_y - s_y) * math.sin(rotated) + s_x
    u_y = (t_x - s_x) * math.sin(rotated) + (t_y - s_y) * math.cos(rotated) + s_y
    u = [u_x, u_y]

    koch(d-1, p1, s)
    print(' '.join(map(str, s)))
    koch(d-1, s, u)
    print(' '.join(map(str, u)))
    koch(d-1, u, t)
    print(' '.join(map(str, t)))
    koch(d-1, t, p2)
     koch if d == 0:
        return

     d == 0 d 0 return s_x = (2 * p1[0] + 1 * p2[0])/3 s_x (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_y = (2 * p1[1] + 1 * p2[1])/3 s_y (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 s = [s_x, s_y] s [s_x, s_y] s_x s_y t_x = (1 * p1[0] + 2 * p2[0])/3 t_x (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_y = (1 * p1[1] + 2 * p2[1])/3 t_y (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 t = [t_x, t_y] t [t_x, t_y] t_x t_y rotated = math.pi * 60 / 180 rotated math.pi * 60 / 180 math.pi * 60 math.pi math pi 60 180 u_x = (t_x - s_x) * math.cos(rotated) - (t_y - s_y) * math.sin(rotated) + s_x u_x (t_x - s_x) * math.cos(rotated) - (t_y - s_y) * math.sin(rotated) + s_x (t_x - s_x) * math.cos(rotated) - (t_y - s_y) * math.sin(rotated) (t_x - s_x) * math.cos(rotated) t_x - s_x t_x s_x math.cos(rotated) math.cos math cos rotated (t_y - s_y) * math.sin(rotated) t_y - s_y t_y s_y math.sin(rotated) math.sin math sin rotated s_x u_y = (t_x - s_x) * math.sin(rotated) + (t_y - s_y) * math.cos(rotated) + s_y u_y (t_x - s_x) * math.sin(rotated) + (t_y - s_y) * math.cos(rotated) + s_y (t_x - s_x) * math.sin(rotated) + (t_y - s_y) * math.cos(rotated) (t_x - s_x) * math.sin(rotated) t_x - s_x t_x s_x math.sin(rotated) math.sin math sin rotated (t_y - s_y) * math.cos(rotated) t_y - s_y t_y s_y math.cos(rotated) math.cos math cos rotated s_y u = [u_x, u_y] u [u_x, u_y] u_x u_y koch(d-1, p1, s) koch d-1 d 1 p1 s print(' '.join(map(str, s))) print ' '.join(map(str, s)) ' '.join ' ' join map(str, s) map str s koch(d-1, s, u) koch d-1 d 1 s u print(' '.join(map(str, u))) print ' '.join(map(str, u)) ' '.join ' ' join map(str, u) map str u koch(d-1, u, t) koch d-1 d 1 u t print(' '.join(map(str, t))) print ' '.join(map(str, t)) ' '.join ' ' join map(str, t) map str t koch(d-1, t, p2) koch d-1 d 1 t p2 d d p1 p1 p2 p2 def main():
    n  = int(input())
    p1 = [0.00000000,0.00000000]
    p2 = [100.00000000,0.00000000]
    print(' '.join(map(str, p1)))
    koch(n, p1, p2)
    print(' '.join(map(str, p2))) main n  = int(input()) n int(input()) int input() input p1 = [0.00000000,0.00000000] p1 [0.00000000,0.00000000] 0.00000000 0.00000000 p2 = [100.00000000,0.00000000] p2 [100.00000000,0.00000000] 100.00000000 0.00000000 print(' '.join(map(str, p1))) print ' '.join(map(str, p1)) ' '.join ' ' join map(str, p1) map str p1 koch(n, p1, p2) koch n p1 p2 print(' '.join(map(str, p2))) print ' '.join(map(str, p2)) ' '.join ' ' join map(str, p2) map str p2 if __name__=='__main__':
    main() __name__=='__main__' __name__ '__main__' main() main def koch(d, p1, p2):
    if d == 0:
        return

    s_x = (2 * p1[0] + 1 * p2[0])/3
    s_y = (2 * p1[1] + 1 * p2[1])/3
    s = [s_x, s_y]
    t_x = (1 * p1[0] + 2 * p2[0])/3
    t_y = (1 * p1[1] + 2 * p2[1])/3
    t = [t_x, t_y]
    rotated = math.pi * 60 / 180
    u_x = (t_x - s_x) * math.cos(rotated) - (t_y - s_y) * math.sin(rotated) + s_x
    u_y = (t_x - s_x) * math.sin(rotated) + (t_y - s_y) * math.cos(rotated) + s_y
    u = [u_x, u_y]

    koch(d-1, p1, s)
    print(' '.join(map(str, s)))
    koch(d-1, s, u)
    print(' '.join(map(str, u)))
    koch(d-1, u, t)
    print(' '.join(map(str, t)))
    koch(d-1, t, p2)
     def koch(d, p1, p2):
    if d == 0:
        return

    s_x = (2 * p1[0] + 1 * p2[0])/3
    s_y = (2 * p1[1] + 1 * p2[1])/3
    s = [s_x, s_y]
    t_x = (1 * p1[0] + 2 * p2[0])/3
    t_y = (1 * p1[1] + 2 * p2[1])/3
    t = [t_x, t_y]
    rotated = math.pi * 60 / 180
    u_x = (t_x - s_x) * math.cos(rotated) - (t_y - s_y) * math.sin(rotated) + s_x
    u_y = (t_x - s_x) * math.sin(rotated) + (t_y - s_y) * math.cos(rotated) + s_y
    u = [u_x, u_y]

    koch(d-1, p1, s)
    print(' '.join(map(str, s)))
    koch(d-1, s, u)
    print(' '.join(map(str, u)))
    koch(d-1, u, t)
    print(' '.join(map(str, t)))
    koch(d-1, t, p2)
     koch def main():
    n  = int(input())
    p1 = [0.00000000,0.00000000]
    p2 = [100.00000000,0.00000000]
    print(' '.join(map(str, p1)))
    koch(n, p1, p2)
    print(' '.join(map(str, p2))) def main():
    n  = int(input())
    p1 = [0.00000000,0.00000000]
    p2 = [100.00000000,0.00000000]
    print(' '.join(map(str, p1)))
    koch(n, p1, p2)
    print(' '.join(map(str, p2))) main
import math

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

    s_x = (2 * p1[0] + 1 * p2[0])/3
    s_y = (2 * p1[1] + 1 * p2[1])/3
    s = [s_x, s_y]
    t_x = (1 * p1[0] + 2 * p2[0])/3
    t_y = (1 * p1[1] + 2 * p2[1])/3
    t = [t_x, t_y]
    rotated = math.pi * 60 / 180
    u_x = (t_x - s_x) * math.cos(rotated) - (t_y - s_y) * math.sin(rotated) + s_x
    u_y = (t_x - s_x) * math.sin(rotated) + (t_y - s_y) * math.cos(rotated) + s_y
    u = [u_x, u_y]

    koch(d-1, p1, s)
    print(' '.join(map(str, s)))
    koch(d-1, s, u)
    print(' '.join(map(str, u)))
    koch(d-1, u, t)
    print(' '.join(map(str, t)))
    koch(d-1, t, p2)
    

def main():
    n  = int(input())
    p1 = [0.00000000,0.00000000]
    p2 = [100.00000000,0.00000000]
    print(' '.join(map(str, p1)))
    koch(n, p1, p2)
    print(' '.join(map(str, p2)))
if __name__=='__main__':
    main()
