# coding: utf-8
import math as m
N = int(input())

# フラクタルのステップをnとする
# 端点p1, p2を与えてs, t, uを計算
class Point(object):
    def __init__(self, x, y):
        self.x = x
        self.y = y
    
def rotateX(s, t, theta):
    return m.cos(theta)*(t.x - s.x) - m.sin(theta)*(t.y - s.y) + s.x

def rotateY(s, t, theta):
    return m.sin(theta)*(t.x - s.x) + m.cos(theta)*(t.y - s.y) + s.y
    
def koch(n, p1, p2):
    if n == 0:
        return
    # p1, p2からs, t, uを求める
    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)
    u = Point(rotateX(s, t, m.pi/3), rotateY(s, t, m.pi/3))
    
    # 各辺に対しても同様にs, t, uを求める
    # printの順番に注意
    koch(n-1, p1, s)
    print("{0:.8f} {1:.8f}".format(s.x, s.y))
    koch(n-1, s, u)
    print("{0:.8f} {1:.8f}".format(u.x, u.y))
    koch(n-1, u, t)
    print("{0:.8f} {1:.8f}".format(t.x, t.y))
    koch(n-1, t, p2)

p1 = Point(0, 0)
p2 = Point(100, 0)
print("{0:.8f} {1:.8f}".format(p1.x, p1.y))
koch(N, p1, p2)
print("{0:.8f} {1:.8f}".format(p2.x, p2.y)) import math as m math N = int(input()) N int(input()) int input() input class Point(object):
    def __init__(self, x, y):
        self.x = x
        self.y = y
     Point def __init__(self, x, y):
        self.x = x
        self.y = y
     __init__ self.x = x self.x self x x self.y = y self.y self y y self self x x y y object def rotateX(s, t, theta):
    return m.cos(theta)*(t.x - s.x) - m.sin(theta)*(t.y - s.y) + s.x rotateX return m.cos(theta)*(t.x - s.x) - m.sin(theta)*(t.y - s.y) + s.x m.cos(theta)*(t.x - s.x) - m.sin(theta)*(t.y - s.y) + s.x m.cos(theta)*(t.x - s.x) - m.sin(theta)*(t.y - s.y) m.cos(theta)*(t.x - s.x) m.cos(theta) m.cos m cos theta t.x - s.x t.x t x s.x s x m.sin(theta)*(t.y - s.y) m.sin(theta) m.sin m sin theta t.y - s.y t.y t y s.y s y s.x s x s s t t theta theta def rotateY(s, t, theta):
    return m.sin(theta)*(t.x - s.x) + m.cos(theta)*(t.y - s.y) + s.y
     rotateY return m.sin(theta)*(t.x - s.x) + m.cos(theta)*(t.y - s.y) + s.y m.sin(theta)*(t.x - s.x) + m.cos(theta)*(t.y - s.y) + s.y m.sin(theta)*(t.x - s.x) + m.cos(theta)*(t.y - s.y) m.sin(theta)*(t.x - s.x) m.sin(theta) m.sin m sin theta t.x - s.x t.x t x s.x s x m.cos(theta)*(t.y - s.y) m.cos(theta) m.cos m cos theta t.y - s.y t.y t y s.y s y s.y s y s s t t theta theta def koch(n, p1, p2):
    if n == 0:
        return
    # p1, p2からs, t, uを求める
    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)
    u = Point(rotateX(s, t, m.pi/3), rotateY(s, t, m.pi/3))
    
    # 各辺に対しても同様にs, t, uを求める
    # printの順番に注意
    koch(n-1, p1, s)
    print("{0:.8f} {1:.8f}".format(s.x, s.y))
    koch(n-1, s, u)
    print("{0:.8f} {1:.8f}".format(u.x, u.y))
    koch(n-1, u, t)
    print("{0:.8f} {1:.8f}".format(t.x, t.y))
    koch(n-1, t, p2) koch if n == 0:
        return
    # p1, p2からs, t, uを求める
     n == 0 n 0 return 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 u = Point(rotateX(s, t, m.pi/3), rotateY(s, t, m.pi/3)) u Point(rotateX(s, t, m.pi/3), rotateY(s, t, m.pi/3)) Point rotateX(s, t, m.pi/3) rotateX s t m.pi/3 m.pi m pi 3 rotateY(s, t, m.pi/3) rotateY s t m.pi/3 m.pi m pi 3 koch(n-1, p1, s) koch n-1 n 1 p1 s print("{0:.8f} {1:.8f}".format(s.x, s.y)) print "{0:.8f} {1:.8f}".format(s.x, s.y) "{0:.8f} {1:.8f}".format "{0:.8f} {1:.8f}" format s.x s x s.y s y koch(n-1, s, u) koch n-1 n 1 s u print("{0:.8f} {1:.8f}".format(u.x, u.y)) print "{0:.8f} {1:.8f}".format(u.x, u.y) "{0:.8f} {1:.8f}".format "{0:.8f} {1:.8f}" format u.x u x u.y u y koch(n-1, u, t) koch n-1 n 1 u t print("{0:.8f} {1:.8f}".format(t.x, t.y)) print "{0:.8f} {1:.8f}".format(t.x, t.y) "{0:.8f} {1:.8f}".format "{0:.8f} {1:.8f}" 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 p1 = Point(0, 0) p1 Point(0, 0) Point 0 0 p2 = Point(100, 0) p2 Point(100, 0) Point 100 0 print("{0:.8f} {1:.8f}".format(p1.x, p1.y)) print "{0:.8f} {1:.8f}".format(p1.x, p1.y) "{0:.8f} {1:.8f}".format "{0:.8f} {1:.8f}" format p1.x p1 x p1.y p1 y koch(N, p1, p2) koch N p1 p2 print("{0:.8f} {1:.8f}".format(p2.x, p2.y)) print "{0:.8f} {1:.8f}".format(p2.x, p2.y) "{0:.8f} {1:.8f}".format "{0:.8f} {1:.8f}" format p2.x p2 x p2.y p2 y p2 = Point(100, 0) Point(100, 0) p2 def koch(n, p1, p2):
    if n == 0:
        return
    # p1, p2からs, t, uを求める
    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)
    u = Point(rotateX(s, t, m.pi/3), rotateY(s, t, m.pi/3))
    
    # 各辺に対しても同様にs, t, uを求める
    # printの順番に注意
    koch(n-1, p1, s)
    print("{0:.8f} {1:.8f}".format(s.x, s.y))
    koch(n-1, s, u)
    print("{0:.8f} {1:.8f}".format(u.x, u.y))
    koch(n-1, u, t)
    print("{0:.8f} {1:.8f}".format(t.x, t.y))
    koch(n-1, t, p2) def koch(n, p1, p2):
    if n == 0:
        return
    # p1, p2からs, t, uを求める
    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)
    u = Point(rotateX(s, t, m.pi/3), rotateY(s, t, m.pi/3))
    
    # 各辺に対しても同様にs, t, uを求める
    # printの順番に注意
    koch(n-1, p1, s)
    print("{0:.8f} {1:.8f}".format(s.x, s.y))
    koch(n-1, s, u)
    print("{0:.8f} {1:.8f}".format(u.x, u.y))
    koch(n-1, u, t)
    print("{0:.8f} {1:.8f}".format(t.x, t.y))
    koch(n-1, t, p2) koch def rotateX(s, t, theta):
    return m.cos(theta)*(t.x - s.x) - m.sin(theta)*(t.y - s.y) + s.x def rotateX(s, t, theta):
    return m.cos(theta)*(t.x - s.x) - m.sin(theta)*(t.y - s.y) + s.x rotateX N = int(input()) int(input()) N class Point(object):
    def __init__(self, x, y):
        self.x = x
        self.y = y
     class Point(object):
    def __init__(self, x, y):
        self.x = x
        self.y = y
     Point p1 = Point(0, 0) Point(0, 0) p1 def rotateY(s, t, theta):
    return m.sin(theta)*(t.x - s.x) + m.cos(theta)*(t.y - s.y) + s.y
     def rotateY(s, t, theta):
    return m.sin(theta)*(t.x - s.x) + m.cos(theta)*(t.y - s.y) + s.y
     rotateY
# coding: utf-8
import math as m
N = int(input())

# フラクタルのステップをnとする
# 端点p1, p2を与えてs, t, uを計算
class Point(object):
    def __init__(self, x, y):
        self.x = x
        self.y = y
    
def rotateX(s, t, theta):
    return m.cos(theta)*(t.x - s.x) - m.sin(theta)*(t.y - s.y) + s.x

def rotateY(s, t, theta):
    return m.sin(theta)*(t.x - s.x) + m.cos(theta)*(t.y - s.y) + s.y
    
def koch(n, p1, p2):
    if n == 0:
        return
    # p1, p2からs, t, uを求める
    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)
    u = Point(rotateX(s, t, m.pi/3), rotateY(s, t, m.pi/3))
    
    # 各辺に対しても同様にs, t, uを求める
    # printの順番に注意
    koch(n-1, p1, s)
    print("{0:.8f} {1:.8f}".format(s.x, s.y))
    koch(n-1, s, u)
    print("{0:.8f} {1:.8f}".format(u.x, u.y))
    koch(n-1, u, t)
    print("{0:.8f} {1:.8f}".format(t.x, t.y))
    koch(n-1, t, p2)

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