#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
ans = []
class P:
    def __init__(self,x,y):
        self.x = x
        self.y = y
    
    def __str__(self):
        return str(self.x) + " " + str(self.y)
    __repr__ = __str__
    

    def __add__(self,p):
        return P(self.x+p.x, self.y+p.y)
    
    __radd__ = __add__
        
    def __sub__(self, p):
        return P(self.x-p.x, self.y-p.y)

    def __mul__(self,other):
        return P(self.x*other, self.y*other)

    def __truediv__(self, other):
        return P(self.x/other, self.y/other)

    # def __rsub__(self, other):
    #     if isinstance(other, ModInt):
    #         return ModInt(other.x - self.x)
    #     else:
    #         return ModInt(other - self.x)


def koch(n,left,right):
    if n==0:
        return 
    w = ((right-left)/3)
    s = left + w
    t = left + w*2
    center = (s+t)/2 #sとtの中点
    vec1 = (t-s)*sqrt(3)/2 #sからtへのベクトルの√3/2倍
    vec2 = P(-vec1.y, vec1.x) 
    u = center + vec2

    #print(left)
    koch(n-1,left, s)
    print(s)
    koch(n-1, s, u)
    print(u)
    koch(n-1,u,t)
    print(t)
    koch(n-1,t,right)
    #print(right)
    


    # print(*left)
    # koch(n-1,left,s)
    # print(*s)
def main():
    n = int(input())
    left = P(0,0)
    right = P(100,0)
    print(left)
    koch(n,P(0,0),P(100,0))
    print(right)
    #print(ans)
