import math


def kock(n, p1, p2):
    if n == 0:
        return

    s = ((p1[0]*2 + p2[0]) / 3, (p1[1]*2 + p2[1]) / 3)
    t = ((p1[0] + p2[0]*2) / 3, (p1[1] + p2[1]*2) / 3)

    rad60 = math.radians(60)
    sin60 = math.sin(rad60)
    cos60 = math.cos(rad60)

    ux = (t[0]-s[0])*cos60 - (t[1]-s[1])*sin60 + s[0]
    uy = (t[0]-s[0])*sin60 + (t[1]-s[1])*cos60 + s[1]
    u = (ux, uy)

    kock(n-1, p1, s)
    print(*s)
    kock(n-1, s, u)
    print(*u)
    kock(n-1, u, t)
    print(*t)
    kock(n-1, t, p2)


n = int(input())
p1 = (0, 0)
p2 = (100, 0)
print(*p1)
kock(n , p1, p2)
print(*p2) import math math def kock(n, p1, p2):
    if n == 0:
        return

    s = ((p1[0]*2 + p2[0]) / 3, (p1[1]*2 + p2[1]) / 3)
    t = ((p1[0] + p2[0]*2) / 3, (p1[1] + p2[1]*2) / 3)

    rad60 = math.radians(60)
    sin60 = math.sin(rad60)
    cos60 = math.cos(rad60)

    ux = (t[0]-s[0])*cos60 - (t[1]-s[1])*sin60 + s[0]
    uy = (t[0]-s[0])*sin60 + (t[1]-s[1])*cos60 + s[1]
    u = (ux, uy)

    kock(n-1, p1, s)
    print(*s)
    kock(n-1, s, u)
    print(*u)
    kock(n-1, u, t)
    print(*t)
    kock(n-1, t, p2) kock if n == 0:
        return

     n == 0 n 0 return s = ((p1[0]*2 + p2[0]) / 3, (p1[1]*2 + p2[1]) / 3) s ((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]*2 p1[0] p1 0 2 p2[0] p2 0 3 (p1[1]*2 + p2[1]) / 3 p1[1]*2 + p2[1] p1[1]*2 p1[1] p1 1 2 p2[1] p2 1 3 t = ((p1[0] + p2[0]*2) / 3, (p1[1] + p2[1]*2) / 3) t ((p1[0] + p2[0]*2) / 3, (p1[1] + p2[1]*2) / 3) (p1[0] + p2[0]*2) / 3 p1[0] + p2[0]*2 p1[0] p1 0 p2[0]*2 p2[0] p2 0 2 3 (p1[1] + p2[1]*2) / 3 p1[1] + p2[1]*2 p1[1] p1 1 p2[1]*2 p2[1] p2 1 2 3 rad60 = math.radians(60) rad60 math.radians(60) math.radians math radians 60 sin60 = math.sin(rad60) sin60 math.sin(rad60) math.sin math sin rad60 cos60 = math.cos(rad60) cos60 math.cos(rad60) math.cos math cos rad60 ux = (t[0]-s[0])*cos60 - (t[1]-s[1])*sin60 + s[0] ux (t[0]-s[0])*cos60 - (t[1]-s[1])*sin60 + s[0] (t[0]-s[0])*cos60 - (t[1]-s[1])*sin60 (t[0]-s[0])*cos60 t[0]-s[0] t[0] t 0 s[0] s 0 cos60 (t[1]-s[1])*sin60 t[1]-s[1] t[1] t 1 s[1] s 1 sin60 s[0] s 0 uy = (t[0]-s[0])*sin60 + (t[1]-s[1])*cos60 + s[1] uy (t[0]-s[0])*sin60 + (t[1]-s[1])*cos60 + s[1] (t[0]-s[0])*sin60 + (t[1]-s[1])*cos60 (t[0]-s[0])*sin60 t[0]-s[0] t[0] t 0 s[0] s 0 sin60 (t[1]-s[1])*cos60 t[1]-s[1] t[1] t 1 s[1] s 1 cos60 s[1] s 1 u = (ux, uy) u (ux, uy) ux uy kock(n-1, p1, s) kock n-1 n 1 p1 s print(*s) print *s s kock(n-1, s, u) kock n-1 n 1 s u print(*u) print *u u kock(n-1, u, t) kock n-1 n 1 u t print(*t) print *t t kock(n-1, t, p2) kock n-1 n 1 t p2 n n p1 p1 p2 p2 n = int(input()) n int(input()) int input() input p1 = (0, 0) p1 (0, 0) 0 0 p2 = (100, 0) p2 (100, 0) 100 0 print(*p1) print *p1 p1 kock(n , p1, p2) kock n p1 p2 print(*p2) print *p2 p2 def kock(n, p1, p2):
    if n == 0:
        return

    s = ((p1[0]*2 + p2[0]) / 3, (p1[1]*2 + p2[1]) / 3)
    t = ((p1[0] + p2[0]*2) / 3, (p1[1] + p2[1]*2) / 3)

    rad60 = math.radians(60)
    sin60 = math.sin(rad60)
    cos60 = math.cos(rad60)

    ux = (t[0]-s[0])*cos60 - (t[1]-s[1])*sin60 + s[0]
    uy = (t[0]-s[0])*sin60 + (t[1]-s[1])*cos60 + s[1]
    u = (ux, uy)

    kock(n-1, p1, s)
    print(*s)
    kock(n-1, s, u)
    print(*u)
    kock(n-1, u, t)
    print(*t)
    kock(n-1, t, p2) def kock(n, p1, p2):
    if n == 0:
        return

    s = ((p1[0]*2 + p2[0]) / 3, (p1[1]*2 + p2[1]) / 3)
    t = ((p1[0] + p2[0]*2) / 3, (p1[1] + p2[1]*2) / 3)

    rad60 = math.radians(60)
    sin60 = math.sin(rad60)
    cos60 = math.cos(rad60)

    ux = (t[0]-s[0])*cos60 - (t[1]-s[1])*sin60 + s[0]
    uy = (t[0]-s[0])*sin60 + (t[1]-s[1])*cos60 + s[1]
    u = (ux, uy)

    kock(n-1, p1, s)
    print(*s)
    kock(n-1, s, u)
    print(*u)
    kock(n-1, u, t)
    print(*t)
    kock(n-1, t, p2) kock n = int(input()) int(input()) n p2 = (100, 0) (100, 0) p2 p1 = (0, 0) (0, 0) p1
import math


def kock(n, p1, p2):
    if n == 0:
        return

    s = ((p1[0]*2 + p2[0]) / 3, (p1[1]*2 + p2[1]) / 3)
    t = ((p1[0] + p2[0]*2) / 3, (p1[1] + p2[1]*2) / 3)

    rad60 = math.radians(60)
    sin60 = math.sin(rad60)
    cos60 = math.cos(rad60)

    ux = (t[0]-s[0])*cos60 - (t[1]-s[1])*sin60 + s[0]
    uy = (t[0]-s[0])*sin60 + (t[1]-s[1])*cos60 + s[1]
    u = (ux, uy)

    kock(n-1, p1, s)
    print(*s)
    kock(n-1, s, u)
    print(*u)
    kock(n-1, u, t)
    print(*t)
    kock(n-1, t, p2)


n = int(input())
p1 = (0, 0)
p2 = (100, 0)
print(*p1)
kock(n , p1, p2)
print(*p2)
