import math
pi = math.pi

th = pi * 60.0 / 180.0
cos = math.cos(th)
sin = math.sin(th)

class Point():
    def __init__(self):
        self.x = 0.0
        self.y = 0.0
        
def koch(n, p1, p2):
    if n == 0:
        return None
    
    s = Point()
    t = Point()
    u = Point()
    
    s.x = (2.0 * p1.x + 1.0 * p2.x) / 3.0
    s.y = (2.0 * p1.y + 1.0 * p2.y) / 3.0
    t.x = (1.0 * p1.x + 2.0 * p2.x) / 3.0
    t.y = (1.0 * p1.y + 2.0 * p2.y) / 3.0
    u.x = (t.x - s.x) * cos - (t.y - s.y) * sin + s.x
    u.y = (t.x - s.x) * sin + (t.y - s.y) * cos + s.y
    
    koch(n-1, p1, s)
    print(s.x, s.y)
    koch(n-1, s, u)
    print(u.x, u.y)
    koch(n-1, u, t)
    print(t.x, t.y)
    koch(n-1, t, p2)
    
def main():
       
    p1 = Point()
    p2 = Point()
    
    n = int(input())
    
    p2.x = 100
    
    print(p1.x, p1.y)
    koch(n, p1, p2)
    print(p2.x, p2.y)
    
    return 0
    
if __name__ == '__main__':
    main() import math math pi = math.pi pi math.pi math pi th = pi * 60.0 / 180.0 th pi * 60.0 / 180.0 pi * 60.0 pi 60.0 180.0 cos = math.cos(th) cos math.cos(th) math.cos math cos th sin = math.sin(th) sin math.sin(th) math.sin math sin th class Point():
    def __init__(self):
        self.x = 0.0
        self.y = 0.0
         Point def __init__(self):
        self.x = 0.0
        self.y = 0.0
         __init__ self.x = 0.0 self.x self x 0.0 self.y = 0.0 self.y self y 0.0 self self def koch(n, p1, p2):
    if n == 0:
        return None
    
    s = Point()
    t = Point()
    u = Point()
    
    s.x = (2.0 * p1.x + 1.0 * p2.x) / 3.0
    s.y = (2.0 * p1.y + 1.0 * p2.y) / 3.0
    t.x = (1.0 * p1.x + 2.0 * p2.x) / 3.0
    t.y = (1.0 * p1.y + 2.0 * p2.y) / 3.0
    u.x = (t.x - s.x) * cos - (t.y - s.y) * sin + s.x
    u.y = (t.x - s.x) * sin + (t.y - s.y) * cos + s.y
    
    koch(n-1, p1, s)
    print(s.x, s.y)
    koch(n-1, s, u)
    print(u.x, u.y)
    koch(n-1, u, t)
    print(t.x, t.y)
    koch(n-1, t, p2)
     koch if n == 0:
        return None
    
     n == 0 n 0 return None None s = Point() s Point() Point t = Point() t Point() Point u = Point() u Point() Point s.x = (2.0 * p1.x + 1.0 * p2.x) / 3.0 s.x s x (2.0 * p1.x + 1.0 * p2.x) / 3.0 2.0 * p1.x + 1.0 * p2.x 2.0 * p1.x 2.0 p1.x p1 x 1.0 * p2.x 1.0 p2.x p2 x 3.0 s.y = (2.0 * p1.y + 1.0 * p2.y) / 3.0 s.y s y (2.0 * p1.y + 1.0 * p2.y) / 3.0 2.0 * p1.y + 1.0 * p2.y 2.0 * p1.y 2.0 p1.y p1 y 1.0 * p2.y 1.0 p2.y p2 y 3.0 t.x = (1.0 * p1.x + 2.0 * p2.x) / 3.0 t.x t x (1.0 * p1.x + 2.0 * p2.x) / 3.0 1.0 * p1.x + 2.0 * p2.x 1.0 * p1.x 1.0 p1.x p1 x 2.0 * p2.x 2.0 p2.x p2 x 3.0 t.y = (1.0 * p1.y + 2.0 * p2.y) / 3.0 t.y t y (1.0 * p1.y + 2.0 * p2.y) / 3.0 1.0 * p1.y + 2.0 * p2.y 1.0 * p1.y 1.0 p1.y p1 y 2.0 * p2.y 2.0 p2.y p2 y 3.0 u.x = (t.x - s.x) * cos - (t.y - s.y) * sin + s.x u.x u x (t.x - s.x) * cos - (t.y - s.y) * sin + s.x (t.x - s.x) * cos - (t.y - s.y) * sin (t.x - s.x) * cos t.x - s.x t.x t x s.x s x cos (t.y - s.y) * sin t.y - s.y t.y t y s.y s y sin s.x s x u.y = (t.x - s.x) * sin + (t.y - s.y) * cos + s.y u.y u y (t.x - s.x) * sin + (t.y - s.y) * cos + s.y (t.x - s.x) * sin + (t.y - s.y) * cos (t.x - s.x) * sin t.x - s.x t.x t x s.x s x sin (t.y - s.y) * cos t.y - s.y t.y t y s.y s y cos s.y s y koch(n-1, p1, s) koch n-1 n 1 p1 s print(s.x, s.y) print s.x s x s.y s y koch(n-1, s, u) koch n-1 n 1 s u print(u.x, u.y) print u.x u x u.y u y koch(n-1, u, t) koch n-1 n 1 u t print(t.x, t.y) print t.x t x t.y t y koch(n-1, t, p2) koch n-1 n 1 t p2 n n p1 p1 p2 p2 def main():
       
    p1 = Point()
    p2 = Point()
    
    n = int(input())
    
    p2.x = 100
    
    print(p1.x, p1.y)
    koch(n, p1, p2)
    print(p2.x, p2.y)
    
    return 0
     main p1 = Point() p1 Point() Point p2 = Point() p2 Point() Point n = int(input()) n int(input()) int input() input p2.x = 100 p2.x p2 x 100 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 return 0 0 if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main pi = math.pi math.pi pi cos = math.cos(th) math.cos(th) cos def koch(n, p1, p2):
    if n == 0:
        return None
    
    s = Point()
    t = Point()
    u = Point()
    
    s.x = (2.0 * p1.x + 1.0 * p2.x) / 3.0
    s.y = (2.0 * p1.y + 1.0 * p2.y) / 3.0
    t.x = (1.0 * p1.x + 2.0 * p2.x) / 3.0
    t.y = (1.0 * p1.y + 2.0 * p2.y) / 3.0
    u.x = (t.x - s.x) * cos - (t.y - s.y) * sin + s.x
    u.y = (t.x - s.x) * sin + (t.y - s.y) * cos + s.y
    
    koch(n-1, p1, s)
    print(s.x, s.y)
    koch(n-1, s, u)
    print(u.x, u.y)
    koch(n-1, u, t)
    print(t.x, t.y)
    koch(n-1, t, p2)
     def koch(n, p1, p2):
    if n == 0:
        return None
    
    s = Point()
    t = Point()
    u = Point()
    
    s.x = (2.0 * p1.x + 1.0 * p2.x) / 3.0
    s.y = (2.0 * p1.y + 1.0 * p2.y) / 3.0
    t.x = (1.0 * p1.x + 2.0 * p2.x) / 3.0
    t.y = (1.0 * p1.y + 2.0 * p2.y) / 3.0
    u.x = (t.x - s.x) * cos - (t.y - s.y) * sin + s.x
    u.y = (t.x - s.x) * sin + (t.y - s.y) * cos + s.y
    
    koch(n-1, p1, s)
    print(s.x, s.y)
    koch(n-1, s, u)
    print(u.x, u.y)
    koch(n-1, u, t)
    print(t.x, t.y)
    koch(n-1, t, p2)
     koch sin = math.sin(th) math.sin(th) sin class Point():
    def __init__(self):
        self.x = 0.0
        self.y = 0.0
         class Point():
    def __init__(self):
        self.x = 0.0
        self.y = 0.0
         Point th = pi * 60.0 / 180.0 pi * 60.0 / 180.0 th def main():
       
    p1 = Point()
    p2 = Point()
    
    n = int(input())
    
    p2.x = 100
    
    print(p1.x, p1.y)
    koch(n, p1, p2)
    print(p2.x, p2.y)
    
    return 0
     def main():
       
    p1 = Point()
    p2 = Point()
    
    n = int(input())
    
    p2.x = 100
    
    print(p1.x, p1.y)
    koch(n, p1, p2)
    print(p2.x, p2.y)
    
    return 0
     main
