import math

def CalcCoordinate(xa, ya, xb, yb):
    arg = math.atan2(yb-ya, xb-xa) #角度
    d = math.sqrt((xb-xa)*(xb-xa) + (yb-ya)*(yb-ya)) #AとBの距離
    xc = d/2 #ピタゴラスの定理より
    #S = math.sqrt(3)*d*d/2
    #正三角形にヘロンの公式を適用(3辺の長さが同じなので3*d)
    yc = math.sqrt(3)*d/2

    #if(yb <= ya):
    ux = xc*math.cos(arg) - yc*math.sin(arg) + xa
    uy = xc*math.sin(arg) + yc*math.cos(arg) + ya
    return ux, uy
    """
    else:
        ux = xc*math.cos(arg) + yc*math.sin(arg) + xa
        uy = xc*math.sin(arg) - yc*math.cos(arg) + ya
        return ux, uy
"""

def MakeTriangle(x1, y1, x2, y2, n):
    if(n != 0):
        sx = (2*x1 + x2) / 3
        sy = (2*y1 + y2) / 3
        tx = (x1 + 2*x2) / 3
        ty = (y1 + 2*y2) / 3
        ux, uy = CalcCoordinate(sx, sy, tx, ty)
        MakeTriangle(x1, y1, sx, sy, n-1)
        print(sx, sy)
        MakeTriangle(sx, sy, ux, uy, n-1)
        print(ux, uy)
        MakeTriangle(ux, uy, tx, ty, n-1)
        print(tx, ty)
        MakeTriangle(tx, ty, x2, y2, n-1)
    else:
        return
        
  

x1 = 0
y1 = 0
x2 = 100
y2 = 0

n = int(input())

