import math

class dot():
    def __init__(self, x, y):
        self.x = x
        self.y = y


def koch(n, p1, p2):
    if n != 0:
        r = 60.0*math.pi/180.0

        x = (2.0*p1.x+1.0*p2.x)/3.0
        y = (2.0*p1.y+1.0*p2.y)/3.0
        s = dot(x, y)

        x = (1.0*p1.x+2.0*p2.x)/3.0
        y = (1.0*p1.y+2.0*p2.y)/3.0
        t = dot(x, y)

        x = (t.x-s.x)*math.cos(r) - (t.y-s.y)*math.sin(r) + s.x
        y = (t.x-s.x)*math.sin(r) + (t.y-s.y)*math.cos(r) + s.y
        u = dot(x, y)

        koch(n-1, p1, s)
        print(s.x, ' ', s.y)
        koch(n-1, s, u)
        print(u.x, ' ', u.y)
        koch(n-1, u, t)
        print(t.x, ' ', t.y)
        koch(n-1, t, p2)


p1 = dot(0.0, 0.0)
p2 = dot(100.0, 0.0)
n = int(input())

print(p1.x, ' ', p1.y)
koch(n, p1, p2)
print(p2.x, ' ', p2.y)
 import math math class dot():
    def __init__(self, x, y):
        self.x = x
        self.y = y dot 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 def koch(n, p1, p2):
    if n != 0:
        r = 60.0*math.pi/180.0

        x = (2.0*p1.x+1.0*p2.x)/3.0
        y = (2.0*p1.y+1.0*p2.y)/3.0
        s = dot(x, y)

        x = (1.0*p1.x+2.0*p2.x)/3.0
        y = (1.0*p1.y+2.0*p2.y)/3.0
        t = dot(x, y)

        x = (t.x-s.x)*math.cos(r) - (t.y-s.y)*math.sin(r) + s.x
        y = (t.x-s.x)*math.sin(r) + (t.y-s.y)*math.cos(r) + s.y
        u = dot(x, y)

        koch(n-1, p1, s)
        print(s.x, ' ', s.y)
        koch(n-1, s, u)
        print(u.x, ' ', u.y)
        koch(n-1, u, t)
        print(t.x, ' ', t.y)
        koch(n-1, t, p2) koch if n != 0:
        r = 60.0*math.pi/180.0

        x = (2.0*p1.x+1.0*p2.x)/3.0
        y = (2.0*p1.y+1.0*p2.y)/3.0
        s = dot(x, y)

        x = (1.0*p1.x+2.0*p2.x)/3.0
        y = (1.0*p1.y+2.0*p2.y)/3.0
        t = dot(x, y)

        x = (t.x-s.x)*math.cos(r) - (t.y-s.y)*math.sin(r) + s.x
        y = (t.x-s.x)*math.sin(r) + (t.y-s.y)*math.cos(r) + s.y
        u = dot(x, y)

        koch(n-1, p1, s)
        print(s.x, ' ', s.y)
        koch(n-1, s, u)
        print(u.x, ' ', u.y)
        koch(n-1, u, t)
        print(t.x, ' ', t.y)
        koch(n-1, t, p2) n != 0 n 0 r = 60.0*math.pi/180.0 r 60.0*math.pi/180.0 60.0*math.pi 60.0 math.pi math pi 180.0 x = (2.0*p1.x+1.0*p2.x)/3.0 x (2.0*p1.x+1.0*p2.x)/3.0 2.0*p1.x+1.0*p2.x 2.0*p1.x 2.0 p1.x p1 x 1.0*p2.x 1.0 p2.x p2 x 3.0 y = (2.0*p1.y+1.0*p2.y)/3.0 y (2.0*p1.y+1.0*p2.y)/3.0 2.0*p1.y+1.0*p2.y 2.0*p1.y 2.0 p1.y p1 y 1.0*p2.y 1.0 p2.y p2 y 3.0 s = dot(x, y) s dot(x, y) dot x y x = (1.0*p1.x+2.0*p2.x)/3.0 x (1.0*p1.x+2.0*p2.x)/3.0 1.0*p1.x+2.0*p2.x 1.0*p1.x 1.0 p1.x p1 x 2.0*p2.x 2.0 p2.x p2 x 3.0 y = (1.0*p1.y+2.0*p2.y)/3.0 y (1.0*p1.y+2.0*p2.y)/3.0 1.0*p1.y+2.0*p2.y 1.0*p1.y 1.0 p1.y p1 y 2.0*p2.y 2.0 p2.y p2 y 3.0 t = dot(x, y) t dot(x, y) dot x y x = (t.x-s.x)*math.cos(r) - (t.y-s.y)*math.sin(r) + s.x x (t.x-s.x)*math.cos(r) - (t.y-s.y)*math.sin(r) + s.x (t.x-s.x)*math.cos(r) - (t.y-s.y)*math.sin(r) (t.x-s.x)*math.cos(r) t.x-s.x t.x t x s.x s x math.cos(r) math.cos math cos r (t.y-s.y)*math.sin(r) t.y-s.y t.y t y s.y s y math.sin(r) math.sin math sin r s.x s x y = (t.x-s.x)*math.sin(r) + (t.y-s.y)*math.cos(r) + s.y y (t.x-s.x)*math.sin(r) + (t.y-s.y)*math.cos(r) + s.y (t.x-s.x)*math.sin(r) + (t.y-s.y)*math.cos(r) (t.x-s.x)*math.sin(r) t.x-s.x t.x t x s.x s x math.sin(r) math.sin math sin r (t.y-s.y)*math.cos(r) t.y-s.y t.y t y s.y s y math.cos(r) math.cos math cos r s.y s y u = dot(x, y) u dot(x, y) dot x y koch(n-1, p1, s) koch n-1 n 1 p1 s print(s.x, ' ', s.y) print s.x s x ' ' s.y s y koch(n-1, s, u) koch n-1 n 1 s u print(u.x, ' ', u.y) print u.x u x ' ' u.y u y koch(n-1, u, t) koch n-1 n 1 u t print(t.x, ' ', t.y) print 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 = dot(0.0, 0.0) p1 dot(0.0, 0.0) dot 0.0 0.0 p2 = dot(100.0, 0.0) p2 dot(100.0, 0.0) dot 100.0 0.0 n = int(input()) n int(input()) int input() input print(p1.x, ' ', p1.y) print p1.x p1 x ' ' p1.y p1 y koch(n, p1, p2) koch n p1 p2 print(p2.x, ' ', p2.y) print p2.x p2 x ' ' p2.y p2 y n = int(input()) int(input()) n def koch(n, p1, p2):
    if n != 0:
        r = 60.0*math.pi/180.0

        x = (2.0*p1.x+1.0*p2.x)/3.0
        y = (2.0*p1.y+1.0*p2.y)/3.0
        s = dot(x, y)

        x = (1.0*p1.x+2.0*p2.x)/3.0
        y = (1.0*p1.y+2.0*p2.y)/3.0
        t = dot(x, y)

        x = (t.x-s.x)*math.cos(r) - (t.y-s.y)*math.sin(r) + s.x
        y = (t.x-s.x)*math.sin(r) + (t.y-s.y)*math.cos(r) + s.y
        u = dot(x, y)

        koch(n-1, p1, s)
        print(s.x, ' ', s.y)
        koch(n-1, s, u)
        print(u.x, ' ', u.y)
        koch(n-1, u, t)
        print(t.x, ' ', t.y)
        koch(n-1, t, p2) def koch(n, p1, p2):
    if n != 0:
        r = 60.0*math.pi/180.0

        x = (2.0*p1.x+1.0*p2.x)/3.0
        y = (2.0*p1.y+1.0*p2.y)/3.0
        s = dot(x, y)

        x = (1.0*p1.x+2.0*p2.x)/3.0
        y = (1.0*p1.y+2.0*p2.y)/3.0
        t = dot(x, y)

        x = (t.x-s.x)*math.cos(r) - (t.y-s.y)*math.sin(r) + s.x
        y = (t.x-s.x)*math.sin(r) + (t.y-s.y)*math.cos(r) + s.y
        u = dot(x, y)

        koch(n-1, p1, s)
        print(s.x, ' ', s.y)
        koch(n-1, s, u)
        print(u.x, ' ', u.y)
        koch(n-1, u, t)
        print(t.x, ' ', t.y)
        koch(n-1, t, p2) koch p2 = dot(100.0, 0.0) dot(100.0, 0.0) p2 class dot():
    def __init__(self, x, y):
        self.x = x
        self.y = y class dot():
    def __init__(self, x, y):
        self.x = x
        self.y = y dot p1 = dot(0.0, 0.0) dot(0.0, 0.0) p1
import math

class dot():
    def __init__(self, x, y):
        self.x = x
        self.y = y


def koch(n, p1, p2):
    if n != 0:
        r = 60.0*math.pi/180.0

        x = (2.0*p1.x+1.0*p2.x)/3.0
        y = (2.0*p1.y+1.0*p2.y)/3.0
        s = dot(x, y)

        x = (1.0*p1.x+2.0*p2.x)/3.0
        y = (1.0*p1.y+2.0*p2.y)/3.0
        t = dot(x, y)

        x = (t.x-s.x)*math.cos(r) - (t.y-s.y)*math.sin(r) + s.x
        y = (t.x-s.x)*math.sin(r) + (t.y-s.y)*math.cos(r) + s.y
        u = dot(x, y)

        koch(n-1, p1, s)
        print(s.x, ' ', s.y)
        koch(n-1, s, u)
        print(u.x, ' ', u.y)
        koch(n-1, u, t)
        print(t.x, ' ', t.y)
        koch(n-1, t, p2)


p1 = dot(0.0, 0.0)
p2 = dot(100.0, 0.0)
n = int(input())

print(p1.x, ' ', p1.y)
koch(n, p1, p2)
print(p2.x, ' ', p2.y)

