def recKF(p1,p2,n):
    if n != 0:
        a = 1/2
        b = 3**(1/2)/2
        s = Point( p1.x + (p2.x-p1.x)/3, p1.y + (p2.y-p1.y)/3 )
        t = Point( p1.x + (p2.x-p1.x)*2/3, p1.y + (p2.y-p1.y)*2/3 )
        v = Point( t.x-s.x, t.y-s.y )
        rot_v = Point( v.x*a - v.y*b, b*v.x + a*v.y )
        u = Point( rot_v.x + s.x, rot_v.y + s.y)
        recKF(p1,s,n-1)
        print(s.x,s.y)
        recKF(s,u,n-1)
        print(u.x,u.y)
        recKF(u,t,n-1)
        print(t.x,t.y)
        recKF(t,p2,n-1)
        
from collections import namedtuple
Point = namedtuple("Point", ["x","y"])
p1 = Point(0,0)
p2 = Point(100,0)
n = int(input())
print(p1.x,p1.y)
recKF(p1,p2,n)
print(p2.x,p2.y) def recKF(p1,p2,n):
    if n != 0:
        a = 1/2
        b = 3**(1/2)/2
        s = Point( p1.x + (p2.x-p1.x)/3, p1.y + (p2.y-p1.y)/3 )
        t = Point( p1.x + (p2.x-p1.x)*2/3, p1.y + (p2.y-p1.y)*2/3 )
        v = Point( t.x-s.x, t.y-s.y )
        rot_v = Point( v.x*a - v.y*b, b*v.x + a*v.y )
        u = Point( rot_v.x + s.x, rot_v.y + s.y)
        recKF(p1,s,n-1)
        print(s.x,s.y)
        recKF(s,u,n-1)
        print(u.x,u.y)
        recKF(u,t,n-1)
        print(t.x,t.y)
        recKF(t,p2,n-1)
         recKF if n != 0:
        a = 1/2
        b = 3**(1/2)/2
        s = Point( p1.x + (p2.x-p1.x)/3, p1.y + (p2.y-p1.y)/3 )
        t = Point( p1.x + (p2.x-p1.x)*2/3, p1.y + (p2.y-p1.y)*2/3 )
        v = Point( t.x-s.x, t.y-s.y )
        rot_v = Point( v.x*a - v.y*b, b*v.x + a*v.y )
        u = Point( rot_v.x + s.x, rot_v.y + s.y)
        recKF(p1,s,n-1)
        print(s.x,s.y)
        recKF(s,u,n-1)
        print(u.x,u.y)
        recKF(u,t,n-1)
        print(t.x,t.y)
        recKF(t,p2,n-1)
         n != 0 n 0 a = 1/2 a 1/2 1 2 b = 3**(1/2)/2 b 3**(1/2)/2 3**(1/2) 3 1/2 1 2 2 s = Point( p1.x + (p2.x-p1.x)/3, p1.y + (p2.y-p1.y)/3 ) s Point( p1.x + (p2.x-p1.x)/3, p1.y + (p2.y-p1.y)/3 ) Point p1.x + (p2.x-p1.x)/3 p1.x p1 x (p2.x-p1.x)/3 p2.x-p1.x p2.x p2 x p1.x p1 x 3 p1.y + (p2.y-p1.y)/3 p1.y p1 y (p2.y-p1.y)/3 p2.y-p1.y p2.y p2 y p1.y p1 y 3 t = Point( p1.x + (p2.x-p1.x)*2/3, p1.y + (p2.y-p1.y)*2/3 ) t Point( p1.x + (p2.x-p1.x)*2/3, p1.y + (p2.y-p1.y)*2/3 ) Point p1.x + (p2.x-p1.x)*2/3 p1.x p1 x (p2.x-p1.x)*2/3 (p2.x-p1.x)*2 p2.x-p1.x p2.x p2 x p1.x p1 x 2 3 p1.y + (p2.y-p1.y)*2/3 p1.y p1 y (p2.y-p1.y)*2/3 (p2.y-p1.y)*2 p2.y-p1.y p2.y p2 y p1.y p1 y 2 3 v = Point( t.x-s.x, t.y-s.y ) v Point( t.x-s.x, t.y-s.y ) Point t.x-s.x t.x t x s.x s x t.y-s.y t.y t y s.y s y rot_v = Point( v.x*a - v.y*b, b*v.x + a*v.y ) rot_v Point( v.x*a - v.y*b, b*v.x + a*v.y ) Point v.x*a - v.y*b v.x*a v.x v x a v.y*b v.y v y b b*v.x + a*v.y b*v.x b v.x v x a*v.y a v.y v y u = Point( rot_v.x + s.x, rot_v.y + s.y) u Point( rot_v.x + s.x, rot_v.y + s.y) Point rot_v.x + s.x rot_v.x rot_v x s.x s x rot_v.y + s.y rot_v.y rot_v y s.y s y recKF(p1,s,n-1) recKF p1 s n-1 n 1 print(s.x,s.y) print s.x s x s.y s y recKF(s,u,n-1) recKF s u n-1 n 1 print(u.x,u.y) print u.x u x u.y u y recKF(u,t,n-1) recKF u t n-1 n 1 print(t.x,t.y) print t.x t x t.y t y recKF(t,p2,n-1) recKF t p2 n-1 n 1 p1 p1 p2 p2 n n from collections import namedtuple Point = namedtuple("Point", ["x","y"]) Point namedtuple("Point", ["x","y"]) namedtuple "Point" ["x","y"] "x" "y" p1 = Point(0,0) p1 Point(0,0) Point 0 0 p2 = Point(100,0) p2 Point(100,0) Point 100 0 n = int(input()) n int(input()) int input() input print(p1.x,p1.y) print p1.x p1 x p1.y p1 y recKF(p1,p2,n) recKF p1 p2 n print(p2.x,p2.y) print p2.x p2 x p2.y p2 y Point = namedtuple("Point", ["x","y"]) namedtuple("Point", ["x","y"]) Point p2 = Point(100,0) Point(100,0) p2 n = int(input()) int(input()) n p1 = Point(0,0) Point(0,0) p1 def recKF(p1,p2,n):
    if n != 0:
        a = 1/2
        b = 3**(1/2)/2
        s = Point( p1.x + (p2.x-p1.x)/3, p1.y + (p2.y-p1.y)/3 )
        t = Point( p1.x + (p2.x-p1.x)*2/3, p1.y + (p2.y-p1.y)*2/3 )
        v = Point( t.x-s.x, t.y-s.y )
        rot_v = Point( v.x*a - v.y*b, b*v.x + a*v.y )
        u = Point( rot_v.x + s.x, rot_v.y + s.y)
        recKF(p1,s,n-1)
        print(s.x,s.y)
        recKF(s,u,n-1)
        print(u.x,u.y)
        recKF(u,t,n-1)
        print(t.x,t.y)
        recKF(t,p2,n-1)
         def recKF(p1,p2,n):
    if n != 0:
        a = 1/2
        b = 3**(1/2)/2
        s = Point( p1.x + (p2.x-p1.x)/3, p1.y + (p2.y-p1.y)/3 )
        t = Point( p1.x + (p2.x-p1.x)*2/3, p1.y + (p2.y-p1.y)*2/3 )
        v = Point( t.x-s.x, t.y-s.y )
        rot_v = Point( v.x*a - v.y*b, b*v.x + a*v.y )
        u = Point( rot_v.x + s.x, rot_v.y + s.y)
        recKF(p1,s,n-1)
        print(s.x,s.y)
        recKF(s,u,n-1)
        print(u.x,u.y)
        recKF(u,t,n-1)
        print(t.x,t.y)
        recKF(t,p2,n-1)
         recKF
def recKF(p1,p2,n):
    if n != 0:
        a = 1/2
        b = 3**(1/2)/2
        s = Point( p1.x + (p2.x-p1.x)/3, p1.y + (p2.y-p1.y)/3 )
        t = Point( p1.x + (p2.x-p1.x)*2/3, p1.y + (p2.y-p1.y)*2/3 )
        v = Point( t.x-s.x, t.y-s.y )
        rot_v = Point( v.x*a - v.y*b, b*v.x + a*v.y )
        u = Point( rot_v.x + s.x, rot_v.y + s.y)
        recKF(p1,s,n-1)
        print(s.x,s.y)
        recKF(s,u,n-1)
        print(u.x,u.y)
        recKF(u,t,n-1)
        print(t.x,t.y)
        recKF(t,p2,n-1)
        
from collections import namedtuple
Point = namedtuple("Point", ["x","y"])
p1 = Point(0,0)
p2 = Point(100,0)
n = int(input())
print(p1.x,p1.y)
recKF(p1,p2,n)
print(p2.x,p2.y)