print(x1, y1)
MakeTriangle(x1, y1, x2, y2, n)
print(x2, y2) import math math def CalcCoordinate(xa, ya, xb, yb):
    arg = math.atan2(yb-ya, xb-xa) #角度
    d = math.sqrt((xb-xa)*(xb-xa) + (yb-ya)*(yb-ya)) #AとBの距離
    xc = d/2 #ピタゴラスの定理より
    #S = math.sqrt(3)*d*d/2
    #正三角形にヘロンの公式を適用(3辺の長さが同じなので3*d)
    yc = math.sqrt(3)*d/2

    #if(yb <= ya):
    ux = xc*math.cos(arg) - yc*math.sin(arg) + xa
    uy = xc*math.sin(arg) + yc*math.cos(arg) + ya
    return ux, uy
    """
    else:
        ux = xc*math.cos(arg) + yc*math.sin(arg) + xa
        uy = xc*math.sin(arg) - yc*math.cos(arg) + ya
        return ux, uy
""" CalcCoordinate arg = math.atan2(yb-ya, xb-xa) arg math.atan2(yb-ya, xb-xa) math.atan2 math atan2 yb-ya yb ya xb-xa xb xa d = math.sqrt((xb-xa)*(xb-xa) + (yb-ya)*(yb-ya)) d math.sqrt((xb-xa)*(xb-xa) + (yb-ya)*(yb-ya)) math.sqrt math sqrt (xb-xa)*(xb-xa) + (yb-ya)*(yb-ya) (xb-xa)*(xb-xa) xb-xa xb xa xb-xa xb xa (yb-ya)*(yb-ya) yb-ya yb ya yb-ya yb ya xc = d/2 xc d/2 d 2 yc = math.sqrt(3)*d/2 yc math.sqrt(3)*d/2 math.sqrt(3)*d math.sqrt(3) math.sqrt math sqrt 3 d 2 ux = xc*math.cos(arg) - yc*math.sin(arg) + xa ux xc*math.cos(arg) - yc*math.sin(arg) + xa xc*math.cos(arg) - yc*math.sin(arg) xc*math.cos(arg) xc math.cos(arg) math.cos math cos arg yc*math.sin(arg) yc math.sin(arg) math.sin math sin arg xa uy = xc*math.sin(arg) + yc*math.cos(arg) + ya uy xc*math.sin(arg) + yc*math.cos(arg) + ya xc*math.sin(arg) + yc*math.cos(arg) xc*math.sin(arg) xc math.sin(arg) math.sin math sin arg yc*math.cos(arg) yc math.cos(arg) math.cos math cos arg ya return ux, uy return ux, uy ux uy """
    else:
        ux = xc*math.cos(arg) + yc*math.sin(arg) + xa
        uy = xc*math.sin(arg) - yc*math.cos(arg) + ya
        return ux, uy
""" xa xa ya ya xb xb yb yb def MakeTriangle(x1, y1, x2, y2, n):
    if(n != 0):
        sx = (2*x1 + x2) / 3
        sy = (2*y1 + y2) / 3
        tx = (x1 + 2*x2) / 3
        ty = (y1 + 2*y2) / 3
        ux, uy = CalcCoordinate(sx, sy, tx, ty)
        MakeTriangle(x1, y1, sx, sy, n-1)
        print(sx, sy)
        MakeTriangle(sx, sy, ux, uy, n-1)
        print(ux, uy)
        MakeTriangle(ux, uy, tx, ty, n-1)
        print(tx, ty)
        MakeTriangle(tx, ty, x2, y2, n-1)
    else:
        return
        
   MakeTriangle if(n != 0):
        sx = (2*x1 + x2) / 3
        sy = (2*y1 + y2) / 3
        tx = (x1 + 2*x2) / 3
        ty = (y1 + 2*y2) / 3
        ux, uy = CalcCoordinate(sx, sy, tx, ty)
        MakeTriangle(x1, y1, sx, sy, n-1)
        print(sx, sy)
        MakeTriangle(sx, sy, ux, uy, n-1)
        print(ux, uy)
        MakeTriangle(ux, uy, tx, ty, n-1)
        print(tx, ty)
        MakeTriangle(tx, ty, x2, y2, n-1)
    else:
        return
        
   n != 0 n 0 sx = (2*x1 + x2) / 3 sx (2*x1 + x2) / 3 2*x1 + x2 2*x1 2 x1 x2 3 sy = (2*y1 + y2) / 3 sy (2*y1 + y2) / 3 2*y1 + y2 2*y1 2 y1 y2 3 tx = (x1 + 2*x2) / 3 tx (x1 + 2*x2) / 3 x1 + 2*x2 x1 2*x2 2 x2 3 ty = (y1 + 2*y2) / 3 ty (y1 + 2*y2) / 3 y1 + 2*y2 y1 2*y2 2 y2 3 ux, uy = CalcCoordinate(sx, sy, tx, ty) ux CalcCoordinate(sx, sy, tx, ty) CalcCoordinate sx sy tx ty uy MakeTriangle(x1, y1, sx, sy, n-1) MakeTriangle x1 y1 sx sy n-1 n 1 print(sx, sy) print sx sy MakeTriangle(sx, sy, ux, uy, n-1) MakeTriangle sx sy ux uy n-1 n 1 print(ux, uy) print ux uy MakeTriangle(ux, uy, tx, ty, n-1) MakeTriangle ux uy tx ty n-1 n 1 print(tx, ty) print tx ty MakeTriangle(tx, ty, x2, y2, n-1) MakeTriangle tx ty x2 y2 n-1 n 1 return x1 x1 y1 y1 x2 x2 y2 y2 n n x1 = 0 x1 0 y1 = 0 y1 0 x2 = 100 x2 100 y2 = 0 y2 0 n = int(input()) n int(input()) int input() input print(x1, y1) print x1 y1 MakeTriangle(x1, y1, x2, y2, n) MakeTriangle x1 y1 x2 y2 n print(x2, y2) print x2 y2 def CalcCoordinate(xa, ya, xb, yb):
    arg = math.atan2(yb-ya, xb-xa) #角度
    d = math.sqrt((xb-xa)*(xb-xa) + (yb-ya)*(yb-ya)) #AとBの距離
    xc = d/2 #ピタゴラスの定理より
    #S = math.sqrt(3)*d*d/2
    #正三角形にヘロンの公式を適用(3辺の長さが同じなので3*d)
    yc = math.sqrt(3)*d/2

    #if(yb <= ya):
    ux = xc*math.cos(arg) - yc*math.sin(arg) + xa
    uy = xc*math.sin(arg) + yc*math.cos(arg) + ya
    return ux, uy
    """
    else:
        ux = xc*math.cos(arg) + yc*math.sin(arg) + xa
        uy = xc*math.sin(arg) - yc*math.cos(arg) + ya
        return ux, uy
""" def CalcCoordinate(xa, ya, xb, yb):
    arg = math.atan2(yb-ya, xb-xa) #角度
    d = math.sqrt((xb-xa)*(xb-xa) + (yb-ya)*(yb-ya)) #AとBの距離
    xc = d/2 #ピタゴラスの定理より
    #S = math.sqrt(3)*d*d/2
    #正三角形にヘロンの公式を適用(3辺の長さが同じなので3*d)
    yc = math.sqrt(3)*d/2

    #if(yb <= ya):
    ux = xc*math.cos(arg) - yc*math.sin(arg) + xa
    uy = xc*math.sin(arg) + yc*math.cos(arg) + ya
    return ux, uy
    """
    else:
        ux = xc*math.cos(arg) + yc*math.sin(arg) + xa
        uy = xc*math.sin(arg) - yc*math.cos(arg) + ya
        return ux, uy
""" CalcCoordinate def MakeTriangle(x1, y1, x2, y2, n):
    if(n != 0):
        sx = (2*x1 + x2) / 3
        sy = (2*y1 + y2) / 3
        tx = (x1 + 2*x2) / 3
        ty = (y1 + 2*y2) / 3
        ux, uy = CalcCoordinate(sx, sy, tx, ty)
        MakeTriangle(x1, y1, sx, sy, n-1)
        print(sx, sy)
        MakeTriangle(sx, sy, ux, uy, n-1)
        print(ux, uy)
        MakeTriangle(ux, uy, tx, ty, n-1)
        print(tx, ty)
        MakeTriangle(tx, ty, x2, y2, n-1)
    else:
        return
        
   def MakeTriangle(x1, y1, x2, y2, n):
    if(n != 0):
        sx = (2*x1 + x2) / 3
        sy = (2*y1 + y2) / 3
        tx = (x1 + 2*x2) / 3
        ty = (y1 + 2*y2) / 3
        ux, uy = CalcCoordinate(sx, sy, tx, ty)
        MakeTriangle(x1, y1, sx, sy, n-1)
        print(sx, sy)
        MakeTriangle(sx, sy, ux, uy, n-1)
        print(ux, uy)
        MakeTriangle(ux, uy, tx, ty, n-1)
        print(tx, ty)
        MakeTriangle(tx, ty, x2, y2, n-1)
    else:
        return
        
   MakeTriangle n = int(input()) int(input()) n y1 = 0 0 y1 y2 = 0 0 y2 x2 = 100 100 x2 x1 = 0 0 x1
