import math
sqrt3 = math.sqrt(3.0)

def koch_curve(n, i, pt1, pt2, pt_array):
    if i > n:
        return
    pt1x, pt1y = pt1
    pt2x, pt2y = pt2
    pts = (2/3 * pt1x + 1/3 * pt2x, 2/3 * pt1y + 1/3 * pt2y)
    ptt = (1/3 * pt1x + 2/3 * pt2x, 1/3 * pt1y + 2/3 * pt2y)
    ptx = ptt[0] - pts[0]
    pty = ptt[1] - pts[1]
    ptu = (1/2 * (ptx - sqrt3 * pty) + pts[0], 1/2 * (sqrt3 * ptx + pty) + pts[1])

    koch_curve(n, i+1, pt1, pts, pt_array)
    pt_array.append(pts)
    koch_curve(n, i+1, pts, ptu, pt_array)
    pt_array.append(ptu)
    koch_curve(n, i+1, ptu, ptt, pt_array)
    pt_array.append(ptt)
    koch_curve(n, i+1, ptt, pt2, pt_array)
    return

def main():
    n = int(input())
    pt_array = []
    begin = (0.0, 0.0)
    end = (100.0, 0.0)
    pt_array.append(begin)
    koch_curve(n, 1, begin, end, pt_array)
    pt_array.append(end)
    for pt in pt_array:
        print("{:.6f} {:.6f}".format(pt[0], pt[1]))

main() import math math sqrt3 = math.sqrt(3.0) sqrt3 math.sqrt(3.0) math.sqrt math sqrt 3.0 def koch_curve(n, i, pt1, pt2, pt_array):
    if i > n:
        return
    pt1x, pt1y = pt1
    pt2x, pt2y = pt2
    pts = (2/3 * pt1x + 1/3 * pt2x, 2/3 * pt1y + 1/3 * pt2y)
    ptt = (1/3 * pt1x + 2/3 * pt2x, 1/3 * pt1y + 2/3 * pt2y)
    ptx = ptt[0] - pts[0]
    pty = ptt[1] - pts[1]
    ptu = (1/2 * (ptx - sqrt3 * pty) + pts[0], 1/2 * (sqrt3 * ptx + pty) + pts[1])

    koch_curve(n, i+1, pt1, pts, pt_array)
    pt_array.append(pts)
    koch_curve(n, i+1, pts, ptu, pt_array)
    pt_array.append(ptu)
    koch_curve(n, i+1, ptu, ptt, pt_array)
    pt_array.append(ptt)
    koch_curve(n, i+1, ptt, pt2, pt_array)
    return koch_curve if i > n:
        return
     i > n i n return pt1x, pt1y = pt1 pt1x pt1 pt1y pt2x, pt2y = pt2 pt2x pt2 pt2y pts = (2/3 * pt1x + 1/3 * pt2x, 2/3 * pt1y + 1/3 * pt2y) pts (2/3 * pt1x + 1/3 * pt2x, 2/3 * pt1y + 1/3 * pt2y) 2/3 * pt1x + 1/3 * pt2x 2/3 * pt1x 2/3 2 3 pt1x 1/3 * pt2x 1/3 1 3 pt2x 2/3 * pt1y + 1/3 * pt2y 2/3 * pt1y 2/3 2 3 pt1y 1/3 * pt2y 1/3 1 3 pt2y ptt = (1/3 * pt1x + 2/3 * pt2x, 1/3 * pt1y + 2/3 * pt2y) ptt (1/3 * pt1x + 2/3 * pt2x, 1/3 * pt1y + 2/3 * pt2y) 1/3 * pt1x + 2/3 * pt2x 1/3 * pt1x 1/3 1 3 pt1x 2/3 * pt2x 2/3 2 3 pt2x 1/3 * pt1y + 2/3 * pt2y 1/3 * pt1y 1/3 1 3 pt1y 2/3 * pt2y 2/3 2 3 pt2y ptx = ptt[0] - pts[0] ptx ptt[0] - pts[0] ptt[0] ptt 0 pts[0] pts 0 pty = ptt[1] - pts[1] pty ptt[1] - pts[1] ptt[1] ptt 1 pts[1] pts 1 ptu = (1/2 * (ptx - sqrt3 * pty) + pts[0], 1/2 * (sqrt3 * ptx + pty) + pts[1]) ptu (1/2 * (ptx - sqrt3 * pty) + pts[0], 1/2 * (sqrt3 * ptx + pty) + pts[1]) 1/2 * (ptx - sqrt3 * pty) + pts[0] 1/2 * (ptx - sqrt3 * pty) 1/2 1 2 ptx - sqrt3 * pty ptx sqrt3 * pty sqrt3 pty pts[0] pts 0 1/2 * (sqrt3 * ptx + pty) + pts[1] 1/2 * (sqrt3 * ptx + pty) 1/2 1 2 sqrt3 * ptx + pty sqrt3 * ptx sqrt3 ptx pty pts[1] pts 1 koch_curve(n, i+1, pt1, pts, pt_array) koch_curve n i+1 i 1 pt1 pts pt_array pt_array.append(pts) pt_array.append pt_array append pts koch_curve(n, i+1, pts, ptu, pt_array) koch_curve n i+1 i 1 pts ptu pt_array pt_array.append(ptu) pt_array.append pt_array append ptu koch_curve(n, i+1, ptu, ptt, pt_array) koch_curve n i+1 i 1 ptu ptt pt_array pt_array.append(ptt) pt_array.append pt_array append ptt koch_curve(n, i+1, ptt, pt2, pt_array) koch_curve n i+1 i 1 ptt pt2 pt_array return n n i i pt1 pt1 pt2 pt2 pt_array pt_array def main():
    n = int(input())
    pt_array = []
    begin = (0.0, 0.0)
    end = (100.0, 0.0)
    pt_array.append(begin)
    koch_curve(n, 1, begin, end, pt_array)
    pt_array.append(end)
    for pt in pt_array:
        print("{:.6f} {:.6f}".format(pt[0], pt[1])) main n = int(input()) n int(input()) int input() input pt_array = [] pt_array [] begin = (0.0, 0.0) begin (0.0, 0.0) 0.0 0.0 end = (100.0, 0.0) end (100.0, 0.0) 100.0 0.0 pt_array.append(begin) pt_array.append pt_array append begin koch_curve(n, 1, begin, end, pt_array) koch_curve n 1 begin end pt_array pt_array.append(end) pt_array.append pt_array append end for pt in pt_array:
        print("{:.6f} {:.6f}".format(pt[0], pt[1])) pt pt_array print("{:.6f} {:.6f}".format(pt[0], pt[1])) print "{:.6f} {:.6f}".format(pt[0], pt[1]) "{:.6f} {:.6f}".format "{:.6f} {:.6f}" format pt[0] pt 0 pt[1] pt 1 main() main sqrt3 = math.sqrt(3.0) math.sqrt(3.0) sqrt3 def koch_curve(n, i, pt1, pt2, pt_array):
    if i > n:
        return
    pt1x, pt1y = pt1
    pt2x, pt2y = pt2
    pts = (2/3 * pt1x + 1/3 * pt2x, 2/3 * pt1y + 1/3 * pt2y)
    ptt = (1/3 * pt1x + 2/3 * pt2x, 1/3 * pt1y + 2/3 * pt2y)
    ptx = ptt[0] - pts[0]
    pty = ptt[1] - pts[1]
    ptu = (1/2 * (ptx - sqrt3 * pty) + pts[0], 1/2 * (sqrt3 * ptx + pty) + pts[1])

    koch_curve(n, i+1, pt1, pts, pt_array)
    pt_array.append(pts)
    koch_curve(n, i+1, pts, ptu, pt_array)
    pt_array.append(ptu)
    koch_curve(n, i+1, ptu, ptt, pt_array)
    pt_array.append(ptt)
    koch_curve(n, i+1, ptt, pt2, pt_array)
    return def koch_curve(n, i, pt1, pt2, pt_array):
    if i > n:
        return
    pt1x, pt1y = pt1
    pt2x, pt2y = pt2
    pts = (2/3 * pt1x + 1/3 * pt2x, 2/3 * pt1y + 1/3 * pt2y)
    ptt = (1/3 * pt1x + 2/3 * pt2x, 1/3 * pt1y + 2/3 * pt2y)
    ptx = ptt[0] - pts[0]
    pty = ptt[1] - pts[1]
    ptu = (1/2 * (ptx - sqrt3 * pty) + pts[0], 1/2 * (sqrt3 * ptx + pty) + pts[1])

    koch_curve(n, i+1, pt1, pts, pt_array)
    pt_array.append(pts)
    koch_curve(n, i+1, pts, ptu, pt_array)
    pt_array.append(ptu)
    koch_curve(n, i+1, ptu, ptt, pt_array)
    pt_array.append(ptt)
    koch_curve(n, i+1, ptt, pt2, pt_array)
    return koch_curve def main():
    n = int(input())
    pt_array = []
    begin = (0.0, 0.0)
    end = (100.0, 0.0)
    pt_array.append(begin)
    koch_curve(n, 1, begin, end, pt_array)
    pt_array.append(end)
    for pt in pt_array:
        print("{:.6f} {:.6f}".format(pt[0], pt[1])) def main():
    n = int(input())
    pt_array = []
    begin = (0.0, 0.0)
    end = (100.0, 0.0)
    pt_array.append(begin)
    koch_curve(n, 1, begin, end, pt_array)
    pt_array.append(end)
    for pt in pt_array:
        print("{:.6f} {:.6f}".format(pt[0], pt[1])) main
