import math

class KochCurve:
    def koch(self, d, p1, p2): 
        if d == 0:
            return
        th = math.pi * 60.0 / 180.0
        sx = (2.0 * p1[0] + 1.0 * p2[0]) / 3
        sy = (2.0 * p1[1] + 1.0 * p2[1]) / 3
        s = [sx, sy]
        tx = (1.0 * p1[0] + 2.0 * p2[0]) / 3
        ty = (1.0 * p1[1] + 2.0 * p2[1]) / 3
        t = [tx, ty]
        ux = (tx - sx) * math.cos(th) - (ty - sy) * math.sin(th) + sx
        uy = (tx - sx) * math.sin(th) + (ty - sy) * math.cos(th) + sy
        u = [ux, uy]
        
        self.koch(d-1, p1, s)
        print("{} {}".format(sx, sy))
        
        self.koch(d-1, s, u)
        print("{} {}".format(ux, uy))

        self.koch(d-1, u, t)
        print("{} {}".format(tx, ty))
        
        self.koch(d-1, t, p2)

if __name__ == '__main__':
    n = int(input().rstrip())
    p1 = [0, 0]
    p2 = [100, 0]
    print("{} {}".format(p1[0], p1[1]))
    x = KochCurve()
    x.koch(n, p1, p2)
    print("{} {}".format(p2[0], p2[1])) import math math class KochCurve:
    def koch(self, d, p1, p2): 
        if d == 0:
            return
        th = math.pi * 60.0 / 180.0
        sx = (2.0 * p1[0] + 1.0 * p2[0]) / 3
        sy = (2.0 * p1[1] + 1.0 * p2[1]) / 3
        s = [sx, sy]
        tx = (1.0 * p1[0] + 2.0 * p2[0]) / 3
        ty = (1.0 * p1[1] + 2.0 * p2[1]) / 3
        t = [tx, ty]
        ux = (tx - sx) * math.cos(th) - (ty - sy) * math.sin(th) + sx
        uy = (tx - sx) * math.sin(th) + (ty - sy) * math.cos(th) + sy
        u = [ux, uy]
        
        self.koch(d-1, p1, s)
        print("{} {}".format(sx, sy))
        
        self.koch(d-1, s, u)
        print("{} {}".format(ux, uy))

        self.koch(d-1, u, t)
        print("{} {}".format(tx, ty))
        
        self.koch(d-1, t, p2) KochCurve def koch(self, d, p1, p2): 
        if d == 0:
            return
        th = math.pi * 60.0 / 180.0
        sx = (2.0 * p1[0] + 1.0 * p2[0]) / 3
        sy = (2.0 * p1[1] + 1.0 * p2[1]) / 3
        s = [sx, sy]
        tx = (1.0 * p1[0] + 2.0 * p2[0]) / 3
        ty = (1.0 * p1[1] + 2.0 * p2[1]) / 3
        t = [tx, ty]
        ux = (tx - sx) * math.cos(th) - (ty - sy) * math.sin(th) + sx
        uy = (tx - sx) * math.sin(th) + (ty - sy) * math.cos(th) + sy
        u = [ux, uy]
        
        self.koch(d-1, p1, s)
        print("{} {}".format(sx, sy))
        
        self.koch(d-1, s, u)
        print("{} {}".format(ux, uy))

        self.koch(d-1, u, t)
        print("{} {}".format(tx, ty))
        
        self.koch(d-1, t, p2) koch if d == 0:
            return
         d == 0 d 0 return th = math.pi * 60.0 / 180.0 th math.pi * 60.0 / 180.0 math.pi * 60.0 math.pi math pi 60.0 180.0 sx = (2.0 * p1[0] + 1.0 * p2[0]) / 3 sx (2.0 * p1[0] + 1.0 * p2[0]) / 3 2.0 * p1[0] + 1.0 * p2[0] 2.0 * p1[0] 2.0 p1[0] p1 0 1.0 * p2[0] 1.0 p2[0] p2 0 3 sy = (2.0 * p1[1] + 1.0 * p2[1]) / 3 sy (2.0 * p1[1] + 1.0 * p2[1]) / 3 2.0 * p1[1] + 1.0 * p2[1] 2.0 * p1[1] 2.0 p1[1] p1 1 1.0 * p2[1] 1.0 p2[1] p2 1 3 s = [sx, sy] s [sx, sy] sx sy tx = (1.0 * p1[0] + 2.0 * p2[0]) / 3 tx (1.0 * p1[0] + 2.0 * p2[0]) / 3 1.0 * p1[0] + 2.0 * p2[0] 1.0 * p1[0] 1.0 p1[0] p1 0 2.0 * p2[0] 2.0 p2[0] p2 0 3 ty = (1.0 * p1[1] + 2.0 * p2[1]) / 3 ty (1.0 * p1[1] + 2.0 * p2[1]) / 3 1.0 * p1[1] + 2.0 * p2[1] 1.0 * p1[1] 1.0 p1[1] p1 1 2.0 * p2[1] 2.0 p2[1] p2 1 3 t = [tx, ty] t [tx, ty] tx ty ux = (tx - sx) * math.cos(th) - (ty - sy) * math.sin(th) + sx ux (tx - sx) * math.cos(th) - (ty - sy) * math.sin(th) + sx (tx - sx) * math.cos(th) - (ty - sy) * math.sin(th) (tx - sx) * math.cos(th) tx - sx tx sx math.cos(th) math.cos math cos th (ty - sy) * math.sin(th) ty - sy ty sy math.sin(th) math.sin math sin th sx uy = (tx - sx) * math.sin(th) + (ty - sy) * math.cos(th) + sy uy (tx - sx) * math.sin(th) + (ty - sy) * math.cos(th) + sy (tx - sx) * math.sin(th) + (ty - sy) * math.cos(th) (tx - sx) * math.sin(th) tx - sx tx sx math.sin(th) math.sin math sin th (ty - sy) * math.cos(th) ty - sy ty sy math.cos(th) math.cos math cos th sy u = [ux, uy] u [ux, uy] ux uy self.koch(d-1, p1, s) self.koch self koch d-1 d 1 p1 s print("{} {}".format(sx, sy)) print "{} {}".format(sx, sy) "{} {}".format "{} {}" format sx sy self.koch(d-1, s, u) self.koch self koch d-1 d 1 s u print("{} {}".format(ux, uy)) print "{} {}".format(ux, uy) "{} {}".format "{} {}" format ux uy self.koch(d-1, u, t) self.koch self koch d-1 d 1 u t print("{} {}".format(tx, ty)) print "{} {}".format(tx, ty) "{} {}".format "{} {}" format tx ty self.koch(d-1, t, p2) self.koch self koch d-1 d 1 t p2 self self d d p1 p1 p2 p2 if __name__ == '__main__':
    n = int(input().rstrip())
    p1 = [0, 0]
    p2 = [100, 0]
    print("{} {}".format(p1[0], p1[1]))
    x = KochCurve()
    x.koch(n, p1, p2)
    print("{} {}".format(p2[0], p2[1])) __name__ == '__main__' __name__ '__main__' n = int(input().rstrip()) n int(input().rstrip()) int input().rstrip() ().rstrip () input rstrip p1 = [0, 0] p1 [0, 0] 0 0 p2 = [100, 0] p2 [100, 0] 100 0 print("{} {}".format(p1[0], p1[1])) print "{} {}".format(p1[0], p1[1]) "{} {}".format "{} {}" format p1[0] p1 0 p1[1] p1 1 x = KochCurve() x KochCurve() KochCurve x.koch(n, p1, p2) x.koch x koch n p1 p2 print("{} {}".format(p2[0], p2[1])) print "{} {}".format(p2[0], p2[1]) "{} {}".format "{} {}" format p2[0] p2 0 p2[1] p2 1 class KochCurve:
    def koch(self, d, p1, p2): 
        if d == 0:
            return
        th = math.pi * 60.0 / 180.0
        sx = (2.0 * p1[0] + 1.0 * p2[0]) / 3
        sy = (2.0 * p1[1] + 1.0 * p2[1]) / 3
        s = [sx, sy]
        tx = (1.0 * p1[0] + 2.0 * p2[0]) / 3
        ty = (1.0 * p1[1] + 2.0 * p2[1]) / 3
        t = [tx, ty]
        ux = (tx - sx) * math.cos(th) - (ty - sy) * math.sin(th) + sx
        uy = (tx - sx) * math.sin(th) + (ty - sy) * math.cos(th) + sy
        u = [ux, uy]
        
        self.koch(d-1, p1, s)
        print("{} {}".format(sx, sy))
        
        self.koch(d-1, s, u)
        print("{} {}".format(ux, uy))

        self.koch(d-1, u, t)
        print("{} {}".format(tx, ty))
        
        self.koch(d-1, t, p2) class KochCurve:
    def koch(self, d, p1, p2): 
        if d == 0:
            return
        th = math.pi * 60.0 / 180.0
        sx = (2.0 * p1[0] + 1.0 * p2[0]) / 3
        sy = (2.0 * p1[1] + 1.0 * p2[1]) / 3
        s = [sx, sy]
        tx = (1.0 * p1[0] + 2.0 * p2[0]) / 3
        ty = (1.0 * p1[1] + 2.0 * p2[1]) / 3
        t = [tx, ty]
        ux = (tx - sx) * math.cos(th) - (ty - sy) * math.sin(th) + sx
        uy = (tx - sx) * math.sin(th) + (ty - sy) * math.cos(th) + sy
        u = [ux, uy]
        
        self.koch(d-1, p1, s)
        print("{} {}".format(sx, sy))
        
        self.koch(d-1, s, u)
        print("{} {}".format(ux, uy))

        self.koch(d-1, u, t)
        print("{} {}".format(tx, ty))
        
        self.koch(d-1, t, p2) KochCurve n = int(input().rstrip()) int(input().rstrip()) n x = KochCurve() KochCurve() x p1 = [0, 0] [0, 0] p1 p2 = [100, 0] [100, 0] p2
