import math
import collections

N = int(input())
Point = collections.namedtuple('Point', ['x', 'y'])


def koch(d, p1, p2):
    if d == 0:
        return
    th = math.pi * 60 / 180
    s = Point(x=(2 * p1.x + p2.x) / 3, y=(2 * p1.y + p2.y) / 3)
    t = Point(x=(p1.x + 2 * p2.x) / 3, y=(p1.y + 2 * p2.y) / 3)
    u = Point(x=(t.x - s.x) * math.cos(th) - (t.y - s.y) * math.sin(th) + s.x,
              y=(t.x - s.x) * math.sin(th) + (t.y - s.y) * math.cos(th) + s.y)
    koch(d - 1, p1, s)
    print('{:.8f} {:.8f}'.format(s.x, s.y))
    koch(d - 1, s, u)
    print('{:.8f} {:.8f}'.format(u.x, u.y))
    koch(d - 1, u, t)
    print('{:.8f} {:.8f}'.format(t.x, t.y))
    koch(d - 1, t, p2)


p1 = Point(x=0, y=0)
p2 = Point(x=100, y=0)
print('{:.8f} {:.8f}'.format(p1.x, p1.y))
koch(N, p1, p2)
print('{:.8f} {:.8f}'.format(p2.x, p2.y))
 import math math import collections collections N = int(input()) N int(input()) int input() input Point = collections.namedtuple('Point', ['x', 'y']) Point collections.namedtuple('Point', ['x', 'y']) collections.namedtuple collections namedtuple 'Point' ['x', 'y'] 'x' 'y' def koch(d, p1, p2):
    if d == 0:
        return
    th = math.pi * 60 / 180
    s = Point(x=(2 * p1.x + p2.x) / 3, y=(2 * p1.y + p2.y) / 3)
    t = Point(x=(p1.x + 2 * p2.x) / 3, y=(p1.y + 2 * p2.y) / 3)
    u = Point(x=(t.x - s.x) * math.cos(th) - (t.y - s.y) * math.sin(th) + s.x,
              y=(t.x - s.x) * math.sin(th) + (t.y - s.y) * math.cos(th) + s.y)
    koch(d - 1, p1, s)
    print('{:.8f} {:.8f}'.format(s.x, s.y))
    koch(d - 1, s, u)
    print('{:.8f} {:.8f}'.format(u.x, u.y))
    koch(d - 1, u, t)
    print('{:.8f} {:.8f}'.format(t.x, t.y))
    koch(d - 1, t, p2) koch if d == 0:
        return
     d == 0 d 0 return th = math.pi * 60 / 180 th math.pi * 60 / 180 math.pi * 60 math.pi math pi 60 180 s = Point(x=(2 * p1.x + p2.x) / 3, y=(2 * p1.y + p2.y) / 3) s Point(x=(2 * p1.x + p2.x) / 3, y=(2 * p1.y + p2.y) / 3) Point x=(2 * p1.x + p2.x) / 3 x (2 * p1.x + p2.x) / 3 2 * p1.x + p2.x 2 * p1.x 2 p1.x p1 x p2.x p2 x 3 y=(2 * p1.y + p2.y) / 3 y (2 * p1.y + p2.y) / 3 2 * p1.y + p2.y 2 * p1.y 2 p1.y p1 y p2.y p2 y 3 t = Point(x=(p1.x + 2 * p2.x) / 3, y=(p1.y + 2 * p2.y) / 3) t Point(x=(p1.x + 2 * p2.x) / 3, y=(p1.y + 2 * p2.y) / 3) Point x=(p1.x + 2 * p2.x) / 3 x (p1.x + 2 * p2.x) / 3 p1.x + 2 * p2.x p1.x p1 x 2 * p2.x 2 p2.x p2 x 3 y=(p1.y + 2 * p2.y) / 3 y (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(x=(t.x - s.x) * math.cos(th) - (t.y - s.y) * math.sin(th) + s.x,
              y=(t.x - s.x) * math.sin(th) + (t.y - s.y) * math.cos(th) + s.y) u Point(x=(t.x - s.x) * math.cos(th) - (t.y - s.y) * math.sin(th) + s.x,
              y=(t.x - s.x) * math.sin(th) + (t.y - s.y) * math.cos(th) + s.y) Point x=(t.x - s.x) * math.cos(th) - (t.y - s.y) * math.sin(th) + s.x x (t.x - s.x) * math.cos(th) - (t.y - s.y) * math.sin(th) + s.x (t.x - s.x) * math.cos(th) - (t.y - s.y) * math.sin(th) (t.x - s.x) * math.cos(th) t.x - s.x t.x t x s.x s x math.cos(th) math.cos math cos th (t.y - s.y) * math.sin(th) t.y - s.y t.y t y s.y s y math.sin(th) math.sin math sin th s.x s x y=(t.x - s.x) * math.sin(th) + (t.y - s.y) * math.cos(th) + s.y y (t.x - s.x) * math.sin(th) + (t.y - s.y) * math.cos(th) + s.y (t.x - s.x) * math.sin(th) + (t.y - s.y) * math.cos(th) (t.x - s.x) * math.sin(th) t.x - s.x t.x t x s.x s x math.sin(th) math.sin math sin th (t.y - s.y) * math.cos(th) t.y - s.y t.y t y s.y s y math.cos(th) math.cos math cos th s.y s y koch(d - 1, p1, s) koch d - 1 d 1 p1 s print('{:.8f} {:.8f}'.format(s.x, s.y)) print '{:.8f} {:.8f}'.format(s.x, s.y) '{:.8f} {:.8f}'.format '{:.8f} {:.8f}' format s.x s x s.y s y koch(d - 1, s, u) koch d - 1 d 1 s u print('{:.8f} {:.8f}'.format(u.x, u.y)) print '{:.8f} {:.8f}'.format(u.x, u.y) '{:.8f} {:.8f}'.format '{:.8f} {:.8f}' format u.x u x u.y u y koch(d - 1, u, t) koch d - 1 d 1 u t print('{:.8f} {:.8f}'.format(t.x, t.y)) print '{:.8f} {:.8f}'.format(t.x, t.y) '{:.8f} {:.8f}'.format '{:.8f} {:.8f}' format 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 p1 = Point(x=0, y=0) p1 Point(x=0, y=0) Point x=0 x 0 y=0 y 0 p2 = Point(x=100, y=0) p2 Point(x=100, y=0) Point x=100 x 100 y=0 y 0 print('{:.8f} {:.8f}'.format(p1.x, p1.y)) print '{:.8f} {:.8f}'.format(p1.x, p1.y) '{:.8f} {:.8f}'.format '{:.8f} {:.8f}' format p1.x p1 x p1.y p1 y koch(N, p1, p2) koch N p1 p2 print('{:.8f} {:.8f}'.format(p2.x, p2.y)) print '{:.8f} {:.8f}'.format(p2.x, p2.y) '{:.8f} {:.8f}'.format '{:.8f} {:.8f}' format p2.x p2 x p2.y p2 y p2 = Point(x=100, y=0) Point(x=100, y=0) p2 p1 = Point(x=0, y=0) Point(x=0, y=0) p1 N = int(input()) int(input()) N Point = collections.namedtuple('Point', ['x', 'y']) collections.namedtuple('Point', ['x', 'y']) Point def koch(d, p1, p2):
    if d == 0:
        return
    th = math.pi * 60 / 180
    s = Point(x=(2 * p1.x + p2.x) / 3, y=(2 * p1.y + p2.y) / 3)
    t = Point(x=(p1.x + 2 * p2.x) / 3, y=(p1.y + 2 * p2.y) / 3)
    u = Point(x=(t.x - s.x) * math.cos(th) - (t.y - s.y) * math.sin(th) + s.x,
              y=(t.x - s.x) * math.sin(th) + (t.y - s.y) * math.cos(th) + s.y)
    koch(d - 1, p1, s)
    print('{:.8f} {:.8f}'.format(s.x, s.y))
    koch(d - 1, s, u)
    print('{:.8f} {:.8f}'.format(u.x, u.y))
    koch(d - 1, u, t)
    print('{:.8f} {:.8f}'.format(t.x, t.y))
    koch(d - 1, t, p2) def koch(d, p1, p2):
    if d == 0:
        return
    th = math.pi * 60 / 180
    s = Point(x=(2 * p1.x + p2.x) / 3, y=(2 * p1.y + p2.y) / 3)
    t = Point(x=(p1.x + 2 * p2.x) / 3, y=(p1.y + 2 * p2.y) / 3)
    u = Point(x=(t.x - s.x) * math.cos(th) - (t.y - s.y) * math.sin(th) + s.x,
              y=(t.x - s.x) * math.sin(th) + (t.y - s.y) * math.cos(th) + s.y)
    koch(d - 1, p1, s)
    print('{:.8f} {:.8f}'.format(s.x, s.y))
    koch(d - 1, s, u)
    print('{:.8f} {:.8f}'.format(u.x, u.y))
    koch(d - 1, u, t)
    print('{:.8f} {:.8f}'.format(t.x, t.y))
    koch(d - 1, t, p2) koch
import math
import collections

N = int(input())
Point = collections.namedtuple('Point', ['x', 'y'])


def koch(d, p1, p2):
    if d == 0:
        return
    th = math.pi * 60 / 180
    s = Point(x=(2 * p1.x + p2.x) / 3, y=(2 * p1.y + p2.y) / 3)
    t = Point(x=(p1.x + 2 * p2.x) / 3, y=(p1.y + 2 * p2.y) / 3)
    u = Point(x=(t.x - s.x) * math.cos(th) - (t.y - s.y) * math.sin(th) + s.x,
              y=(t.x - s.x) * math.sin(th) + (t.y - s.y) * math.cos(th) + s.y)
    koch(d - 1, p1, s)
    print('{:.8f} {:.8f}'.format(s.x, s.y))
    koch(d - 1, s, u)
    print('{:.8f} {:.8f}'.format(u.x, u.y))
    koch(d - 1, u, t)
    print('{:.8f} {:.8f}'.format(t.x, t.y))
    koch(d - 1, t, p2)


p1 = Point(x=0, y=0)
p2 = Point(x=100, y=0)
print('{:.8f} {:.8f}'.format(p1.x, p1.y))
koch(N, p1, p2)
print('{:.8f} {:.8f}'.format(p2.x, p2.y))

