import math
def Koch(initialx,endx,initialy,endy,repeat):
    if repeat > num:
        return 0
    else:
        if initialx >= endx:
            onex,secondx = abs(endx-initialx) * 2 / 3 + endx,abs(endx-initialx) / 3 + endx
        else:
            onex,secondx = abs(endx-initialx) / 3 + initialx,abs(endx-initialx) * 2 / 3 + initialx
        if initialy <= endy:
            oney,secondy = abs(endy-initialy) / 3 +initialy,abs(endy-initialy) * 2 / 3 + initialy
        else:
            oney,secondy = initialy - abs(endy-initialy) / 3 ,initialy - abs(endy-initialy) * 2 / 3

        if initialy == endy:
            thirdy = math.sqrt(3) / 2 * (secondx-onex) + oney
            thirdx = (onex + secondx) / 2
        else:
            if initialy > endy:
                if initialx > endx:
                    thirdx = initialx
                    thirdy = secondy
                else:
                    thirdx = endx
                    thirdy = oney
            else:
                if initialx > endx:
                    thirdx = endx
                    thirdy = oney
                else:
                    thirdx = initialx
                    thirdy = secondy
        if [round(initialx,8),round(initialy,8)] not in ans:
            ans.append([round(initialx,8),round(initialy,8)])
        #print(initialx,endx,onex,oney,secondx,secondy,thirdx,thirdy)
        Koch(initialx,onex,initialy,oney,repeat+1)
        Koch(onex,thirdx,oney,thirdy,repeat+1)
        Koch(thirdx,secondx,thirdy,secondy,repeat+1)
        Koch(secondx,endx,secondy,endy,repeat+1)
global num
num = int(input())
ans = []
Koch(0,100,0,0,0)
for n in range(len(ans)):
    print("%.8f %.8f" % (ans[n][0],ans[n][1]))
