import math

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

def koch(d, p1, p2):
    if d == 0:
        return

    s = Point()
    u = Point()
    t = Point()
    rad = math.radians(60)

    s.x = (2 * p1.x + 1 * p2.x) / 3
    s.y = (2 * p1.y + 1 * p2.y) / 3
    t.x = (1 * p1.x + 2 * p2.x) / 3
    t.y = (1 * p1.y + 2 * p2.y) / 3
    u.x = (t.x - s.x) * math.cos(rad) - (t.y - s.y) * math.sin(rad) + s.x
    u.y = (t.x - s.x) * math.sin(rad) + (t.y - s.y) * math.cos(rad) + s.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 main():
    n = int(input())
    a = Point()
    b = Point()

    a.x = 0.0
    a.y = 0.0
    b.x = 100.0
    b.y = 0.0

    print(a.x, a.y)
    koch(n, a, b)
    print(b.x, b.y)
    
             
if __name__ == "__main__":
    main() import math math class Point:
    def __init__(self):
        self.x = None
        self.y = None Point def __init__(self):
        self.x = None
        self.y = None __init__ self.x = None self.x self x None self.y = None self.y self y None self self def koch(d, p1, p2):
    if d == 0:
        return

    s = Point()
    u = Point()
    t = Point()
    rad = math.radians(60)

    s.x = (2 * p1.x + 1 * p2.x) / 3
    s.y = (2 * p1.y + 1 * p2.y) / 3
    t.x = (1 * p1.x + 2 * p2.x) / 3
    t.y = (1 * p1.y + 2 * p2.y) / 3
    u.x = (t.x - s.x) * math.cos(rad) - (t.y - s.y) * math.sin(rad) + s.x
    u.y = (t.x - s.x) * math.sin(rad) + (t.y - s.y) * math.cos(rad) + s.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 s = Point() s Point() Point u = Point() u Point() Point t = Point() t Point() Point rad = math.radians(60) rad math.radians(60) math.radians math radians 60 s.x = (2 * p1.x + 1 * p2.x) / 3 s.x s x (2 * p1.x + 1 * p2.x) / 3 2 * p1.x + 1 * p2.x 2 * p1.x 2 p1.x p1 x 1 * p2.x 1 p2.x p2 x 3 s.y = (2 * p1.y + 1 * p2.y) / 3 s.y s y (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.x = (1 * p1.x + 2 * p2.x) / 3 t.x t x (1 * p1.x + 2 * p2.x) / 3 1 * p1.x + 2 * p2.x 1 * p1.x 1 p1.x p1 x 2 * p2.x 2 p2.x p2 x 3 t.y = (1 * p1.y + 2 * p2.y) / 3 t.y t y (1 * p1.y + 2 * p2.y) / 3 1 * p1.y + 2 * p2.y 1 * p1.y 1 p1.y p1 y 2 * p2.y 2 p2.y p2 y 3 u.x = (t.x - s.x) * math.cos(rad) - (t.y - s.y) * math.sin(rad) + s.x u.x u x (t.x - s.x) * math.cos(rad) - (t.y - s.y) * math.sin(rad) + s.x (t.x - s.x) * math.cos(rad) - (t.y - s.y) * math.sin(rad) (t.x - s.x) * math.cos(rad) t.x - s.x t.x t x s.x s x math.cos(rad) math.cos math cos rad (t.y - s.y) * math.sin(rad) t.y - s.y t.y t y s.y s y math.sin(rad) math.sin math sin rad s.x s x u.y = (t.x - s.x) * math.sin(rad) + (t.y - s.y) * math.cos(rad) + s.y u.y u y (t.x - s.x) * math.sin(rad) + (t.y - s.y) * math.cos(rad) + s.y (t.x - s.x) * math.sin(rad) + (t.y - s.y) * math.cos(rad) (t.x - s.x) * math.sin(rad) t.x - s.x t.x t x s.x s x math.sin(rad) math.sin math sin rad (t.y - s.y) * math.cos(rad) t.y - s.y t.y t y s.y s y math.cos(rad) math.cos math cos rad 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 def main():
    n = int(input())
    a = Point()
    b = Point()

    a.x = 0.0
    a.y = 0.0
    b.x = 100.0
    b.y = 0.0

    print(a.x, a.y)
    koch(n, a, b)
    print(b.x, b.y)
    
              main n = int(input()) n int(input()) int input() input a = Point() a Point() Point b = Point() b Point() Point a.x = 0.0 a.x a x 0.0 a.y = 0.0 a.y a y 0.0 b.x = 100.0 b.x b x 100.0 b.y = 0.0 b.y b y 0.0 print(a.x, a.y) print a.x a x a.y a y koch(n, a, b) koch n a b print(b.x, b.y) print b.x b x b.y b y if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main class Point:
    def __init__(self):
        self.x = None
        self.y = None class Point:
    def __init__(self):
        self.x = None
        self.y = None Point def koch(d, p1, p2):
    if d == 0:
        return

    s = Point()
    u = Point()
    t = Point()
    rad = math.radians(60)

    s.x = (2 * p1.x + 1 * p2.x) / 3
    s.y = (2 * p1.y + 1 * p2.y) / 3
    t.x = (1 * p1.x + 2 * p2.x) / 3
    t.y = (1 * p1.y + 2 * p2.y) / 3
    u.x = (t.x - s.x) * math.cos(rad) - (t.y - s.y) * math.sin(rad) + s.x
    u.y = (t.x - s.x) * math.sin(rad) + (t.y - s.y) * math.cos(rad) + s.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

    s = Point()
    u = Point()
    t = Point()
    rad = math.radians(60)

    s.x = (2 * p1.x + 1 * p2.x) / 3
    s.y = (2 * p1.y + 1 * p2.y) / 3
    t.x = (1 * p1.x + 2 * p2.x) / 3
    t.y = (1 * p1.y + 2 * p2.y) / 3
    u.x = (t.x - s.x) * math.cos(rad) - (t.y - s.y) * math.sin(rad) + s.x
    u.y = (t.x - s.x) * math.sin(rad) + (t.y - s.y) * math.cos(rad) + s.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 def main():
    n = int(input())
    a = Point()
    b = Point()

    a.x = 0.0
    a.y = 0.0
    b.x = 100.0
    b.y = 0.0

    print(a.x, a.y)
    koch(n, a, b)
    print(b.x, b.y)
    
              def main():
    n = int(input())
    a = Point()
    b = Point()

    a.x = 0.0
    a.y = 0.0
    b.x = 100.0
    b.y = 0.0

    print(a.x, a.y)
    koch(n, a, b)
    print(b.x, b.y)
    
              main
import math

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

def koch(d, p1, p2):
    if d == 0:
        return

    s = Point()
    u = Point()
    t = Point()
    rad = math.radians(60)

    s.x = (2 * p1.x + 1 * p2.x) / 3
    s.y = (2 * p1.y + 1 * p2.y) / 3
    t.x = (1 * p1.x + 2 * p2.x) / 3
    t.y = (1 * p1.y + 2 * p2.y) / 3
    u.x = (t.x - s.x) * math.cos(rad) - (t.y - s.y) * math.sin(rad) + s.x
    u.y = (t.x - s.x) * math.sin(rad) + (t.y - s.y) * math.cos(rad) + s.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 main():
    n = int(input())
    a = Point()
    b = Point()

    a.x = 0.0
    a.y = 0.0
    b.x = 100.0
    b.y = 0.0

    print(a.x, a.y)
    koch(n, a, b)
    print(b.x, b.y)
    
             
if __name__ == "__main__":
    main()