if __name__ == '__main__':
    main() import sys sys sys.setrecursionlimit(10**6) sys.setrecursionlimit sys setrecursionlimit 10**6 10 6 input=sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline from math import floor,ceil,sqrt,factorial,log from heapq import heappop, heappush, heappushpop from collections import Counter,defaultdict,deque from itertools import accumulate,permutations,combinations,product,combinations_with_replacement from bisect import bisect_left,bisect_right from copy import deepcopy inf=float('inf') inf float('inf') float 'inf' mod = 10**9+7 mod 10**9+7 10**9 10 9 7 def pprint(*A): 
    for a in A:     print(*a,sep='\n') pprint for a in A:     print(*a,sep=' a A *A def INT_(n): return int(n)-1 INT_ n n def MI(): return map(int,input().split()) MI def MF(): return map(float, input().split()) MF def MI_(): return map(INT_,input().split()) MI_ def LI(): return list(MI()) LI int(x) - 1 for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) - 1 int(x) int x 1 def LI_(): return [int(x) - 1 for x in input().split()] LI_ def LF(): return list(MF()) LF I() for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) I() I def LIN(n:int): return [I() for _ in range(n)] LIN n:int n LI() for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) LI() LI def LLIN(n: int): return [LI() for _ in range(n)] LLIN n: int n LI_() for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) LI_() LI_ def LLIN_(n: int): return [LI_() for _ in range(n)] LLIN_ n: int n list(map(int, l.split() )) for l in input() for l in input() l input() input for l in input() list(map(int, l.split() )) list map(int, l.split() ) map int l.split() l.split l split def LLI(): return [list(map(int, l.split() )) for l in input()] LLI def I(): return int(input()) I def F(): return float(input()) F def ST(): return input().replace('\n', '') ST ans = [] ans [] class P:
    def __init__(self,x,y):
        self.x = x
        self.y = y
    
    def __str__(self):
        return str(self.x) + " " + str(self.y)
    __repr__ = __str__
    

    def __add__(self,p):
        return P(self.x+p.x, self.y+p.y)
    
    __radd__ = __add__
        
    def __sub__(self, p):
        return P(self.x-p.x, self.y-p.y)

    def __mul__(self,other):
        return P(self.x*other, self.y*other)

    def __truediv__(self, other):
        return P(self.x/other, self.y/other)

    # def __rsub__(self, other):
    #     if isinstance(other, ModInt):
    #         return ModInt(other.x - self.x)
    #     else:
    #         return ModInt(other - self.x) P def __init__(self,x,y):
        self.x = x
        self.y = y
    
     __init__ self.x = x self.x self x x self.y = y self.y self y y self self x x y y def __str__(self):
        return str(self.x) + " " + str(self.y)
     __str__ return str(self.x) + " " + str(self.y) str(self.x) + " " + str(self.y) str(self.x) + " " str(self.x) str self.x self x " " str(self.y) str self.y self y self self __repr__ = __str__ __repr__ __str__ def __add__(self,p):
        return P(self.x+p.x, self.y+p.y)
    
     __add__ return P(self.x+p.x, self.y+p.y) P(self.x+p.x, self.y+p.y) P self.x+p.x self.x self x p.x p x self.y+p.y self.y self y p.y p y self self p p __radd__ = __add__ __radd__ __add__ def __sub__(self, p):
        return P(self.x-p.x, self.y-p.y)

     __sub__ return P(self.x-p.x, self.y-p.y) P(self.x-p.x, self.y-p.y) P self.x-p.x self.x self x p.x p x self.y-p.y self.y self y p.y p y self self p p def __mul__(self,other):
        return P(self.x*other, self.y*other)

     __mul__ return P(self.x*other, self.y*other) P(self.x*other, self.y*other) P self.x*other self.x self x other self.y*other self.y self y other self self other other def __truediv__(self, other):
        return P(self.x/other, self.y/other)

    # def __rsub__(self, other):
    #     if isinstance(other, ModInt):
    #         return ModInt(other.x - self.x)
    #     else:
    #         return ModInt(other - self.x) __truediv__ return P(self.x/other, self.y/other) P(self.x/other, self.y/other) P self.x/other self.x self x other self.y/other self.y self y other self self other other def koch(n,left,right):
    if n==0:
        return 
    w = ((right-left)/3)
    s = left + w
    t = left + w*2
    center = (s+t)/2 #sとtの中点
    vec1 = (t-s)*sqrt(3)/2 #sからtへのベクトルの√3/2倍
    vec2 = P(-vec1.y, vec1.x) 
    u = center + vec2

    #print(left)
    koch(n-1,left, s)
    print(s)
    koch(n-1, s, u)
    print(u)
    koch(n-1,u,t)
    print(t)
    koch(n-1,t,right)
    #print(right)
    


    # print(*left)
    # koch(n-1,left,s)
    # print(*s) koch if n==0:
        return 
     n==0 n 0 return w = ((right-left)/3) w (right-left)/3 right-left right left 3 s = left + w s left + w left w t = left + w*2 t left + w*2 left w*2 w 2 center = (s+t)/2 center (s+t)/2 s+t s t 2 vec1 = (t-s)*sqrt(3)/2 vec1 (t-s)*sqrt(3)/2 (t-s)*sqrt(3) t-s t s sqrt(3) sqrt 3 2 vec2 = P(-vec1.y, vec1.x) vec2 P(-vec1.y, vec1.x) P -vec1.y vec1.y vec1 y vec1.x vec1 x u = center + vec2 u center + vec2 center vec2 koch(n-1,left, s) koch n-1 n 1 left s print(s) print s koch(n-1, s, u) koch n-1 n 1 s u print(u) print u koch(n-1,u,t) koch n-1 n 1 u t print(t) print t koch(n-1,t,right) koch n-1 n 1 t right n n left left right right def main():
    n = int(input())
    left = P(0,0)
    right = P(100,0)
    print(left)
    koch(n,P(0,0),P(100,0))
    print(right)
    #print(ans) main n = int(input()) n int(input()) int input() input left = P(0,0) left P(0,0) P 0 0 right = P(100,0) right P(100,0) P 100 0 print(left) print left koch(n,P(0,0),P(100,0)) koch n P(0,0) P 0 0 P(100,0) P 100 0 print(right) print right if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def LF(): return list(MF()) def LF(): return list(MF()) LF def I(): return int(input()) def I(): return int(input()) I def koch(n,left,right):
    if n==0:
        return 
    w = ((right-left)/3)
    s = left + w
    t = left + w*2
    center = (s+t)/2 #sとtの中点
    vec1 = (t-s)*sqrt(3)/2 #sからtへのベクトルの√3/2倍
    vec2 = P(-vec1.y, vec1.x) 
    u = center + vec2

    #print(left)
    koch(n-1,left, s)
    print(s)
    koch(n-1, s, u)
    print(u)
    koch(n-1,u,t)
    print(t)
    koch(n-1,t,right)
    #print(right)
    


    # print(*left)
    # koch(n-1,left,s)
    # print(*s) def koch(n,left,right):
    if n==0:
        return 
    w = ((right-left)/3)
    s = left + w
    t = left + w*2
    center = (s+t)/2 #sとtの中点
    vec1 = (t-s)*sqrt(3)/2 #sからtへのベクトルの√3/2倍
    vec2 = P(-vec1.y, vec1.x) 
    u = center + vec2

    #print(left)
    koch(n-1,left, s)
    print(s)
    koch(n-1, s, u)
    print(u)
    koch(n-1,u,t)
    print(t)
    koch(n-1,t,right)
    #print(right)
    


    # print(*left)
    # koch(n-1,left,s)
    # print(*s) koch def LLI(): return [list(map(int, l.split() )) for l in input()] def LLI(): return [list(map(int, l.split() )) for l in input()] LLI def LLIN(n: int): return [LI() for _ in range(n)] def LLIN(n: int): return [LI() for _ in range(n)] LLIN def LLIN_(n: int): return [LI_() for _ in range(n)] def LLIN_(n: int): return [LI_() for _ in range(n)] LLIN_ class P:
    def __init__(self,x,y):
        self.x = x
        self.y = y
    
    def __str__(self):
        return str(self.x) + " " + str(self.y)
    __repr__ = __str__
    

    def __add__(self,p):
        return P(self.x+p.x, self.y+p.y)
    
    __radd__ = __add__
        
    def __sub__(self, p):
        return P(self.x-p.x, self.y-p.y)

    def __mul__(self,other):
        return P(self.x*other, self.y*other)

    def __truediv__(self, other):
        return P(self.x/other, self.y/other)

    # def __rsub__(self, other):
    #     if isinstance(other, ModInt):
    #         return ModInt(other.x - self.x)
    #     else:
    #         return ModInt(other - self.x) class P:
    def __init__(self,x,y):
        self.x = x
        self.y = y
    
    def __str__(self):
        return str(self.x) + " " + str(self.y)
    __repr__ = __str__
    

    def __add__(self,p):
        return P(self.x+p.x, self.y+p.y)
    
    __radd__ = __add__
        
    def __sub__(self, p):
        return P(self.x-p.x, self.y-p.y)

    def __mul__(self,other):
        return P(self.x*other, self.y*other)

    def __truediv__(self, other):
        return P(self.x/other, self.y/other)

    # def __rsub__(self, other):
    #     if isinstance(other, ModInt):
    #         return ModInt(other.x - self.x)
    #     else:
    #         return ModInt(other - self.x) P def LIN(n:int): return [I() for _ in range(n)] def LIN(n:int): return [I() for _ in range(n)] LIN inf=float('inf') float('inf') inf def LI(): return list(MI()) def LI(): return list(MI()) LI input=sys.stdin.readline sys.stdin.readline input def MF(): return map(float, input().split()) def MF(): return map(float, input().split()) MF def MI(): return map(int,input().split()) def MI(): return map(int,input().split()) MI def INT_(n): return int(n)-1 def INT_(n): return int(n)-1 INT_ def F(): return float(input()) def F(): return float(input()) F def ST(): return input().replace('\n', '') def ST(): return input().replace('\n', '') ST def LI_(): return [int(x) - 1 for x in input().split()] def LI_(): return [int(x) - 1 for x in input().split()] LI_ ans = [] [] ans def pprint(*A): 
    for a in A:     print(*a,sep='\n') def pprint(*A): 
    for a in A:     print(*a,sep='\n') pprint def main():
    n = int(input())
    left = P(0,0)
    right = P(100,0)
    print(left)
    koch(n,P(0,0),P(100,0))
    print(right)
    #print(ans) def main():
    n = int(input())
    left = P(0,0)
    right = P(100,0)
    print(left)
    koch(n,P(0,0),P(100,0))
    print(right)
    #print(ans) main mod = 10**9+7 10**9+7 mod def MI_(): return map(INT_,input().split()) def MI_(): return map(INT_,input().split()) MI_
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
ans = []
class P:
    def __init__(self,x,y):
        self.x = x
        self.y = y
    
    def __str__(self):
        return str(self.x) + " " + str(self.y)
    __repr__ = __str__
    

    def __add__(self,p):
        return P(self.x+p.x, self.y+p.y)
    
    __radd__ = __add__
        
    def __sub__(self, p):
        return P(self.x-p.x, self.y-p.y)

    def __mul__(self,other):
        return P(self.x*other, self.y*other)

    def __truediv__(self, other):
        return P(self.x/other, self.y/other)

    # def __rsub__(self, other):
    #     if isinstance(other, ModInt):
    #         return ModInt(other.x - self.x)
    #     else:
    #         return ModInt(other - self.x)


def koch(n,left,right):
    if n==0:
        return 
    w = ((right-left)/3)
    s = left + w
    t = left + w*2
    center = (s+t)/2 #sとtの中点
    vec1 = (t-s)*sqrt(3)/2 #sからtへのベクトルの√3/2倍
    vec2 = P(-vec1.y, vec1.x) 
    u = center + vec2

    #print(left)
    koch(n-1,left, s)
    print(s)
    koch(n-1, s, u)
    print(u)
    koch(n-1,u,t)
    print(t)
    koch(n-1,t,right)
    #print(right)
    


    # print(*left)
    # koch(n-1,left,s)
    # print(*s)
def main():
    n = int(input())
    left = P(0,0)
    right = P(100,0)
    print(left)
    koch(n,P(0,0),P(100,0))
    print(right)
    #print(ans)
if __name__ == '__main__':
    main()