import math

def CalcCoordinate(xa, ya, xb, yb):
    arg = math.atan2(yb-ya, xb-xa) #角度
    d = math.sqrt((xb-xa)*(xb-xa) + (yb-ya)*(yb-ya)) #AとBの距離
    xc = d/2 #ピタゴラスの定理より
    #S = math.sqrt(3)*d*d/2
    #正三角形にヘロンの公式を適用(3辺の長さが同じなので3*d)
    yc = math.sqrt(3)*d/2

    #if(yb <= ya):
    ux = xc*math.cos(arg) - yc*math.sin(arg) + xa
    uy = xc*math.sin(arg) + yc*math.cos(arg) + ya
    return ux, uy
    """
    else:
        ux = xc*math.cos(arg) + yc*math.sin(arg) + xa
        uy = xc*math.sin(arg) - yc*math.cos(arg) + ya
        return ux, uy
"""

def MakeTriangle(x1, y1, x2, y2, n):
    if(n != 0):
        sx = (2*x1 + x2) / 3
        sy = (2*y1 + y2) / 3
        tx = (x1 + 2*x2) / 3
        ty = (y1 + 2*y2) / 3
        ux, uy = CalcCoordinate(sx, sy, tx, ty)
        MakeTriangle(x1, y1, sx, sy, n-1)
        print(sx, sy)
        MakeTriangle(sx, sy, ux, uy, n-1)
        print(ux, uy)
        MakeTriangle(ux, uy, tx, ty, n-1)
        print(tx, ty)
        MakeTriangle(tx, ty, x2, y2, n-1)
    else:
        return
        
  

x1 = 0
y1 = 0
x2 = 100
y2 = 0

n = int(input())

print(x1, y1)
MakeTriangle(x1, y1, x2, y2, n)
print(x2, y2)