import math
sqrt3 = math.sqrt(3.0)

def koch_curve(n, i, pt1, pt2, pt_array):
    if i > n:
        return
    pt1x, pt1y = pt1
    pt2x, pt2y = pt2
    pts = (2/3 * pt1x + 1/3 * pt2x, 2/3 * pt1y + 1/3 * pt2y)
    ptt = (1/3 * pt1x + 2/3 * pt2x, 1/3 * pt1y + 2/3 * pt2y)
    ptx = ptt[0] - pts[0]
    pty = ptt[1] - pts[1]
    ptu = (1/2 * (ptx - sqrt3 * pty) + pts[0], 1/2 * (sqrt3 * ptx + pty) + pts[1])

    koch_curve(n, i+1, pt1, pts, pt_array)
    pt_array.append(pts)
    koch_curve(n, i+1, pts, ptu, pt_array)
    pt_array.append(ptu)
    koch_curve(n, i+1, ptu, ptt, pt_array)
    pt_array.append(ptt)
    koch_curve(n, i+1, ptt, pt2, pt_array)
    return

def main():
    n = int(input())
    pt_array = []
    begin = (0.0, 0.0)
    end = (100.0, 0.0)
    pt_array.append(begin)
    koch_curve(n, 1, begin, end, pt_array)
    pt_array.append(end)
    for pt in pt_array:
        print("{:.6f} {:.6f}".format(pt[0], pt[1]))

main()