import math
pi = math.pi

th = pi * 60.0 / 180.0
cos = math.cos(th)
sin = math.sin(th)

class Point():
    def __init__(self):
        self.x = 0.0
        self.y = 0.0
        
def koch(n, p1, p2):
    if n == 0:
        return None
    
    s = Point()
    t = Point()
    u = Point()
    
    s.x = (2.0 * p1.x + 1.0 * p2.x) / 3.0
    s.y = (2.0 * p1.y + 1.0 * p2.y) / 3.0
    t.x = (1.0 * p1.x + 2.0 * p2.x) / 3.0
    t.y = (1.0 * p1.y + 2.0 * p2.y) / 3.0
    u.x = (t.x - s.x) * cos - (t.y - s.y) * sin + s.x
    u.y = (t.x - s.x) * sin + (t.y - s.y) * cos + s.y
    
    koch(n-1, p1, s)
    print(s.x, s.y)
    koch(n-1, s, u)
    print(u.x, u.y)
    koch(n-1, u, t)
    print(t.x, t.y)
    koch(n-1, t, p2)
    
def main():
       
    p1 = Point()
    p2 = Point()
    
    n = int(input())
    
    p2.x = 100
    
    print(p1.x, p1.y)
    koch(n, p1, p2)
    print(p2.x, p2.y)
    
    return 0
    
if __name__ == '__main__':
    main()
