import math

def curve(inp):
    ret = []
    n = len(inp)
    cos60 = math.cos(math.radians(60))
    sin60 = math.sin(math.radians(60))
    for i in range(n - 1):
        p1x, p1y = inp[i]
        p2x, p2y = inp[i+1]
        
        diffx = (p2x - p1x) / 3
        diffy = (p2y - p1y) / 3
        sx, sy = p1x + diffx, p1y + diffy
        ux = sx + diffx * cos60 - diffy * sin60
        uy = sy + diffx * sin60 + diffy * cos60
        tx, ty = p2x - diffx, p2y - diffy
        
        ret.extend([(p1x, p1y), (sx, sy), (ux, uy), (tx, ty)])
    ret.append(inp[-1])
        
    return ret
      
      
if __name__=="__main__":
    inp = [(0.0, 0.0), (100.0, 0.0)]
    N = int(input())
    for i in range(N):
        inp = curve(inp)
    for i in inp:
      print(*i) import math math def curve(inp):
    ret = []
    n = len(inp)
    cos60 = math.cos(math.radians(60))
    sin60 = math.sin(math.radians(60))
    for i in range(n - 1):
        p1x, p1y = inp[i]
        p2x, p2y = inp[i+1]
        
        diffx = (p2x - p1x) / 3
        diffy = (p2y - p1y) / 3
        sx, sy = p1x + diffx, p1y + diffy
        ux = sx + diffx * cos60 - diffy * sin60
        uy = sy + diffx * sin60 + diffy * cos60
        tx, ty = p2x - diffx, p2y - diffy
        
        ret.extend([(p1x, p1y), (sx, sy), (ux, uy), (tx, ty)])
    ret.append(inp[-1])
        
    return ret
      
       curve ret = [] ret [] n = len(inp) n len(inp) len inp cos60 = math.cos(math.radians(60)) cos60 math.cos(math.radians(60)) math.cos math cos math.radians(60) math.radians math radians 60 sin60 = math.sin(math.radians(60)) sin60 math.sin(math.radians(60)) math.sin math sin math.radians(60) math.radians math radians 60 for i in range(n - 1):
        p1x, p1y = inp[i]
        p2x, p2y = inp[i+1]
        
        diffx = (p2x - p1x) / 3
        diffy = (p2y - p1y) / 3
        sx, sy = p1x + diffx, p1y + diffy
        ux = sx + diffx * cos60 - diffy * sin60
        uy = sy + diffx * sin60 + diffy * cos60
        tx, ty = p2x - diffx, p2y - diffy
        
        ret.extend([(p1x, p1y), (sx, sy), (ux, uy), (tx, ty)])
     i range(n - 1) range n - 1 n 1 p1x, p1y = inp[i] p1x inp[i] inp i p1y p2x, p2y = inp[i+1] p2x inp[i+1] inp i+1 i 1 p2y diffx = (p2x - p1x) / 3 diffx (p2x - p1x) / 3 p2x - p1x p2x p1x 3 diffy = (p2y - p1y) / 3 diffy (p2y - p1y) / 3 p2y - p1y p2y p1y 3 sx, sy = p1x + diffx, p1y + diffy sx p1x + diffx p1x diffx sy p1y + diffy p1y diffy ux = sx + diffx * cos60 - diffy * sin60 ux sx + diffx * cos60 - diffy * sin60 sx + diffx * cos60 sx diffx * cos60 diffx cos60 diffy * sin60 diffy sin60 uy = sy + diffx * sin60 + diffy * cos60 uy sy + diffx * sin60 + diffy * cos60 sy + diffx * sin60 sy diffx * sin60 diffx sin60 diffy * cos60 diffy cos60 tx, ty = p2x - diffx, p2y - diffy tx p2x - diffx p2x diffx ty p2y - diffy p2y diffy ret.extend([(p1x, p1y), (sx, sy), (ux, uy), (tx, ty)]) ret.extend ret extend [(p1x, p1y), (sx, sy), (ux, uy), (tx, ty)] (p1x, p1y) p1x p1y (sx, sy) sx sy (ux, uy) ux uy (tx, ty) tx ty ret.append(inp[-1]) ret.append ret append inp[-1] inp -1 return ret ret inp inp if __name__=="__main__":
    inp = [(0.0, 0.0), (100.0, 0.0)]
    N = int(input())
    for i in range(N):
        inp = curve(inp)
    for i in inp:
      print(*i) __name__=="__main__" __name__ "__main__" inp = [(0.0, 0.0), (100.0, 0.0)] inp [(0.0, 0.0), (100.0, 0.0)] (0.0, 0.0) 0.0 0.0 (100.0, 0.0) 100.0 0.0 N = int(input()) N int(input()) int input() input for i in range(N):
        inp = curve(inp)
     i range(N) range N inp = curve(inp) inp curve(inp) curve inp for i in inp:
      print(*i) i inp print(*i) print *i i N = int(input()) int(input()) N inp = curve(inp) curve(inp) inp def curve(inp):
    ret = []
    n = len(inp)
    cos60 = math.cos(math.radians(60))
    sin60 = math.sin(math.radians(60))
    for i in range(n - 1):
        p1x, p1y = inp[i]
        p2x, p2y = inp[i+1]
        
        diffx = (p2x - p1x) / 3
        diffy = (p2y - p1y) / 3
        sx, sy = p1x + diffx, p1y + diffy
        ux = sx + diffx * cos60 - diffy * sin60
        uy = sy + diffx * sin60 + diffy * cos60
        tx, ty = p2x - diffx, p2y - diffy
        
        ret.extend([(p1x, p1y), (sx, sy), (ux, uy), (tx, ty)])
    ret.append(inp[-1])
        
    return ret
      
       def curve(inp):
    ret = []
    n = len(inp)
    cos60 = math.cos(math.radians(60))
    sin60 = math.sin(math.radians(60))
    for i in range(n - 1):
        p1x, p1y = inp[i]
        p2x, p2y = inp[i+1]
        
        diffx = (p2x - p1x) / 3
        diffy = (p2y - p1y) / 3
        sx, sy = p1x + diffx, p1y + diffy
        ux = sx + diffx * cos60 - diffy * sin60
        uy = sy + diffx * sin60 + diffy * cos60
        tx, ty = p2x - diffx, p2y - diffy
        
        ret.extend([(p1x, p1y), (sx, sy), (ux, uy), (tx, ty)])
    ret.append(inp[-1])
        
    return ret
      
       curve inp = [(0.0, 0.0), (100.0, 0.0)] [(0.0, 0.0), (100.0, 0.0)] inp
import math

def curve(inp):
    ret = []
    n = len(inp)
    cos60 = math.cos(math.radians(60))
    sin60 = math.sin(math.radians(60))
    for i in range(n - 1):
        p1x, p1y = inp[i]
        p2x, p2y = inp[i+1]
        
        diffx = (p2x - p1x) / 3
        diffy = (p2y - p1y) / 3
        sx, sy = p1x + diffx, p1y + diffy
        ux = sx + diffx * cos60 - diffy * sin60
        uy = sy + diffx * sin60 + diffy * cos60
        tx, ty = p2x - diffx, p2y - diffy
        
        ret.extend([(p1x, p1y), (sx, sy), (ux, uy), (tx, ty)])
    ret.append(inp[-1])
        
    return ret
      
      
if __name__=="__main__":
    inp = [(0.0, 0.0), (100.0, 0.0)]
    N = int(input())
    for i in range(N):
        inp = curve(inp)
    for i in inp:
      print(*i)
