import math
N = int(input())
ans = [(0, 0)]
def rec(i, lx, ly, rx, ry):
    if i == N:
        return ans
    else:
        x1 = (2 * lx + rx) / 3
        y1 = (2 * ly + ry) / 3
        x3 = (2 * rx + lx) / 3
        y3 = (2 * ry + ly) / 3
        x2 = (x3 - x1) * math.cos(math.pi/3) \
             - (y3 - y1) * math.sin(math.pi/3) + x1
        y2 = (x3 - x1) * math.sin(math.pi/3) \
             + (y3 - y1) * math.cos(math.pi/3) + y1
        

        rec(i+1, lx, ly, x1, y1)
        ans.append((x1, y1))

        rec(i+1, x1, y1, x2, y2)
        ans.append((x2, y2))

        rec(i+1, x2, y2, x3, y3)
        ans.append((x3, y3))

        rec(i+1, x3, y3, rx, ry)

        return ans
        

answer = rec(0, 0, 0, 100, 0)
answer.append((100, 0))
for pair in answer:
    print(*pair) import math math N = int(input()) N int(input()) int input() input ans = [(0, 0)] ans [(0, 0)] (0, 0) 0 0 def rec(i, lx, ly, rx, ry):
    if i == N:
        return ans
    else:
        x1 = (2 * lx + rx) / 3
        y1 = (2 * ly + ry) / 3
        x3 = (2 * rx + lx) / 3
        y3 = (2 * ry + ly) / 3
        x2 = (x3 - x1) * math.cos(math.pi/3) \
             - (y3 - y1) * math.sin(math.pi/3) + x1
        y2 = (x3 - x1) * math.sin(math.pi/3) \
             + (y3 - y1) * math.cos(math.pi/3) + y1
        

        rec(i+1, lx, ly, x1, y1)
        ans.append((x1, y1))

        rec(i+1, x1, y1, x2, y2)
        ans.append((x2, y2))

        rec(i+1, x2, y2, x3, y3)
        ans.append((x3, y3))

        rec(i+1, x3, y3, rx, ry)

        return ans
         rec if i == N:
        return ans
    else:
        x1 = (2 * lx + rx) / 3
        y1 = (2 * ly + ry) / 3
        x3 = (2 * rx + lx) / 3
        y3 = (2 * ry + ly) / 3
        x2 = (x3 - x1) * math.cos(math.pi/3) \
             - (y3 - y1) * math.sin(math.pi/3) + x1
        y2 = (x3 - x1) * math.sin(math.pi/3) \
             + (y3 - y1) * math.cos(math.pi/3) + y1
        

        rec(i+1, lx, ly, x1, y1)
        ans.append((x1, y1))

        rec(i+1, x1, y1, x2, y2)
        ans.append((x2, y2))

        rec(i+1, x2, y2, x3, y3)
        ans.append((x3, y3))

        rec(i+1, x3, y3, rx, ry)

        return ans
         i == N i N return ans ans x1 = (2 * lx + rx) / 3 x1 (2 * lx + rx) / 3 2 * lx + rx 2 * lx 2 lx rx 3 y1 = (2 * ly + ry) / 3 y1 (2 * ly + ry) / 3 2 * ly + ry 2 * ly 2 ly ry 3 x3 = (2 * rx + lx) / 3 x3 (2 * rx + lx) / 3 2 * rx + lx 2 * rx 2 rx lx 3 y3 = (2 * ry + ly) / 3 y3 (2 * ry + ly) / 3 2 * ry + ly 2 * ry 2 ry ly 3 x2 = (x3 - x1) * math.cos(math.pi/3) \
             - (y3 - y1) * math.sin(math.pi/3) + x1 x2 (x3 - x1) * math.cos(math.pi/3) \
             - (y3 - y1) * math.sin(math.pi/3) + x1 (x3 - x1) * math.cos(math.pi/3) \
             - (y3 - y1) * math.sin(math.pi/3) (x3 - x1) * math.cos(math.pi/3) x3 - x1 x3 x1 math.cos(math.pi/3) math.cos math cos math.pi/3 math.pi math pi 3 (y3 - y1) * math.sin(math.pi/3) y3 - y1 y3 y1 math.sin(math.pi/3) math.sin math sin math.pi/3 math.pi math pi 3 x1 y2 = (x3 - x1) * math.sin(math.pi/3) \
             + (y3 - y1) * math.cos(math.pi/3) + y1 y2 (x3 - x1) * math.sin(math.pi/3) \
             + (y3 - y1) * math.cos(math.pi/3) + y1 (x3 - x1) * math.sin(math.pi/3) \
             + (y3 - y1) * math.cos(math.pi/3) (x3 - x1) * math.sin(math.pi/3) x3 - x1 x3 x1 math.sin(math.pi/3) math.sin math sin math.pi/3 math.pi math pi 3 (y3 - y1) * math.cos(math.pi/3) y3 - y1 y3 y1 math.cos(math.pi/3) math.cos math cos math.pi/3 math.pi math pi 3 y1 rec(i+1, lx, ly, x1, y1) rec i+1 i 1 lx ly x1 y1 ans.append((x1, y1)) ans.append ans append (x1, y1) x1 y1 rec(i+1, x1, y1, x2, y2) rec i+1 i 1 x1 y1 x2 y2 ans.append((x2, y2)) ans.append ans append (x2, y2) x2 y2 rec(i+1, x2, y2, x3, y3) rec i+1 i 1 x2 y2 x3 y3 ans.append((x3, y3)) ans.append ans append (x3, y3) x3 y3 rec(i+1, x3, y3, rx, ry) rec i+1 i 1 x3 y3 rx ry return ans ans i i lx lx ly ly rx rx ry ry answer = rec(0, 0, 0, 100, 0) answer rec(0, 0, 0, 100, 0) rec 0 0 0 100 0 answer.append((100, 0)) answer.append answer append (100, 0) 100 0 for pair in answer:
    print(*pair) pair answer print(*pair) print *pair pair def rec(i, lx, ly, rx, ry):
    if i == N:
        return ans
    else:
        x1 = (2 * lx + rx) / 3
        y1 = (2 * ly + ry) / 3
        x3 = (2 * rx + lx) / 3
        y3 = (2 * ry + ly) / 3
        x2 = (x3 - x1) * math.cos(math.pi/3) \
             - (y3 - y1) * math.sin(math.pi/3) + x1
        y2 = (x3 - x1) * math.sin(math.pi/3) \
             + (y3 - y1) * math.cos(math.pi/3) + y1
        

        rec(i+1, lx, ly, x1, y1)
        ans.append((x1, y1))

        rec(i+1, x1, y1, x2, y2)
        ans.append((x2, y2))

        rec(i+1, x2, y2, x3, y3)
        ans.append((x3, y3))

        rec(i+1, x3, y3, rx, ry)

        return ans
         def rec(i, lx, ly, rx, ry):
    if i == N:
        return ans
    else:
        x1 = (2 * lx + rx) / 3
        y1 = (2 * ly + ry) / 3
        x3 = (2 * rx + lx) / 3
        y3 = (2 * ry + ly) / 3
        x2 = (x3 - x1) * math.cos(math.pi/3) \
             - (y3 - y1) * math.sin(math.pi/3) + x1
        y2 = (x3 - x1) * math.sin(math.pi/3) \
             + (y3 - y1) * math.cos(math.pi/3) + y1
        

        rec(i+1, lx, ly, x1, y1)
        ans.append((x1, y1))

        rec(i+1, x1, y1, x2, y2)
        ans.append((x2, y2))

        rec(i+1, x2, y2, x3, y3)
        ans.append((x3, y3))

        rec(i+1, x3, y3, rx, ry)

        return ans
         rec answer = rec(0, 0, 0, 100, 0) rec(0, 0, 0, 100, 0) answer N = int(input()) int(input()) N ans = [(0, 0)] [(0, 0)] ans
import math
N = int(input())
ans = [(0, 0)]
def rec(i, lx, ly, rx, ry):
    if i == N:
        return ans
    else:
        x1 = (2 * lx + rx) / 3
        y1 = (2 * ly + ry) / 3
        x3 = (2 * rx + lx) / 3
        y3 = (2 * ry + ly) / 3
        x2 = (x3 - x1) * math.cos(math.pi/3) \
             - (y3 - y1) * math.sin(math.pi/3) + x1
        y2 = (x3 - x1) * math.sin(math.pi/3) \
             + (y3 - y1) * math.cos(math.pi/3) + y1
        

        rec(i+1, lx, ly, x1, y1)
        ans.append((x1, y1))

        rec(i+1, x1, y1, x2, y2)
        ans.append((x2, y2))

        rec(i+1, x2, y2, x3, y3)
        ans.append((x3, y3))

        rec(i+1, x3, y3, rx, ry)

        return ans
        

answer = rec(0, 0, 0, 100, 0)
answer.append((100, 0))
for pair in answer:
    print(*pair)
