import math

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

def koch(d, p1, p2):
    

    if d == 0:
        return
    
    t = Point((p1.x + 2 * p2.x )/3,(p1.y + 2 * p2.y )/3 )
    s = Point((p2.x + 2 * p1.x )/3,(p2.y + 2 * p1.y )/3 )
    
    u = Point((t.x-s.x) * (math.cos(math.pi / 3)) - (t.y-s.y) * (math.sin(math.pi / 3)) + s.x, (t.x-s.x) * (math.sin(math.pi / 3)) + (t.y-s.y) * (math.cos(math.pi / 3)) + s.y)
    #print(s.x, s.y , t.x, t.y, u.x, u.y)
    

    
    koch(d - 1, p1, s)
    print(s.x, s.y)
    koch(d - 1, s, u)
    print(u.x, u.y)
    koch(d - 1, u, t)
    print(t.x, t.y)
    koch(d - 1, t, p2)


n = int(input())
    
p1 = Point(0, 0)
p2 = Point(100, 0)

print(p1.x, p1.y)
koch(n, p1, p2)
print(p2.x, p2.y)

 import math math class Point:
    def __init__(self, x, y):
        self.x = x
        self.y = y Point 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(d, p1, p2):
    

    if d == 0:
        return
    
    t = Point((p1.x + 2 * p2.x )/3,(p1.y + 2 * p2.y )/3 )
    s = Point((p2.x + 2 * p1.x )/3,(p2.y + 2 * p1.y )/3 )
    
    u = Point((t.x-s.x) * (math.cos(math.pi / 3)) - (t.y-s.y) * (math.sin(math.pi / 3)) + s.x, (t.x-s.x) * (math.sin(math.pi / 3)) + (t.y-s.y) * (math.cos(math.pi / 3)) + s.y)
    #print(s.x, s.y , t.x, t.y, u.x, u.y)
    

    
    koch(d - 1, p1, s)
    print(s.x, s.y)
    koch(d - 1, s, u)
    print(u.x, u.y)
    koch(d - 1, u, t)
    print(t.x, t.y)
    koch(d - 1, t, p2) koch if d == 0:
        return
    
     d == 0 d 0 return t = Point((p1.x + 2 * p2.x )/3,(p1.y + 2 * p2.y )/3 ) t Point((p1.x + 2 * p2.x )/3,(p1.y + 2 * p2.y )/3 ) Point (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 s = Point((p2.x + 2 * p1.x )/3,(p2.y + 2 * p1.y )/3 ) s Point((p2.x + 2 * p1.x )/3,(p2.y + 2 * p1.y )/3 ) Point (p2.x + 2 * p1.x )/3 p2.x + 2 * p1.x p2.x p2 x 2 * p1.x 2 p1.x p1 x 3 (p2.y + 2 * p1.y )/3 p2.y + 2 * p1.y p2.y p2 y 2 * p1.y 2 p1.y p1 y 3 u = Point((t.x-s.x) * (math.cos(math.pi / 3)) - (t.y-s.y) * (math.sin(math.pi / 3)) + s.x, (t.x-s.x) * (math.sin(math.pi / 3)) + (t.y-s.y) * (math.cos(math.pi / 3)) + s.y) u Point((t.x-s.x) * (math.cos(math.pi / 3)) - (t.y-s.y) * (math.sin(math.pi / 3)) + s.x, (t.x-s.x) * (math.sin(math.pi / 3)) + (t.y-s.y) * (math.cos(math.pi / 3)) + s.y) Point (t.x-s.x) * (math.cos(math.pi / 3)) - (t.y-s.y) * (math.sin(math.pi / 3)) + s.x (t.x-s.x) * (math.cos(math.pi / 3)) - (t.y-s.y) * (math.sin(math.pi / 3)) (t.x-s.x) * (math.cos(math.pi / 3)) t.x-s.x t.x t x s.x s x math.cos(math.pi / 3) math.cos math cos math.pi / 3 math.pi math pi 3 (t.y-s.y) * (math.sin(math.pi / 3)) t.y-s.y t.y t y s.y s y math.sin(math.pi / 3) math.sin math sin math.pi / 3 math.pi math pi 3 s.x s x (t.x-s.x) * (math.sin(math.pi / 3)) + (t.y-s.y) * (math.cos(math.pi / 3)) + s.y (t.x-s.x) * (math.sin(math.pi / 3)) + (t.y-s.y) * (math.cos(math.pi / 3)) (t.x-s.x) * (math.sin(math.pi / 3)) t.x-s.x t.x t x s.x s x math.sin(math.pi / 3) math.sin math sin math.pi / 3 math.pi math pi 3 (t.y-s.y) * (math.cos(math.pi / 3)) t.y-s.y t.y t y s.y s y math.cos(math.pi / 3) math.cos math cos math.pi / 3 math.pi math pi 3 s.y s y koch(d - 1, p1, s) koch d - 1 d 1 p1 s print(s.x, s.y) print s.x s x s.y s y koch(d - 1, s, u) koch d - 1 d 1 s u print(u.x, u.y) print u.x u x u.y u y koch(d - 1, u, t) koch d - 1 d 1 u t print(t.x, t.y) print t.x t x t.y t y koch(d - 1, t, p2) koch d - 1 d 1 t p2 d d p1 p1 p2 p2 n = int(input()) n int(input()) int input() input p1 = Point(0, 0) p1 Point(0, 0) Point 0 0 p2 = Point(100, 0) p2 Point(100, 0) Point 100 0 print(p1.x, p1.y) print p1.x p1 x p1.y p1 y koch(n, p1, p2) koch n p1 p2 print(p2.x, p2.y) print p2.x p2 x p2.y p2 y n = int(input()) int(input()) n p1 = Point(0, 0) Point(0, 0) p1 class Point:
    def __init__(self, x, y):
        self.x = x
        self.y = y class Point:
    def __init__(self, x, y):
        self.x = x
        self.y = y Point p2 = Point(100, 0) Point(100, 0) p2 def koch(d, p1, p2):
    

    if d == 0:
        return
    
    t = Point((p1.x + 2 * p2.x )/3,(p1.y + 2 * p2.y )/3 )
    s = Point((p2.x + 2 * p1.x )/3,(p2.y + 2 * p1.y )/3 )
    
    u = Point((t.x-s.x) * (math.cos(math.pi / 3)) - (t.y-s.y) * (math.sin(math.pi / 3)) + s.x, (t.x-s.x) * (math.sin(math.pi / 3)) + (t.y-s.y) * (math.cos(math.pi / 3)) + s.y)
    #print(s.x, s.y , t.x, t.y, u.x, u.y)
    

    
    koch(d - 1, p1, s)
    print(s.x, s.y)
    koch(d - 1, s, u)
    print(u.x, u.y)
    koch(d - 1, u, t)
    print(t.x, t.y)
    koch(d - 1, t, p2) def koch(d, p1, p2):
    

    if d == 0:
        return
    
    t = Point((p1.x + 2 * p2.x )/3,(p1.y + 2 * p2.y )/3 )
    s = Point((p2.x + 2 * p1.x )/3,(p2.y + 2 * p1.y )/3 )
    
    u = Point((t.x-s.x) * (math.cos(math.pi / 3)) - (t.y-s.y) * (math.sin(math.pi / 3)) + s.x, (t.x-s.x) * (math.sin(math.pi / 3)) + (t.y-s.y) * (math.cos(math.pi / 3)) + s.y)
    #print(s.x, s.y , t.x, t.y, u.x, u.y)
    

    
    koch(d - 1, p1, s)
    print(s.x, s.y)
    koch(d - 1, s, u)
    print(u.x, u.y)
    koch(d - 1, u, t)
    print(t.x, t.y)
    koch(d - 1, t, p2) koch
import math

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

def koch(d, p1, p2):
    

    if d == 0:
        return
    
    t = Point((p1.x + 2 * p2.x )/3,(p1.y + 2 * p2.y )/3 )
    s = Point((p2.x + 2 * p1.x )/3,(p2.y + 2 * p1.y )/3 )
    
    u = Point((t.x-s.x) * (math.cos(math.pi / 3)) - (t.y-s.y) * (math.sin(math.pi / 3)) + s.x, (t.x-s.x) * (math.sin(math.pi / 3)) + (t.y-s.y) * (math.cos(math.pi / 3)) + s.y)
    #print(s.x, s.y , t.x, t.y, u.x, u.y)
    

    
    koch(d - 1, p1, s)
    print(s.x, s.y)
    koch(d - 1, s, u)
    print(u.x, u.y)
    koch(d - 1, u, t)
    print(t.x, t.y)
    koch(d - 1, t, p2)


n = int(input())
    
p1 = Point(0, 0)
p2 = Point(100, 0)

print(p1.x, p1.y)
koch(n, p1, p2)
print(p2.x, p2.y)


