import math

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

def koch(n, p1, p2):
    if n == 0:
        return str(p2.x) + " " + str(p2.y)
    
    else:
        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)
        u = coordinate((t.x-s.x)/2-(t.y-s.y)/2*math.sqrt(3)+s.x, (t.x-s.x)/2*math.sqrt(3)+(t.y-s.y)/2+s.y)
        print(koch(n-1, p1, s))
        print(koch(n-1, s, u))
        print(koch(n-1, u, t))
        return(koch(n-1, t, p2))


q1 = coordinate(0.00000000, 0.00000000)
q2 = coordinate(100.00000000, 0.00000000)

print(str(q1.x) + " " + str(q1.y))
print(koch(int(input()), q1, q2))
 import math math 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 koch(n, p1, p2):
    if n == 0:
        return str(p2.x) + " " + str(p2.y)
    
    else:
        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)
        u = coordinate((t.x-s.x)/2-(t.y-s.y)/2*math.sqrt(3)+s.x, (t.x-s.x)/2*math.sqrt(3)+(t.y-s.y)/2+s.y)
        print(koch(n-1, p1, s))
        print(koch(n-1, s, u))
        print(koch(n-1, u, t))
        return(koch(n-1, t, p2)) koch if n == 0:
        return str(p2.x) + " " + str(p2.y)
    
    else:
        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)
        u = coordinate((t.x-s.x)/2-(t.y-s.y)/2*math.sqrt(3)+s.x, (t.x-s.x)/2*math.sqrt(3)+(t.y-s.y)/2+s.y)
        print(koch(n-1, p1, s))
        print(koch(n-1, s, u))
        print(koch(n-1, u, t))
        return(koch(n-1, t, p2)) n == 0 n 0 return str(p2.x) + " " + str(p2.y) str(p2.x) + " " + str(p2.y) str(p2.x) + " " str(p2.x) str p2.x p2 x " " str(p2.y) str p2.y p2 y 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 u = coordinate((t.x-s.x)/2-(t.y-s.y)/2*math.sqrt(3)+s.x, (t.x-s.x)/2*math.sqrt(3)+(t.y-s.y)/2+s.y) u coordinate((t.x-s.x)/2-(t.y-s.y)/2*math.sqrt(3)+s.x, (t.x-s.x)/2*math.sqrt(3)+(t.y-s.y)/2+s.y) coordinate (t.x-s.x)/2-(t.y-s.y)/2*math.sqrt(3)+s.x (t.x-s.x)/2-(t.y-s.y)/2*math.sqrt(3) (t.x-s.x)/2 t.x-s.x t.x t x s.x s x 2 (t.y-s.y)/2*math.sqrt(3) (t.y-s.y)/2 t.y-s.y t.y t y s.y s y 2 math.sqrt(3) math.sqrt math sqrt 3 s.x s x (t.x-s.x)/2*math.sqrt(3)+(t.y-s.y)/2+s.y (t.x-s.x)/2*math.sqrt(3)+(t.y-s.y)/2 (t.x-s.x)/2*math.sqrt(3) (t.x-s.x)/2 t.x-s.x t.x t x s.x s x 2 math.sqrt(3) math.sqrt math sqrt 3 (t.y-s.y)/2 t.y-s.y t.y t y s.y s y 2 s.y s y print(koch(n-1, p1, s)) print koch(n-1, p1, s) koch n-1 n 1 p1 s print(koch(n-1, s, u)) print koch(n-1, s, u) koch n-1 n 1 s u print(koch(n-1, u, t)) print koch(n-1, u, t) koch n-1 n 1 u t return(koch(n-1, t, p2)) koch(n-1, t, p2) koch n-1 n 1 t p2 n n p1 p1 p2 p2 q1 = coordinate(0.00000000, 0.00000000) q1 coordinate(0.00000000, 0.00000000) coordinate 0.00000000 0.00000000 q2 = coordinate(100.00000000, 0.00000000) q2 coordinate(100.00000000, 0.00000000) coordinate 100.00000000 0.00000000 print(str(q1.x) + " " + str(q1.y)) print str(q1.x) + " " + str(q1.y) str(q1.x) + " " str(q1.x) str q1.x q1 x " " str(q1.y) str q1.y q1 y print(koch(int(input()), q1, q2)) print koch(int(input()), q1, q2) koch int(input()) int input() input q1 q2 q2 = coordinate(100.00000000, 0.00000000) coordinate(100.00000000, 0.00000000) q2 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 def koch(n, p1, p2):
    if n == 0:
        return str(p2.x) + " " + str(p2.y)
    
    else:
        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)
        u = coordinate((t.x-s.x)/2-(t.y-s.y)/2*math.sqrt(3)+s.x, (t.x-s.x)/2*math.sqrt(3)+(t.y-s.y)/2+s.y)
        print(koch(n-1, p1, s))
        print(koch(n-1, s, u))
        print(koch(n-1, u, t))
        return(koch(n-1, t, p2)) def koch(n, p1, p2):
    if n == 0:
        return str(p2.x) + " " + str(p2.y)
    
    else:
        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)
        u = coordinate((t.x-s.x)/2-(t.y-s.y)/2*math.sqrt(3)+s.x, (t.x-s.x)/2*math.sqrt(3)+(t.y-s.y)/2+s.y)
        print(koch(n-1, p1, s))
        print(koch(n-1, s, u))
        print(koch(n-1, u, t))
        return(koch(n-1, t, p2)) koch q1 = coordinate(0.00000000, 0.00000000) coordinate(0.00000000, 0.00000000) q1
import math

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

def koch(n, p1, p2):
    if n == 0:
        return str(p2.x) + " " + str(p2.y)
    
    else:
        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)
        u = coordinate((t.x-s.x)/2-(t.y-s.y)/2*math.sqrt(3)+s.x, (t.x-s.x)/2*math.sqrt(3)+(t.y-s.y)/2+s.y)
        print(koch(n-1, p1, s))
        print(koch(n-1, s, u))
        print(koch(n-1, u, t))
        return(koch(n-1, t, p2))


q1 = coordinate(0.00000000, 0.00000000)
q2 = coordinate(100.00000000, 0.00000000)

print(str(q1.x) + " " + str(q1.y))
print(koch(int(input()), q1, q2))

