"""
コッホ曲線を構成する
numpyは使えないっぽい
"""
import math

class Point: 
    #こうすると見やすくなるっぽいけどそうするんだったらPoint(,)の形で全部書いていくと良い
    def __init__(self, x, y):
        self.x = x
        self.y = y


def outPut(point):
    print("%.8f %.8f"%(point.x, point.y))

def calc(depth, left, right):
    dif_x = right.x-left.x
    dif_y = right.y-left.y

    nleft_x = left.x+dif_x/3
    nleft_y = left.y+dif_y/3

    nright_x = right.x-dif_x/3
    nright_y = right.y-dif_y/3

    #dif/3を回転させる
    top_x = (dif_x*math.cos(math.pi/3)-dif_y*math.sin(math.pi/3))/3+nleft_x
    top_y = (dif_x*math.sin(math.pi/3)+dif_y*math.cos(math.pi/3))/3+nleft_y

    new_left = Point(nleft_x, nleft_y)
    new_right = Point(nright_x, nright_y)
    tmp_top = Point(top_x, top_y)

    if depth > 1:
        calc(depth-1, left, new_left)
        calc(depth-1, new_left, tmp_top)
        calc(depth-1, tmp_top, new_right)
        calc(depth-1, new_right, right)
    else: #depth==1が停止条件
        outPut(left)
        outPut(new_left)
        outPut(tmp_top)
        outPut(new_right) #rightは抜いてある

n = int(input())
start = Point(0, 0)
end = Point(100, 0)

if n == 0:
    outPut(start)
    outPut(end)
else:
    calc(n, start, end)
    outPut(end)

    
                        


 """
コッホ曲線を構成する
numpyは使えないっぽい
""" import math math class Point: 
    #こうすると見やすくなるっぽいけどそうするんだったらPoint(,)の形で全部書いていくと良い
    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 def outPut(point):
    print("%.8f %.8f"%(point.x, point.y)) outPut print("%.8f %.8f"%(point.x, point.y)) print "%.8f %.8f"%(point.x, point.y) "%.8f %.8f" (point.x, point.y) point.x point x point.y point y point point def calc(depth, left, right):
    dif_x = right.x-left.x
    dif_y = right.y-left.y

    nleft_x = left.x+dif_x/3
    nleft_y = left.y+dif_y/3

    nright_x = right.x-dif_x/3
    nright_y = right.y-dif_y/3

    #dif/3を回転させる
    top_x = (dif_x*math.cos(math.pi/3)-dif_y*math.sin(math.pi/3))/3+nleft_x
    top_y = (dif_x*math.sin(math.pi/3)+dif_y*math.cos(math.pi/3))/3+nleft_y

    new_left = Point(nleft_x, nleft_y)
    new_right = Point(nright_x, nright_y)
    tmp_top = Point(top_x, top_y)

    if depth > 1:
        calc(depth-1, left, new_left)
        calc(depth-1, new_left, tmp_top)
        calc(depth-1, tmp_top, new_right)
        calc(depth-1, new_right, right)
    else: #depth==1が停止条件
        outPut(left)
        outPut(new_left)
        outPut(tmp_top)
        outPut(new_right) #rightは抜いてある calc dif_x = right.x-left.x dif_x right.x-left.x right.x right x left.x left x dif_y = right.y-left.y dif_y right.y-left.y right.y right y left.y left y nleft_x = left.x+dif_x/3 nleft_x left.x+dif_x/3 left.x left x dif_x/3 dif_x 3 nleft_y = left.y+dif_y/3 nleft_y left.y+dif_y/3 left.y left y dif_y/3 dif_y 3 nright_x = right.x-dif_x/3 nright_x right.x-dif_x/3 right.x right x dif_x/3 dif_x 3 nright_y = right.y-dif_y/3 nright_y right.y-dif_y/3 right.y right y dif_y/3 dif_y 3 top_x = (dif_x*math.cos(math.pi/3)-dif_y*math.sin(math.pi/3))/3+nleft_x top_x (dif_x*math.cos(math.pi/3)-dif_y*math.sin(math.pi/3))/3+nleft_x (dif_x*math.cos(math.pi/3)-dif_y*math.sin(math.pi/3))/3 dif_x*math.cos(math.pi/3)-dif_y*math.sin(math.pi/3) dif_x*math.cos(math.pi/3) dif_x math.cos(math.pi/3) math.cos math cos math.pi/3 math.pi math pi 3 dif_y*math.sin(math.pi/3) dif_y math.sin(math.pi/3) math.sin math sin math.pi/3 math.pi math pi 3 3 nleft_x top_y = (dif_x*math.sin(math.pi/3)+dif_y*math.cos(math.pi/3))/3+nleft_y top_y (dif_x*math.sin(math.pi/3)+dif_y*math.cos(math.pi/3))/3+nleft_y (dif_x*math.sin(math.pi/3)+dif_y*math.cos(math.pi/3))/3 dif_x*math.sin(math.pi/3)+dif_y*math.cos(math.pi/3) dif_x*math.sin(math.pi/3) dif_x math.sin(math.pi/3) math.sin math sin math.pi/3 math.pi math pi 3 dif_y*math.cos(math.pi/3) dif_y math.cos(math.pi/3) math.cos math cos math.pi/3 math.pi math pi 3 3 nleft_y new_left = Point(nleft_x, nleft_y) new_left Point(nleft_x, nleft_y) Point nleft_x nleft_y new_right = Point(nright_x, nright_y) new_right Point(nright_x, nright_y) Point nright_x nright_y tmp_top = Point(top_x, top_y) tmp_top Point(top_x, top_y) Point top_x top_y if depth > 1:
        calc(depth-1, left, new_left)
        calc(depth-1, new_left, tmp_top)
        calc(depth-1, tmp_top, new_right)
        calc(depth-1, new_right, right)
    else: #depth==1が停止条件
        outPut(left)
        outPut(new_left)
        outPut(tmp_top)
        outPut(new_right) #rightは抜いてある depth > 1 depth 1 calc(depth-1, left, new_left) calc depth-1 depth 1 left new_left calc(depth-1, new_left, tmp_top) calc depth-1 depth 1 new_left tmp_top calc(depth-1, tmp_top, new_right) calc depth-1 depth 1 tmp_top new_right calc(depth-1, new_right, right) calc depth-1 depth 1 new_right right outPut(left) outPut left outPut(new_left) outPut new_left outPut(tmp_top) outPut tmp_top outPut(new_right) outPut new_right depth depth left left right right n = int(input()) n int(input()) int input() input start = Point(0, 0) start Point(0, 0) Point 0 0 end = Point(100, 0) end Point(100, 0) Point 100 0 if n == 0:
    outPut(start)
    outPut(end)
