import math


def make_stu(p1, p2):
    s = [(2 * p1[0] + p2[0]) / 3, (2 * p1[1] + p2[1]) / 3]
    t = [(p1[0] + 2 * p2[0]) / 3, (p1[1] + 2 * p2[1]) / 3]
    u = [s[0] + (t[0] - s[0]) / 2 - math.sqrt(3) * (t[1] - s[1]) / 2,
         s[1] + (t[1] - s[1]) / 2 + math.sqrt(3) * (t[0] - s[0]) / 2]
    return s, t, u


def koch_curve(n, p1, p2):
    if n >= 1:
        s, t, u = make_stu(p1, p2)
        if n == 1:
            print(s[0], s[1])
            print(u[0], u[1])
            print(t[0], t[1])
        else:
            koch_curve(n - 1, p1, s)
            print(s[0], s[1])
            koch_curve(n - 1, s, u)
            print(u[0], u[1])
            koch_curve(n - 1, u, t)
            print(t[0], t[1])
            koch_curve(n - 1, t, p2)

n = int(input())

print(0.0, 0.0)
koch_curve(n, [0.0, 0.0], [100.0, 0.0])
print(100.0, 0.0) import math math def make_stu(p1, p2):
    s = [(2 * p1[0] + p2[0]) / 3, (2 * p1[1] + p2[1]) / 3]
    t = [(p1[0] + 2 * p2[0]) / 3, (p1[1] + 2 * p2[1]) / 3]
    u = [s[0] + (t[0] - s[0]) / 2 - math.sqrt(3) * (t[1] - s[1]) / 2,
         s[1] + (t[1] - s[1]) / 2 + math.sqrt(3) * (t[0] - s[0]) / 2]
    return s, t, u make_stu s = [(2 * p1[0] + p2[0]) / 3, (2 * p1[1] + p2[1]) / 3] s [(2 * p1[0] + p2[0]) / 3, (2 * p1[1] + p2[1]) / 3] (2 * p1[0] + p2[0]) / 3 2 * p1[0] + p2[0] 2 * p1[0] 2 p1[0] p1 0 p2[0] p2 0 3 (2 * p1[1] + p2[1]) / 3 2 * p1[1] + p2[1] 2 * p1[1] 2 p1[1] p1 1 p2[1] p2 1 3 t = [(p1[0] + 2 * p2[0]) / 3, (p1[1] + 2 * p2[1]) / 3] t [(p1[0] + 2 * p2[0]) / 3, (p1[1] + 2 * p2[1]) / 3] (p1[0] + 2 * p2[0]) / 3 p1[0] + 2 * p2[0] p1[0] p1 0 2 * p2[0] 2 p2[0] p2 0 3 (p1[1] + 2 * p2[1]) / 3 p1[1] + 2 * p2[1] p1[1] p1 1 2 * p2[1] 2 p2[1] p2 1 3 u = [s[0] + (t[0] - s[0]) / 2 - math.sqrt(3) * (t[1] - s[1]) / 2,
         s[1] + (t[1] - s[1]) / 2 + math.sqrt(3) * (t[0] - s[0]) / 2] u [s[0] + (t[0] - s[0]) / 2 - math.sqrt(3) * (t[1] - s[1]) / 2,
         s[1] + (t[1] - s[1]) / 2 + math.sqrt(3) * (t[0] - s[0]) / 2] s[0] + (t[0] - s[0]) / 2 - math.sqrt(3) * (t[1] - s[1]) / 2 s[0] + (t[0] - s[0]) / 2 s[0] s 0 (t[0] - s[0]) / 2 t[0] - s[0] t[0] t 0 s[0] s 0 2 math.sqrt(3) * (t[1] - s[1]) / 2 math.sqrt(3) * (t[1] - s[1]) math.sqrt(3) math.sqrt math sqrt 3 t[1] - s[1] t[1] t 1 s[1] s 1 2 s[1] + (t[1] - s[1]) / 2 + math.sqrt(3) * (t[0] - s[0]) / 2 s[1] + (t[1] - s[1]) / 2 s[1] s 1 (t[1] - s[1]) / 2 t[1] - s[1] t[1] t 1 s[1] s 1 2 math.sqrt(3) * (t[0] - s[0]) / 2 math.sqrt(3) * (t[0] - s[0]) math.sqrt(3) math.sqrt math sqrt 3 t[0] - s[0] t[0] t 0 s[0] s 0 2 return s, t, u return s, t, u s t u p1 p1 p2 p2 def koch_curve(n, p1, p2):
    if n >= 1:
        s, t, u = make_stu(p1, p2)
        if n == 1:
            print(s[0], s[1])
            print(u[0], u[1])
            print(t[0], t[1])
        else:
            koch_curve(n - 1, p1, s)
            print(s[0], s[1])
            koch_curve(n - 1, s, u)
            print(u[0], u[1])
            koch_curve(n - 1, u, t)
            print(t[0], t[1])
            koch_curve(n - 1, t, p2) koch_curve if n >= 1:
        s, t, u = make_stu(p1, p2)
        if n == 1:
            print(s[0], s[1])
            print(u[0], u[1])
            print(t[0], t[1])
        else:
            koch_curve(n - 1, p1, s)
            print(s[0], s[1])
            koch_curve(n - 1, s, u)
            print(u[0], u[1])
            koch_curve(n - 1, u, t)
            print(t[0], t[1])
            koch_curve(n - 1, t, p2) n >= 1 n 1 s, t, u = make_stu(p1, p2) s make_stu(p1, p2) make_stu p1 p2 t u if n == 1:
            print(s[0], s[1])
            print(u[0], u[1])
            print(t[0], t[1])
        else:
            koch_curve(n - 1, p1, s)
            print(s[0], s[1])
            koch_curve(n - 1, s, u)
            print(u[0], u[1])
            koch_curve(n - 1, u, t)
            print(t[0], t[1])
            koch_curve(n - 1, t, p2) n == 1 n 1 print(s[0], s[1]) print s[0] s 0 s[1] s 1 print(u[0], u[1]) print u[0] u 0 u[1] u 1 print(t[0], t[1]) print t[0] t 0 t[1] t 1 koch_curve(n - 1, p1, s) koch_curve n - 1 n 1 p1 s print(s[0], s[1]) print s[0] s 0 s[1] s 1 koch_curve(n - 1, s, u) koch_curve n - 1 n 1 s u print(u[0], u[1]) print u[0] u 0 u[1] u 1 koch_curve(n - 1, u, t) koch_curve n - 1 n 1 u t print(t[0], t[1]) print t[0] t 0 t[1] t 1 koch_curve(n - 1, t, p2) koch_curve n - 1 n 1 t p2 n n p1 p1 p2 p2 n = int(input()) n int(input()) int input() input print(0.0, 0.0) print 0.0 0.0 koch_curve(n, [0.0, 0.0], [100.0, 0.0]) koch_curve n [0.0, 0.0] 0.0 0.0 [100.0, 0.0] 100.0 0.0 print(100.0, 0.0) print 100.0 0.0 def make_stu(p1, p2):
    s = [(2 * p1[0] + p2[0]) / 3, (2 * p1[1] + p2[1]) / 3]
    t = [(p1[0] + 2 * p2[0]) / 3, (p1[1] + 2 * p2[1]) / 3]
    u = [s[0] + (t[0] - s[0]) / 2 - math.sqrt(3) * (t[1] - s[1]) / 2,
         s[1] + (t[1] - s[1]) / 2 + math.sqrt(3) * (t[0] - s[0]) / 2]
    return s, t, u def make_stu(p1, p2):
    s = [(2 * p1[0] + p2[0]) / 3, (2 * p1[1] + p2[1]) / 3]
    t = [(p1[0] + 2 * p2[0]) / 3, (p1[1] + 2 * p2[1]) / 3]
    u = [s[0] + (t[0] - s[0]) / 2 - math.sqrt(3) * (t[1] - s[1]) / 2,
         s[1] + (t[1] - s[1]) / 2 + math.sqrt(3) * (t[0] - s[0]) / 2]
    return s, t, u make_stu n = int(input()) int(input()) n def koch_curve(n, p1, p2):
    if n >= 1:
        s, t, u = make_stu(p1, p2)
        if n == 1:
            print(s[0], s[1])
            print(u[0], u[1])
            print(t[0], t[1])
        else:
            koch_curve(n - 1, p1, s)
            print(s[0], s[1])
            koch_curve(n - 1, s, u)
            print(u[0], u[1])
            koch_curve(n - 1, u, t)
            print(t[0], t[1])
            koch_curve(n - 1, t, p2) def koch_curve(n, p1, p2):
    if n >= 1:
        s, t, u = make_stu(p1, p2)
        if n == 1:
            print(s[0], s[1])
            print(u[0], u[1])
            print(t[0], t[1])
        else:
            koch_curve(n - 1, p1, s)
            print(s[0], s[1])
            koch_curve(n - 1, s, u)
            print(u[0], u[1])
            koch_curve(n - 1, u, t)
            print(t[0], t[1])
            koch_curve(n - 1, t, p2) koch_curve
import math


def make_stu(p1, p2):
    s = [(2 * p1[0] + p2[0]) / 3, (2 * p1[1] + p2[1]) / 3]
    t = [(p1[0] + 2 * p2[0]) / 3, (p1[1] + 2 * p2[1]) / 3]
    u = [s[0] + (t[0] - s[0]) / 2 - math.sqrt(3) * (t[1] - s[1]) / 2,
         s[1] + (t[1] - s[1]) / 2 + math.sqrt(3) * (t[0] - s[0]) / 2]
    return s, t, u


def koch_curve(n, p1, p2):
    if n >= 1:
        s, t, u = make_stu(p1, p2)
        if n == 1:
            print(s[0], s[1])
            print(u[0], u[1])
            print(t[0], t[1])
        else:
            koch_curve(n - 1, p1, s)
            print(s[0], s[1])
            koch_curve(n - 1, s, u)
            print(u[0], u[1])
            koch_curve(n - 1, u, t)
            print(t[0], t[1])
            koch_curve(n - 1, t, p2)

n = int(input())

print(0.0, 0.0)
koch_curve(n, [0.0, 0.0], [100.0, 0.0])
print(100.0, 0.0)