import math

class KochCurve:
    def koch(self, d, p1, p2): 
        if d == 0:
            return
        th = math.pi * 60.0 / 180.0
        sx = (2.0 * p1[0] + 1.0 * p2[0]) / 3
        sy = (2.0 * p1[1] + 1.0 * p2[1]) / 3
        s = [sx, sy]
        tx = (1.0 * p1[0] + 2.0 * p2[0]) / 3
        ty = (1.0 * p1[1] + 2.0 * p2[1]) / 3
        t = [tx, ty]
        ux = (tx - sx) * math.cos(th) - (ty - sy) * math.sin(th) + sx
        uy = (tx - sx) * math.sin(th) + (ty - sy) * math.cos(th) + sy
        u = [ux, uy]
        
        self.koch(d-1, p1, s)
        print("{} {}".format(sx, sy))
        
        self.koch(d-1, s, u)
        print("{} {}".format(ux, uy))

        self.koch(d-1, u, t)
        print("{} {}".format(tx, ty))
        
        self.koch(d-1, t, p2)

if __name__ == '__main__':
    n = int(input().rstrip())
    p1 = [0, 0]
    p2 = [100, 0]
    print("{} {}".format(p1[0], p1[1]))
    x = KochCurve()
    x.koch(n, p1, p2)
    print("{} {}".format(p2[0], p2[1]))