import math
def koch(d, p1, p2):
    if d == 0:
        return
    
    v = [p2[0] - p1[0], p2[1] - p1[1]]
    s = [p1[0] + v[0] / 3, p1[1] + v[1] / 3]
    t = [p1[0] + 2 * v[0] / 3, p1[1] + 2 * v[1] / 3]
    u = [p1[0] + v[0] / 2 - v[1] * math.sqrt(3) / 6, p1[1] + v[1] / 2 + v[0] * math.sqrt(3) / 6]

    koch(d - 1, p1, s)
    print(" ".join(map(str, s)))
    koch(d - 1, s, u)
    print(" ".join(map(str, u)))
    koch(d - 1, u, t)
    print(" ".join(map(str, t)))
    koch(d - 1, t, p2)

n = int(input())
print("0 0")
koch(n, [0, 0], [100, 0])
print("100 0") import math math def koch(d, p1, p2):
    if d == 0:
        return
    
    v = [p2[0] - p1[0], p2[1] - p1[1]]
    s = [p1[0] + v[0] / 3, p1[1] + v[1] / 3]
    t = [p1[0] + 2 * v[0] / 3, p1[1] + 2 * v[1] / 3]
    u = [p1[0] + v[0] / 2 - v[1] * math.sqrt(3) / 6, p1[1] + v[1] / 2 + v[0] * math.sqrt(3) / 6]

    koch(d - 1, p1, s)
    print(" ".join(map(str, s)))
    koch(d - 1, s, u)
    print(" ".join(map(str, u)))
    koch(d - 1, u, t)
    print(" ".join(map(str, t)))
    koch(d - 1, t, p2) koch if d == 0:
        return
    
     d == 0 d 0 return v = [p2[0] - p1[0], p2[1] - p1[1]] v [p2[0] - p1[0], p2[1] - p1[1]] p2[0] - p1[0] p2[0] p2 0 p1[0] p1 0 p2[1] - p1[1] p2[1] p2 1 p1[1] p1 1 s = [p1[0] + v[0] / 3, p1[1] + v[1] / 3] s [p1[0] + v[0] / 3, p1[1] + v[1] / 3] p1[0] + v[0] / 3 p1[0] p1 0 v[0] / 3 v[0] v 0 3 p1[1] + v[1] / 3 p1[1] p1 1 v[1] / 3 v[1] v 1 3 t = [p1[0] + 2 * v[0] / 3, p1[1] + 2 * v[1] / 3] t [p1[0] + 2 * v[0] / 3, p1[1] + 2 * v[1] / 3] p1[0] + 2 * v[0] / 3 p1[0] p1 0 2 * v[0] / 3 2 * v[0] 2 v[0] v 0 3 p1[1] + 2 * v[1] / 3 p1[1] p1 1 2 * v[1] / 3 2 * v[1] 2 v[1] v 1 3 u = [p1[0] + v[0] / 2 - v[1] * math.sqrt(3) / 6, p1[1] + v[1] / 2 + v[0] * math.sqrt(3) / 6] u [p1[0] + v[0] / 2 - v[1] * math.sqrt(3) / 6, p1[1] + v[1] / 2 + v[0] * math.sqrt(3) / 6] p1[0] + v[0] / 2 - v[1] * math.sqrt(3) / 6 p1[0] + v[0] / 2 p1[0] p1 0 v[0] / 2 v[0] v 0 2 v[1] * math.sqrt(3) / 6 v[1] * math.sqrt(3) v[1] v 1 math.sqrt(3) math.sqrt math sqrt 3 6 p1[1] + v[1] / 2 + v[0] * math.sqrt(3) / 6 p1[1] + v[1] / 2 p1[1] p1 1 v[1] / 2 v[1] v 1 2 v[0] * math.sqrt(3) / 6 v[0] * math.sqrt(3) v[0] v 0 math.sqrt(3) math.sqrt math sqrt 3 6 koch(d - 1, p1, s) koch d - 1 d 1 p1 s print(" ".join(map(str, s))) print " ".join(map(str, s)) " ".join " " join map(str, s) map str s koch(d - 1, s, u) koch d - 1 d 1 s u print(" ".join(map(str, u))) print " ".join(map(str, u)) " ".join " " join map(str, u) map str u koch(d - 1, u, t) koch d - 1 d 1 u t print(" ".join(map(str, t))) print " ".join(map(str, t)) " ".join " " join map(str, t) map str t koch(d - 1, t, p2) koch d - 1 d 1 t p2 d d p1 p1 p2 p2 n = int(input()) n int(input()) int input() input print("0 0") print "0 0" koch(n, [0, 0], [100, 0]) koch n [0, 0] 0 0 [100, 0] 100 0 print("100 0") print "100 0" n = int(input()) int(input()) n def koch(d, p1, p2):
    if d == 0:
        return
    
    v = [p2[0] - p1[0], p2[1] - p1[1]]
    s = [p1[0] + v[0] / 3, p1[1] + v[1] / 3]
    t = [p1[0] + 2 * v[0] / 3, p1[1] + 2 * v[1] / 3]
    u = [p1[0] + v[0] / 2 - v[1] * math.sqrt(3) / 6, p1[1] + v[1] / 2 + v[0] * math.sqrt(3) / 6]

    koch(d - 1, p1, s)
    print(" ".join(map(str, s)))
    koch(d - 1, s, u)
    print(" ".join(map(str, u)))
    koch(d - 1, u, t)
    print(" ".join(map(str, t)))
    koch(d - 1, t, p2) def koch(d, p1, p2):
    if d == 0:
        return
    
    v = [p2[0] - p1[0], p2[1] - p1[1]]
    s = [p1[0] + v[0] / 3, p1[1] + v[1] / 3]
    t = [p1[0] + 2 * v[0] / 3, p1[1] + 2 * v[1] / 3]
    u = [p1[0] + v[0] / 2 - v[1] * math.sqrt(3) / 6, p1[1] + v[1] / 2 + v[0] * math.sqrt(3) / 6]

    koch(d - 1, p1, s)
    print(" ".join(map(str, s)))
    koch(d - 1, s, u)
    print(" ".join(map(str, u)))
    koch(d - 1, u, t)
    print(" ".join(map(str, t)))
    koch(d - 1, t, p2) koch
import math
def koch(d, p1, p2):
    if d == 0:
        return
    
    v = [p2[0] - p1[0], p2[1] - p1[1]]
    s = [p1[0] + v[0] / 3, p1[1] + v[1] / 3]
    t = [p1[0] + 2 * v[0] / 3, p1[1] + 2 * v[1] / 3]
    u = [p1[0] + v[0] / 2 - v[1] * math.sqrt(3) / 6, p1[1] + v[1] / 2 + v[0] * math.sqrt(3) / 6]

    koch(d - 1, p1, s)
    print(" ".join(map(str, s)))
    koch(d - 1, s, u)
    print(" ".join(map(str, u)))
    koch(d - 1, u, t)
    print(" ".join(map(str, t)))
    koch(d - 1, t, p2)

n = int(input())
print("0 0")
koch(n, [0, 0], [100, 0])
print("100 0")