print("100.00000000 0.00000000") import math math def Koch(initialx,endx,initialy,endy,repeat):
    if repeat > num:
        return 0
    else:
        if initialx >= endx:
            onex,secondx = abs(endx-initialx) * 2 / 3 + endx,abs(endx-initialx) / 3 + endx
        else:
            onex,secondx = abs(endx-initialx) / 3 + initialx,abs(endx-initialx) * 2 / 3 + initialx
        if initialy <= endy:
            oney,secondy = abs(endy-initialy) / 3 +initialy,abs(endy-initialy) * 2 / 3 + initialy
        else:
            oney,secondy = initialy - abs(endy-initialy) / 3 ,initialy - abs(endy-initialy) * 2 / 3

        if initialy == endy:
            thirdy = math.sqrt(3) / 2 * (secondx-onex) + oney
            thirdx = (onex + secondx) / 2
        else:
            if initialy > endy:
                if initialx > endx:
                    thirdx = initialx
                    thirdy = secondy
                else:
                    thirdx = endx
                    thirdy = oney
            else:
                if initialx > endx:
                    thirdx = endx
                    thirdy = oney
                else:
                    thirdx = initialx
                    thirdy = secondy
        if [round(initialx,8),round(initialy,8)] not in ans:
            ans.append([round(initialx,8),round(initialy,8)])
        #print(initialx,endx,onex,oney,secondx,secondy,thirdx,thirdy)
        Koch(initialx,onex,initialy,oney,repeat+1)
        Koch(onex,thirdx,oney,thirdy,repeat+1)
        Koch(thirdx,secondx,thirdy,secondy,repeat+1)
        Koch(secondx,endx,secondy,endy,repeat+1) Koch if repeat > num:
        return 0
    else:
        if initialx >= endx:
            onex,secondx = abs(endx-initialx) * 2 / 3 + endx,abs(endx-initialx) / 3 + endx
        else:
            onex,secondx = abs(endx-initialx) / 3 + initialx,abs(endx-initialx) * 2 / 3 + initialx
        if initialy <= endy:
            oney,secondy = abs(endy-initialy) / 3 +initialy,abs(endy-initialy) * 2 / 3 + initialy
        else:
            oney,secondy = initialy - abs(endy-initialy) / 3 ,initialy - abs(endy-initialy) * 2 / 3

        if initialy == endy:
            thirdy = math.sqrt(3) / 2 * (secondx-onex) + oney
            thirdx = (onex + secondx) / 2
        else:
            if initialy > endy:
                if initialx > endx:
                    thirdx = initialx
                    thirdy = secondy
                else:
                    thirdx = endx
                    thirdy = oney
            else:
                if initialx > endx:
                    thirdx = endx
                    thirdy = oney
                else:
                    thirdx = initialx
                    thirdy = secondy
        if [round(initialx,8),round(initialy,8)] not in ans:
            ans.append([round(initialx,8),round(initialy,8)])
        #print(initialx,endx,onex,oney,secondx,secondy,thirdx,thirdy)
        Koch(initialx,onex,initialy,oney,repeat+1)
        Koch(onex,thirdx,oney,thirdy,repeat+1)
        Koch(thirdx,secondx,thirdy,secondy,repeat+1)
        Koch(secondx,endx,secondy,endy,repeat+1) repeat > num repeat num return 0 0 if initialx >= endx:
            onex,secondx = abs(endx-initialx) * 2 / 3 + endx,abs(endx-initialx) / 3 + endx
        else:
            onex,secondx = abs(endx-initialx) / 3 + initialx,abs(endx-initialx) * 2 / 3 + initialx
         initialx >= endx initialx endx onex,secondx = abs(endx-initialx) * 2 / 3 + endx,abs(endx-initialx) / 3 + endx onex abs(endx-initialx) * 2 / 3 + endx abs(endx-initialx) * 2 / 3 abs(endx-initialx) * 2 abs(endx-initialx) abs endx-initialx endx initialx 2 3 endx secondx abs(endx-initialx) / 3 + endx abs(endx-initialx) / 3 abs(endx-initialx) abs endx-initialx endx initialx 3 endx onex,secondx = abs(endx-initialx) / 3 + initialx,abs(endx-initialx) * 2 / 3 + initialx onex abs(endx-initialx) / 3 + initialx abs(endx-initialx) / 3 abs(endx-initialx) abs endx-initialx endx initialx 3 initialx secondx abs(endx-initialx) * 2 / 3 + initialx abs(endx-initialx) * 2 / 3 abs(endx-initialx) * 2 abs(endx-initialx) abs endx-initialx endx initialx 2 3 initialx if initialy <= endy:
            oney,secondy = abs(endy-initialy) / 3 +initialy,abs(endy-initialy) * 2 / 3 + initialy
        else:
            oney,secondy = initialy - abs(endy-initialy) / 3 ,initialy - abs(endy-initialy) * 2 / 3

         initialy <= endy initialy endy oney,secondy = abs(endy-initialy) / 3 +initialy,abs(endy-initialy) * 2 / 3 + initialy oney abs(endy-initialy) / 3 +initialy abs(endy-initialy) / 3 abs(endy-initialy) abs endy-initialy endy initialy 3 initialy secondy abs(endy-initialy) * 2 / 3 + initialy abs(endy-initialy) * 2 / 3 abs(endy-initialy) * 2 abs(endy-initialy) abs endy-initialy endy initialy 2 3 initialy oney,secondy = initialy - abs(endy-initialy) / 3 ,initialy - abs(endy-initialy) * 2 / 3 oney initialy - abs(endy-initialy) / 3 initialy abs(endy-initialy) / 3 abs(endy-initialy) abs endy-initialy endy initialy 3 secondy initialy - abs(endy-initialy) * 2 / 3 initialy abs(endy-initialy) * 2 / 3 abs(endy-initialy) * 2 abs(endy-initialy) abs endy-initialy endy initialy 2 3 if initialy == endy:
            thirdy = math.sqrt(3) / 2 * (secondx-onex) + oney
            thirdx = (onex + secondx) / 2
        else:
            if initialy > endy:
                if initialx > endx:
                    thirdx = initialx
                    thirdy = secondy
                else:
                    thirdx = endx
                    thirdy = oney
            else:
                if initialx > endx:
                    thirdx = endx
                    thirdy = oney
                else:
                    thirdx = initialx
                    thirdy = secondy
         initialy == endy initialy endy thirdy = math.sqrt(3) / 2 * (secondx-onex) + oney thirdy math.sqrt(3) / 2 * (secondx-onex) + oney math.sqrt(3) / 2 * (secondx-onex) math.sqrt(3) / 2 math.sqrt(3) math.sqrt math sqrt 3 2 secondx-onex secondx onex oney thirdx = (onex + secondx) / 2 thirdx (onex + secondx) / 2 onex + secondx onex secondx 2 if initialy > endy:
                if initialx > endx:
                    thirdx = initialx
                    thirdy = secondy
                else:
                    thirdx = endx
                    thirdy = oney
            else:
                if initialx > endx:
                    thirdx = endx
                    thirdy = oney
                else:
                    thirdx = initialx
                    thirdy = secondy
         initialy > endy initialy endy if initialx > endx:
                    thirdx = initialx
                    thirdy = secondy
                else:
                    thirdx = endx
                    thirdy = oney
             initialx > endx initialx endx thirdx = initialx thirdx initialx thirdy = secondy thirdy secondy thirdx = endx thirdx endx thirdy = oney thirdy oney if initialx > endx:
                    thirdx = endx
                    thirdy = oney
                else:
                    thirdx = initialx
                    thirdy = secondy
         initialx > endx initialx endx thirdx = endx thirdx endx thirdy = oney thirdy oney thirdx = initialx thirdx initialx thirdy = secondy thirdy secondy if [round(initialx,8),round(initialy,8)] not in ans:
            ans.append([round(initialx,8),round(initialy,8)])
        #print(initialx,endx,onex,oney,secondx,secondy,thirdx,thirdy)
         [round(initialx,8),round(initialy,8)] not in ans [round(initialx,8),round(initialy,8)] round(initialx,8) round initialx 8 round(initialy,8) round initialy 8 ans ans.append([round(initialx,8),round(initialy,8)]) ans.append ans append [round(initialx,8),round(initialy,8)] round(initialx,8) round initialx 8 round(initialy,8) round initialy 8 Koch(initialx,onex,initialy,oney,repeat+1) Koch initialx onex initialy oney repeat+1 repeat 1 Koch(onex,thirdx,oney,thirdy,repeat+1) Koch onex thirdx oney thirdy repeat+1 repeat 1 Koch(thirdx,secondx,thirdy,secondy,repeat+1) Koch thirdx secondx thirdy secondy repeat+1 repeat 1 Koch(secondx,endx,secondy,endy,repeat+1) Koch secondx endx secondy endy repeat+1 repeat 1 initialx initialx endx endx initialy initialy endy endy repeat repeat global num num = int(input()) num int(input()) int input() input ans = [] ans [] Koch(0,100,0,0,0) Koch 0 100 0 0 0 for n in range(len(ans)):
    print("%.8f %.8f" % (ans[n][0],ans[n][1])) n range(len(ans)) range len(ans) len ans print("%.8f %.8f" % (ans[n][0],ans[n][1])) print "%.8f %.8f" % (ans[n][0],ans[n][1]) "%.8f %.8f" (ans[n][0],ans[n][1]) ans[n][0] [n] ans n 0 ans[n][1] [n] ans n 1 print("100.00000000 0.00000000") print "100.00000000 0.00000000" global num ans = [] [] ans def Koch(initialx,endx,initialy,endy,repeat):
    if repeat > num:
        return 0
    else:
        if initialx >= endx:
            onex,secondx = abs(endx-initialx) * 2 / 3 + endx,abs(endx-initialx) / 3 + endx
        else:
            onex,secondx = abs(endx-initialx) / 3 + initialx,abs(endx-initialx) * 2 / 3 + initialx
        if initialy <= endy:
            oney,secondy = abs(endy-initialy) / 3 +initialy,abs(endy-initialy) * 2 / 3 + initialy
        else:
            oney,secondy = initialy - abs(endy-initialy) / 3 ,initialy - abs(endy-initialy) * 2 / 3

        if initialy == endy:
            thirdy = math.sqrt(3) / 2 * (secondx-onex) + oney
            thirdx = (onex + secondx) / 2
        else:
            if initialy > endy:
                if initialx > endx:
                    thirdx = initialx
                    thirdy = secondy
                else:
                    thirdx = endx
                    thirdy = oney
            else:
                if initialx > endx:
                    thirdx = endx
                    thirdy = oney
                else:
                    thirdx = initialx
                    thirdy = secondy
        if [round(initialx,8),round(initialy,8)] not in ans:
            ans.append([round(initialx,8),round(initialy,8)])
        #print(initialx,endx,onex,oney,secondx,secondy,thirdx,thirdy)
        Koch(initialx,onex,initialy,oney,repeat+1)
        Koch(onex,thirdx,oney,thirdy,repeat+1)
        Koch(thirdx,secondx,thirdy,secondy,repeat+1)
        Koch(secondx,endx,secondy,endy,repeat+1) def Koch(initialx,endx,initialy,endy,repeat):
    if repeat > num:
        return 0
    else:
        if initialx >= endx:
            onex,secondx = abs(endx-initialx) * 2 / 3 + endx,abs(endx-initialx) / 3 + endx
        else:
            onex,secondx = abs(endx-initialx) / 3 + initialx,abs(endx-initialx) * 2 / 3 + initialx
        if initialy <= endy:
            oney,secondy = abs(endy-initialy) / 3 +initialy,abs(endy-initialy) * 2 / 3 + initialy
        else:
            oney,secondy = initialy - abs(endy-initialy) / 3 ,initialy - abs(endy-initialy) * 2 / 3

        if initialy == endy:
            thirdy = math.sqrt(3) / 2 * (secondx-onex) + oney
            thirdx = (onex + secondx) / 2
        else:
            if initialy > endy:
                if initialx > endx:
                    thirdx = initialx
                    thirdy = secondy
                else:
                    thirdx = endx
                    thirdy = oney
            else:
                if initialx > endx:
                    thirdx = endx
                    thirdy = oney
                else:
                    thirdx = initialx
                    thirdy = secondy
        if [round(initialx,8),round(initialy,8)] not in ans:
            ans.append([round(initialx,8),round(initialy,8)])
        #print(initialx,endx,onex,oney,secondx,secondy,thirdx,thirdy)
        Koch(initialx,onex,initialy,oney,repeat+1)
        Koch(onex,thirdx,oney,thirdy,repeat+1)
        Koch(thirdx,secondx,thirdy,secondy,repeat+1)
        Koch(secondx,endx,secondy,endy,repeat+1) Koch num = int(input()) int(input()) num
