import math

def kock(n,p1x,p1y,p2x,p2y):
    if(n==0):
        return

    sx = (2*p1x+p2x)/3.0
    sy = (2*p1y+p2y)/3.0
    tx = (p1x+2*p2x)/3.0
    ty = (p1y+2*p2y)/3.0

    ux = (tx-sx)*math.cos(math.radians(60)) - (ty-sy)*math.sin(math.radians(60)) + sx
    uy = (tx-sx)*math.sin(math.radians(60)) + (ty-sy)*math.cos(math.radians(60)) + sy

    kock(n-1,p1x,p1y,sx,sy)
    print(sx,sy)
    kock(n-1,sx,sy,ux,uy)
    print(ux,uy)
    kock(n-1,ux,uy,tx,ty)
    print(tx,ty)
    kock(n-1,tx,ty,p2x,p2y)


n = int(input())
print(0,0)
kock(n,0,0,100,0)
print(100,0) import math math def kock(n,p1x,p1y,p2x,p2y):
    if(n==0):
        return

    sx = (2*p1x+p2x)/3.0
    sy = (2*p1y+p2y)/3.0
    tx = (p1x+2*p2x)/3.0
    ty = (p1y+2*p2y)/3.0

    ux = (tx-sx)*math.cos(math.radians(60)) - (ty-sy)*math.sin(math.radians(60)) + sx
    uy = (tx-sx)*math.sin(math.radians(60)) + (ty-sy)*math.cos(math.radians(60)) + sy

    kock(n-1,p1x,p1y,sx,sy)
    print(sx,sy)
    kock(n-1,sx,sy,ux,uy)
    print(ux,uy)
    kock(n-1,ux,uy,tx,ty)
    print(tx,ty)
    kock(n-1,tx,ty,p2x,p2y) kock if(n==0):
        return

     n==0 n 0 return sx = (2*p1x+p2x)/3.0 sx (2*p1x+p2x)/3.0 2*p1x+p2x 2*p1x 2 p1x p2x 3.0 sy = (2*p1y+p2y)/3.0 sy (2*p1y+p2y)/3.0 2*p1y+p2y 2*p1y 2 p1y p2y 3.0 tx = (p1x+2*p2x)/3.0 tx (p1x+2*p2x)/3.0 p1x+2*p2x p1x 2*p2x 2 p2x 3.0 ty = (p1y+2*p2y)/3.0 ty (p1y+2*p2y)/3.0 p1y+2*p2y p1y 2*p2y 2 p2y 3.0 ux = (tx-sx)*math.cos(math.radians(60)) - (ty-sy)*math.sin(math.radians(60)) + sx ux (tx-sx)*math.cos(math.radians(60)) - (ty-sy)*math.sin(math.radians(60)) + sx (tx-sx)*math.cos(math.radians(60)) - (ty-sy)*math.sin(math.radians(60)) (tx-sx)*math.cos(math.radians(60)) tx-sx tx sx math.cos(math.radians(60)) math.cos math cos math.radians(60) math.radians math radians 60 (ty-sy)*math.sin(math.radians(60)) ty-sy ty sy math.sin(math.radians(60)) math.sin math sin math.radians(60) math.radians math radians 60 sx uy = (tx-sx)*math.sin(math.radians(60)) + (ty-sy)*math.cos(math.radians(60)) + sy uy (tx-sx)*math.sin(math.radians(60)) + (ty-sy)*math.cos(math.radians(60)) + sy (tx-sx)*math.sin(math.radians(60)) + (ty-sy)*math.cos(math.radians(60)) (tx-sx)*math.sin(math.radians(60)) tx-sx tx sx math.sin(math.radians(60)) math.sin math sin math.radians(60) math.radians math radians 60 (ty-sy)*math.cos(math.radians(60)) ty-sy ty sy math.cos(math.radians(60)) math.cos math cos math.radians(60) math.radians math radians 60 sy kock(n-1,p1x,p1y,sx,sy) kock n-1 n 1 p1x p1y sx sy print(sx,sy) print sx sy kock(n-1,sx,sy,ux,uy) kock n-1 n 1 sx sy ux uy print(ux,uy) print ux uy kock(n-1,ux,uy,tx,ty) kock n-1 n 1 ux uy tx ty print(tx,ty) print tx ty kock(n-1,tx,ty,p2x,p2y) kock n-1 n 1 tx ty p2x p2y n n p1x p1x p1y p1y p2x p2x p2y p2y n = int(input()) n int(input()) int input() input print(0,0) print 0 0 kock(n,0,0,100,0) kock n 0 0 100 0 print(100,0) print 100 0 n = int(input()) int(input()) n def kock(n,p1x,p1y,p2x,p2y):
    if(n==0):
        return

    sx = (2*p1x+p2x)/3.0
    sy = (2*p1y+p2y)/3.0
    tx = (p1x+2*p2x)/3.0
    ty = (p1y+2*p2y)/3.0

    ux = (tx-sx)*math.cos(math.radians(60)) - (ty-sy)*math.sin(math.radians(60)) + sx
    uy = (tx-sx)*math.sin(math.radians(60)) + (ty-sy)*math.cos(math.radians(60)) + sy

    kock(n-1,p1x,p1y,sx,sy)
    print(sx,sy)
    kock(n-1,sx,sy,ux,uy)
    print(ux,uy)
    kock(n-1,ux,uy,tx,ty)
    print(tx,ty)
    kock(n-1,tx,ty,p2x,p2y) def kock(n,p1x,p1y,p2x,p2y):
    if(n==0):
        return

    sx = (2*p1x+p2x)/3.0
    sy = (2*p1y+p2y)/3.0
    tx = (p1x+2*p2x)/3.0
    ty = (p1y+2*p2y)/3.0

    ux = (tx-sx)*math.cos(math.radians(60)) - (ty-sy)*math.sin(math.radians(60)) + sx
    uy = (tx-sx)*math.sin(math.radians(60)) + (ty-sy)*math.cos(math.radians(60)) + sy

    kock(n-1,p1x,p1y,sx,sy)
    print(sx,sy)
    kock(n-1,sx,sy,ux,uy)
    print(ux,uy)
    kock(n-1,ux,uy,tx,ty)
    print(tx,ty)
    kock(n-1,tx,ty,p2x,p2y) kock
import math

def kock(n,p1x,p1y,p2x,p2y):
    if(n==0):
        return

    sx = (2*p1x+p2x)/3.0
    sy = (2*p1y+p2y)/3.0
    tx = (p1x+2*p2x)/3.0
    ty = (p1y+2*p2y)/3.0

    ux = (tx-sx)*math.cos(math.radians(60)) - (ty-sy)*math.sin(math.radians(60)) + sx
    uy = (tx-sx)*math.sin(math.radians(60)) + (ty-sy)*math.cos(math.radians(60)) + sy

    kock(n-1,p1x,p1y,sx,sy)
    print(sx,sy)
    kock(n-1,sx,sy,ux,uy)
    print(ux,uy)
    kock(n-1,ux,uy,tx,ty)
    print(tx,ty)
    kock(n-1,tx,ty,p2x,p2y)


n = int(input())
print(0,0)
kock(n,0,0,100,0)
print(100,0)
