from math import cos, sin, pi

class Coordinate:
    def __init__(self, x, y):
        self.x = x
        self.y = y

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

    s = Coordinate((2*p1.x+p2.x)/3, (2*p1.y+p2.y)/3)
    t = Coordinate((p1.x+2*p2.x)/3, (p1.y+2*p2.y)/3)
    ux = (t.x-s.x)*cos(pi/3) - (t.y-s.y)*sin(pi/3) + s.x
    uy = (t.x-s.x)*sin(pi/3) + (t.y-s.y)*cos(pi/3) + s.y
    u = Coordinate(ux, uy)
    
    kock(n-1, p1, s)
    print("%f %f"%(s.x, s.y))
    kock(n-1, s, u)
    print("%f %f"%(u.x, u.y))
    kock(n-1, u, t)
    print("%f %f"%(t.x, t.y))
    kock(n-1, t, p2)
    
n = int(input())
p1 = Coordinate(0, 0)
p2 = Coordinate(100, 0)

print("%f %f"%(p1.x, p2.y))
kock(n, p1, p2)
print("%f %f"%(p2.x, p2.y)) from math import cos, sin, pi class Coordinate:
    def __init__(self, x, y):
        self.x = x
        self.y = y Coordinate def __init__(self, x, y):
        self.x = x
        self.y = y __init__ self.x = x self.x self x x self.y = y self.y self y y self self x x y y def kock(n, p1, p2):
    if n == 0:
        return

    s = Coordinate((2*p1.x+p2.x)/3, (2*p1.y+p2.y)/3)
    t = Coordinate((p1.x+2*p2.x)/3, (p1.y+2*p2.y)/3)
    ux = (t.x-s.x)*cos(pi/3) - (t.y-s.y)*sin(pi/3) + s.x
    uy = (t.x-s.x)*sin(pi/3) + (t.y-s.y)*cos(pi/3) + s.y
    u = Coordinate(ux, uy)
    
    kock(n-1, p1, s)
    print("%f %f"%(s.x, s.y))
    kock(n-1, s, u)
    print("%f %f"%(u.x, u.y))
    kock(n-1, u, t)
    print("%f %f"%(t.x, t.y))
    kock(n-1, t, p2)
     kock if n == 0:
        return

     n == 0 n 0 return s = Coordinate((2*p1.x+p2.x)/3, (2*p1.y+p2.y)/3) s Coordinate((2*p1.x+p2.x)/3, (2*p1.y+p2.y)/3) Coordinate (2*p1.x+p2.x)/3 2*p1.x+p2.x 2*p1.x 2 p1.x p1 x p2.x p2 x 3 (2*p1.y+p2.y)/3 2*p1.y+p2.y 2*p1.y 2 p1.y p1 y p2.y p2 y 3 t = Coordinate((p1.x+2*p2.x)/3, (p1.y+2*p2.y)/3) t Coordinate((p1.x+2*p2.x)/3, (p1.y+2*p2.y)/3) Coordinate (p1.x+2*p2.x)/3 p1.x+2*p2.x p1.x p1 x 2*p2.x 2 p2.x p2 x 3 (p1.y+2*p2.y)/3 p1.y+2*p2.y p1.y p1 y 2*p2.y 2 p2.y p2 y 3 ux = (t.x-s.x)*cos(pi/3) - (t.y-s.y)*sin(pi/3) + s.x ux (t.x-s.x)*cos(pi/3) - (t.y-s.y)*sin(pi/3) + s.x (t.x-s.x)*cos(pi/3) - (t.y-s.y)*sin(pi/3) (t.x-s.x)*cos(pi/3) t.x-s.x t.x t x s.x s x cos(pi/3) cos pi/3 pi 3 (t.y-s.y)*sin(pi/3) t.y-s.y t.y t y s.y s y sin(pi/3) sin pi/3 pi 3 s.x s x uy = (t.x-s.x)*sin(pi/3) + (t.y-s.y)*cos(pi/3) + s.y uy (t.x-s.x)*sin(pi/3) + (t.y-s.y)*cos(pi/3) + s.y (t.x-s.x)*sin(pi/3) + (t.y-s.y)*cos(pi/3) (t.x-s.x)*sin(pi/3) t.x-s.x t.x t x s.x s x sin(pi/3) sin pi/3 pi 3 (t.y-s.y)*cos(pi/3) t.y-s.y t.y t y s.y s y cos(pi/3) cos pi/3 pi 3 s.y s y u = Coordinate(ux, uy) u Coordinate(ux, uy) Coordinate ux uy kock(n-1, p1, s) kock n-1 n 1 p1 s print("%f %f"%(s.x, s.y)) print "%f %f"%(s.x, s.y) "%f %f" (s.x, s.y) s.x s x s.y s y kock(n-1, s, u) kock n-1 n 1 s u print("%f %f"%(u.x, u.y)) print "%f %f"%(u.x, u.y) "%f %f" (u.x, u.y) u.x u x u.y u y kock(n-1, u, t) kock n-1 n 1 u t print("%f %f"%(t.x, t.y)) print "%f %f"%(t.x, t.y) "%f %f" (t.x, t.y) t.x t x t.y t y kock(n-1, t, p2) kock n-1 n 1 t p2 n n p1 p1 p2 p2 n = int(input()) n int(input()) int input() input p1 = Coordinate(0, 0) p1 Coordinate(0, 0) Coordinate 0 0 p2 = Coordinate(100, 0) p2 Coordinate(100, 0) Coordinate 100 0 print("%f %f"%(p1.x, p2.y)) print "%f %f"%(p1.x, p2.y) "%f %f" (p1.x, p2.y) p1.x p1 x p2.y p2 y kock(n, p1, p2) kock n p1 p2 print("%f %f"%(p2.x, p2.y)) print "%f %f"%(p2.x, p2.y) "%f %f" (p2.x, p2.y) p2.x p2 x p2.y p2 y n = int(input()) int(input()) n def kock(n, p1, p2):
    if n == 0:
        return

    s = Coordinate((2*p1.x+p2.x)/3, (2*p1.y+p2.y)/3)
    t = Coordinate((p1.x+2*p2.x)/3, (p1.y+2*p2.y)/3)
    ux = (t.x-s.x)*cos(pi/3) - (t.y-s.y)*sin(pi/3) + s.x
    uy = (t.x-s.x)*sin(pi/3) + (t.y-s.y)*cos(pi/3) + s.y
    u = Coordinate(ux, uy)
    
    kock(n-1, p1, s)
    print("%f %f"%(s.x, s.y))
    kock(n-1, s, u)
    print("%f %f"%(u.x, u.y))
    kock(n-1, u, t)
    print("%f %f"%(t.x, t.y))
    kock(n-1, t, p2)
     def kock(n, p1, p2):
    if n == 0:
        return

    s = Coordinate((2*p1.x+p2.x)/3, (2*p1.y+p2.y)/3)
    t = Coordinate((p1.x+2*p2.x)/3, (p1.y+2*p2.y)/3)
    ux = (t.x-s.x)*cos(pi/3) - (t.y-s.y)*sin(pi/3) + s.x
    uy = (t.x-s.x)*sin(pi/3) + (t.y-s.y)*cos(pi/3) + s.y
    u = Coordinate(ux, uy)
    
    kock(n-1, p1, s)
    print("%f %f"%(s.x, s.y))
    kock(n-1, s, u)
    print("%f %f"%(u.x, u.y))
    kock(n-1, u, t)
    print("%f %f"%(t.x, t.y))
    kock(n-1, t, p2)
     kock p1 = Coordinate(0, 0) Coordinate(0, 0) p1 class Coordinate:
    def __init__(self, x, y):
        self.x = x
        self.y = y class Coordinate:
    def __init__(self, x, y):
        self.x = x
        self.y = y Coordinate p2 = Coordinate(100, 0) Coordinate(100, 0) p2
from math import cos, sin, pi

class Coordinate:
    def __init__(self, x, y):
        self.x = x
        self.y = y

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

    s = Coordinate((2*p1.x+p2.x)/3, (2*p1.y+p2.y)/3)
    t = Coordinate((p1.x+2*p2.x)/3, (p1.y+2*p2.y)/3)
    ux = (t.x-s.x)*cos(pi/3) - (t.y-s.y)*sin(pi/3) + s.x
    uy = (t.x-s.x)*sin(pi/3) + (t.y-s.y)*cos(pi/3) + s.y
    u = Coordinate(ux, uy)
    
    kock(n-1, p1, s)
    print("%f %f"%(s.x, s.y))
    kock(n-1, s, u)
    print("%f %f"%(u.x, u.y))
    kock(n-1, u, t)
    print("%f %f"%(t.x, t.y))
    kock(n-1, t, p2)
    
n = int(input())
p1 = Coordinate(0, 0)
p2 = Coordinate(100, 0)

print("%f %f"%(p1.x, p2.y))
kock(n, p1, p2)
print("%f %f"%(p2.x, p2.y))