import math
def Koch(initialx,endx,initialy,endy,repeat):
    if repeat > num:
        return 0
    else:
        if initialx >= endx:
            onex,secondx = abs(endx-initialx) * 2 / 3 + endx,abs(endx-initialx) / 3 + endx
        else:
            onex,secondx = abs(endx-initialx) / 3 + initialx,abs(endx-initialx) * 2 / 3 + initialx
        if initialy <= endy:
            oney,secondy = abs(endy-initialy) / 3 +initialy,abs(endy-initialy) * 2 / 3 + initialy
        else:
            oney,secondy = initialy - abs(endy-initialy) / 3 ,initialy - abs(endy-initialy) * 2 / 3

        if initialy == endy:
            thirdy = math.sqrt(3) / 2 * (secondx-onex) + oney
            thirdx = (onex + secondx) / 2
        else:
            if initialy > endy:
                if initialx > endx:
                    thirdx = initialx
                    thirdy = secondy
                else:
                    thirdx = endx
                    thirdy = oney
            else:
                if initialx > endx:
                    thirdx = endx
                    thirdy = oney
                else:
                    thirdx = initialx
                    thirdy = secondy
        if [round(initialx,8),round(initialy,8)] not in ans:
            ans.append([round(initialx,8),round(initialy,8)])
        #print(initialx,endx,onex,oney,secondx,secondy,thirdx,thirdy)
        Koch(initialx,onex,initialy,oney,repeat+1)
        Koch(onex,thirdx,oney,thirdy,repeat+1)
        Koch(thirdx,secondx,thirdy,secondy,repeat+1)
        Koch(secondx,endx,secondy,endy,repeat+1)
global num
num = int(input())
ans = []
Koch(0,100,0,0,0)
for n in range(len(ans)):
    print("%.8f %.8f" % (ans[n][0],ans[n][1]))
print("100.00000000 0.00000000")