else:
    calc(n, start, end)
    outPut(end)

    
                         n == 0 n 0 outPut(start) outPut start outPut(end) outPut end calc(n, start, end) calc n start end outPut(end) outPut end def outPut(point):
    print("%.8f %.8f"%(point.x, point.y)) def outPut(point):
    print("%.8f %.8f"%(point.x, point.y)) outPut def calc(depth, left, right):
    dif_x = right.x-left.x
    dif_y = right.y-left.y

    nleft_x = left.x+dif_x/3
    nleft_y = left.y+dif_y/3

    nright_x = right.x-dif_x/3
    nright_y = right.y-dif_y/3

    #dif/3を回転させる
    top_x = (dif_x*math.cos(math.pi/3)-dif_y*math.sin(math.pi/3))/3+nleft_x
    top_y = (dif_x*math.sin(math.pi/3)+dif_y*math.cos(math.pi/3))/3+nleft_y

    new_left = Point(nleft_x, nleft_y)
    new_right = Point(nright_x, nright_y)
    tmp_top = Point(top_x, top_y)

    if depth > 1:
        calc(depth-1, left, new_left)
        calc(depth-1, new_left, tmp_top)
        calc(depth-1, tmp_top, new_right)
        calc(depth-1, new_right, right)
    else: #depth==1が停止条件
        outPut(left)
        outPut(new_left)
        outPut(tmp_top)
        outPut(new_right) #rightは抜いてある def calc(depth, left, right):
    dif_x = right.x-left.x
    dif_y = right.y-left.y

    nleft_x = left.x+dif_x/3
    nleft_y = left.y+dif_y/3

    nright_x = right.x-dif_x/3
    nright_y = right.y-dif_y/3

    #dif/3を回転させる
    top_x = (dif_x*math.cos(math.pi/3)-dif_y*math.sin(math.pi/3))/3+nleft_x
    top_y = (dif_x*math.sin(math.pi/3)+dif_y*math.cos(math.pi/3))/3+nleft_y

    new_left = Point(nleft_x, nleft_y)
    new_right = Point(nright_x, nright_y)
    tmp_top = Point(top_x, top_y)

    if depth > 1:
        calc(depth-1, left, new_left)
        calc(depth-1, new_left, tmp_top)
        calc(depth-1, tmp_top, new_right)
        calc(depth-1, new_right, right)
    else: #depth==1が停止条件
        outPut(left)
        outPut(new_left)
        outPut(tmp_top)
        outPut(new_right) #rightは抜いてある calc end = Point(100, 0) Point(100, 0) end n = int(input()) int(input()) n start = Point(0, 0) Point(0, 0) start class Point: 
    #こうすると見やすくなるっぽいけどそうするんだったらPoint(,)の形で全部書いていくと良い
    def __init__(self, x, y):
        self.x = x
        self.y = y class Point: 
    #こうすると見やすくなるっぽいけどそうするんだったらPoint(,)の形で全部書いていくと良い
    def __init__(self, x, y):
        self.x = x
        self.y = y Point
"""
コッホ曲線を構成する
numpyは使えないっぽい
"""
import math

class Point: 
    #こうすると見やすくなるっぽいけどそうするんだったらPoint(,)の形で全部書いていくと良い
    def __init__(self, x, y):
        self.x = x
        self.y = y


def outPut(point):
    print("%.8f %.8f"%(point.x, point.y))

def calc(depth, left, right):
    dif_x = right.x-left.x
    dif_y = right.y-left.y

    nleft_x = left.x+dif_x/3
    nleft_y = left.y+dif_y/3

    nright_x = right.x-dif_x/3
    nright_y = right.y-dif_y/3

    #dif/3を回転させる
    top_x = (dif_x*math.cos(math.pi/3)-dif_y*math.sin(math.pi/3))/3+nleft_x
    top_y = (dif_x*math.sin(math.pi/3)+dif_y*math.cos(math.pi/3))/3+nleft_y

    new_left = Point(nleft_x, nleft_y)
    new_right = Point(nright_x, nright_y)
    tmp_top = Point(top_x, top_y)

    if depth > 1:
        calc(depth-1, left, new_left)
        calc(depth-1, new_left, tmp_top)
        calc(depth-1, tmp_top, new_right)
        calc(depth-1, new_right, right)
    else: #depth==1が停止条件
        outPut(left)
        outPut(new_left)
        outPut(tmp_top)
        outPut(new_right) #rightは抜いてある

n = int(input())
start = Point(0, 0)
end = Point(100, 0)

if n == 0:
    outPut(start)
    outPut(end)
else:
    calc(n, start, end)
    outPut(end)

    
                        



