import math
cos60 = math.cos(60/180*math.pi)
sin60 = math.sin(60/180*math.pi)
class Point():
    def __init__(self, x, y):
        self.x = x
        self.y = y
    def __repr__(self):
        return str(self.x) + " " + str(self.y)
        

def koch(n, p1, p2):
    if(n==0):
        return
    s = Point((2* p1.x + p2.x)/3, (2* p1.y + 1*p2.y)/3)
    
    t = Point((p1.x + 2* p2.x)/3, (p1.y + 2* p2.y)/3)
    
    u = Point((t.x - s.x)* cos60 - (t.y -s.y)* sin60 + s.x,
             (t.x - s.x)* sin60 + (t.y -s.y)* cos60 + s.y)
    
    koch(n-1, p1, s)
    print(s)
    koch(n-1, s, u)
    print(u)
    koch(n-1, u, t)
    print(t)
    koch(n-1, t, p2)

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

def koch(n, p1, p2):
    if(n==0):
        return
    s = Point((2* p1.x + p2.x)/3, (2* p1.y + 1*p2.y)/3)
    
    t = Point((p1.x + 2* p2.x)/3, (p1.y + 2* p2.y)/3)
    
    u = Point((t.x - s.x)* cos60 - (t.y -s.y)* sin60 + s.x,
             (t.x - s.x)* sin60 + (t.y -s.y)* cos60 + s.y)
    
    koch(n-1, p1, s)
    print(s)
    koch(n-1, s, u)
    print(u)
    koch(n-1, u, t)
    print(t)
    koch(n-1, t, p2)

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