from math import sqrt
from collections import namedtuple

Point = namedtuple('Point', 'x y')

def rot60(p):
    return Point(C60 * p.x - S60 * p.y, S60 * p.x + C60 * p.y)

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

    koch(n - 1, p1, s)
    print(f.format(s.x, s.y))

    koch(n - 1, s, u)
    print(f.format(u.x, u.y))

    koch(n - 1, u, t)
    print(f.format(t.x, t.y))

    koch(n - 1, t, p2)


C60 = 1 / 2
S60 = sqrt(3) / 2
f = '{:8f} {:8f}'

n = int(input())
print(f.format(0, 0))
koch(n, Point(0, 0), Point(100, 0))
print(f.format(100, 0)) from math import sqrt from collections import namedtuple Point = namedtuple('Point', 'x y') Point namedtuple('Point', 'x y') namedtuple 'Point' 'x y' def rot60(p):
    return Point(C60 * p.x - S60 * p.y, S60 * p.x + C60 * p.y) rot60 return Point(C60 * p.x - S60 * p.y, S60 * p.x + C60 * p.y) Point(C60 * p.x - S60 * p.y, S60 * p.x + C60 * p.y) Point C60 * p.x - S60 * p.y C60 * p.x C60 p.x p x S60 * p.y S60 p.y p y S60 * p.x + C60 * p.y S60 * p.x S60 p.x p x C60 * p.y C60 p.y p y p p def koch(n, p1, p2):
    if n == 0: return
    s = Point((2*p1.x + p2.x)/3, (2*p1.y + p2.y)/3)
    t = Point((p1.x + 2*p2.x)/3, (p1.y + 2*p2.y)/3)
    q = rot60(Point((p2.x - p1.x)/3, (p2.y - p1.y)/3))
    u = Point(s.x + q.x, s.y + q.y)

    koch(n - 1, p1, s)
    print(f.format(s.x, s.y))

    koch(n - 1, s, u)
    print(f.format(u.x, u.y))

    koch(n - 1, u, t)
    print(f.format(t.x, t.y))

    koch(n - 1, t, p2) koch if n == 0: return
     n == 0 n 0 s = Point((2*p1.x + p2.x)/3, (2*p1.y + p2.y)/3) s Point((2*p1.x + p2.x)/3, (2*p1.y + 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 + p2.y)/3 2*p1.y + p2.y 2*p1.y 2 p1.y p1 y 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 q = rot60(Point((p2.x - p1.x)/3, (p2.y - p1.y)/3)) q rot60(Point((p2.x - p1.x)/3, (p2.y - p1.y)/3)) rot60 Point((p2.x - p1.x)/3, (p2.y - p1.y)/3) Point (p2.x - p1.x)/3 p2.x - p1.x p2.x p2 x p1.x p1 x 3 (p2.y - p1.y)/3 p2.y - p1.y p2.y p2 y p1.y p1 y 3 u = Point(s.x + q.x, s.y + q.y) u Point(s.x + q.x, s.y + q.y) Point s.x + q.x s.x s x q.x q x s.y + q.y s.y s y q.y q y koch(n - 1, p1, s) koch n - 1 n 1 p1 s print(f.format(s.x, s.y)) print f.format(s.x, s.y) f.format f format s.x s x s.y s y koch(n - 1, s, u) koch n - 1 n 1 s u print(f.format(u.x, u.y)) print f.format(u.x, u.y) f.format f format u.x u x u.y u y koch(n - 1, u, t) koch n - 1 n 1 u t print(f.format(t.x, t.y)) print f.format(t.x, t.y) f.format f format 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 C60 = 1 / 2 C60 1 / 2 1 2 S60 = sqrt(3) / 2 S60 sqrt(3) / 2 sqrt(3) sqrt 3 2 f = '{:8f} {:8f}' f '{:8f} {:8f}' n = int(input()) n int(input()) int input() input print(f.format(0, 0)) print f.format(0, 0) f.format f format 0 0 koch(n, Point(0, 0), Point(100, 0)) koch n Point(0, 0) Point 0 0 Point(100, 0) Point 100 0 print(f.format(100, 0)) print f.format(100, 0) f.format f format 100 0 C60 = 1 / 2 1 / 2 C60 S60 = sqrt(3) / 2 sqrt(3) / 2 S60 def koch(n, p1, p2):
    if n == 0: return
    s = Point((2*p1.x + p2.x)/3, (2*p1.y + p2.y)/3)
    t = Point((p1.x + 2*p2.x)/3, (p1.y + 2*p2.y)/3)
    q = rot60(Point((p2.x - p1.x)/3, (p2.y - p1.y)/3))
    u = Point(s.x + q.x, s.y + q.y)

    koch(n - 1, p1, s)
    print(f.format(s.x, s.y))

    koch(n - 1, s, u)
    print(f.format(u.x, u.y))

    koch(n - 1, u, t)
    print(f.format(t.x, t.y))

    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 + p2.y)/3)
    t = Point((p1.x + 2*p2.x)/3, (p1.y + 2*p2.y)/3)
    q = rot60(Point((p2.x - p1.x)/3, (p2.y - p1.y)/3))
    u = Point(s.x + q.x, s.y + q.y)

    koch(n - 1, p1, s)
    print(f.format(s.x, s.y))

    koch(n - 1, s, u)
    print(f.format(u.x, u.y))

    koch(n - 1, u, t)
    print(f.format(t.x, t.y))

    koch(n - 1, t, p2) koch n = int(input()) int(input()) n Point = namedtuple('Point', 'x y') namedtuple('Point', 'x y') Point f = '{:8f} {:8f}' '{:8f} {:8f}' f def rot60(p):
    return Point(C60 * p.x - S60 * p.y, S60 * p.x + C60 * p.y) def rot60(p):
    return Point(C60 * p.x - S60 * p.y, S60 * p.x + C60 * p.y) rot60
from math import sqrt
from collections import namedtuple

Point = namedtuple('Point', 'x y')

def rot60(p):
    return Point(C60 * p.x - S60 * p.y, S60 * p.x + C60 * p.y)

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

    koch(n - 1, p1, s)
    print(f.format(s.x, s.y))

    koch(n - 1, s, u)
    print(f.format(u.x, u.y))

    koch(n - 1, u, t)
    print(f.format(t.x, t.y))

    koch(n - 1, t, p2)


C60 = 1 / 2
S60 = sqrt(3) / 2
f = '{:8f} {:8f}'

n = int(input())
print(f.format(0, 0))
koch(n, Point(0, 0), Point(100, 0))
print(f.format(100, 0))