#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
???????????????
??´??° n ?????\???????????±??? n ????????°????????????????????£??????????????????
?????????????????????????????§?¨????????????????????????°????????????????????????????????????

????????????????????????????????????????¨???¨????????\?????????????????????
?????????????????¨????????°???????§??????????????????¢????????¨??§???
??\????????????????????°????????¢??°????????????????????¨???????????????????????¨?????§????????????

????????????????????? (p1,p2) ??? 3 ???????????????
????????? 3???????????? 2 ??? s,ts,t ???????????¨????????£????§???¢ (s,u,t) ??????????????????
?????? (p1,s)????????? (s,u)????????? (u,t)????????? (t,p2)?????????????????°???????????????????????°????????????

"""
import math

X = 0
Y = 1
sin60 = math.sin(math.radians(60))
cos60 = math.cos(math.radians(60))

def fn(P1, P2, n, l):
    l += 1
    if l > n:
        return [P1,P2]
    
    x3 = (P2[X] -P1[X]) / 3
    y3 = (P2[Y] -P1[Y]) / 3
    xa = x3 + P1[X]
    ya = y3 + P1[Y]
    xc = P2[X] - x3
    yc = P2[Y] - y3
    xb = (xc - xa) * cos60 - (yc - ya) * sin60 + xa
    yb = (xc - xa) * sin60 + (yc - ya) * cos60 + ya
    Pa = [xa,ya]
    Pb = [xb,yb]
    Pc = [xc,yc]
    Ps = [P1]
    f1 = fn(P1,Pa,n,l)
    f2 = fn(Pa,Pb,n,l)
    f3 = fn(Pb,Pc,n,l)
    f4 = fn(Pc,P2,n,l)
    Ps.extend(f1[1:])
    Ps.extend(f2[1:])
    Ps.extend(f3[1:])
    Ps.extend(f4[1:])
    return Ps

def main():
    """ ????????? """
    num = int(input().strip())
    p1 = [0,0]
    p2 = [100,0]
    k = fn(p1,p2,num,0)
    for i in k:
        print("{} {}".format(i[0],i[1]))

if __name__ == '__main__':
    main() """
???????????????
??´??° n ?????\???????????±??? n ????????°????????????????????£??????????????????
?????????????????????????????§?¨????????????????????????°????????????????????????????????????

????????????????????????????????????????¨???¨????????\?????????????????????
?????????????????¨????????°???????§??????????????????¢????????¨??§???
??\????????????????????°????????¢??°????????????????????¨???????????????????????¨?????§????????????

????????????????????? (p1,p2) ??? 3 ???????????????
????????? 3???????????? 2 ??? s,ts,t ???????????¨????????£????§???¢ (s,u,t) ??????????????????
?????? (p1,s)????????? (s,u)????????? (u,t)????????? (t,p2)?????????????????°???????????????????????°????????????

""" import math math X = 0 X 0 Y = 1 Y 1 sin60 = math.sin(math.radians(60)) sin60 math.sin(math.radians(60)) math.sin math sin math.radians(60) math.radians math radians 60 cos60 = math.cos(math.radians(60)) cos60 math.cos(math.radians(60)) math.cos math cos math.radians(60) math.radians math radians 60 def fn(P1, P2, n, l):
    l += 1
    if l > n:
        return [P1,P2]
    
    x3 = (P2[X] -P1[X]) / 3
    y3 = (P2[Y] -P1[Y]) / 3
    xa = x3 + P1[X]
    ya = y3 + P1[Y]
    xc = P2[X] - x3
    yc = P2[Y] - y3
    xb = (xc - xa) * cos60 - (yc - ya) * sin60 + xa
    yb = (xc - xa) * sin60 + (yc - ya) * cos60 + ya
    Pa = [xa,ya]
    Pb = [xb,yb]
    Pc = [xc,yc]
    Ps = [P1]
    f1 = fn(P1,Pa,n,l)
    f2 = fn(Pa,Pb,n,l)
    f3 = fn(Pb,Pc,n,l)
    f4 = fn(Pc,P2,n,l)
    Ps.extend(f1[1:])
    Ps.extend(f2[1:])
    Ps.extend(f3[1:])
    Ps.extend(f4[1:])
    return Ps fn l += 1 l 1 if l > n:
        return [P1,P2]
    
     l > n l n return [P1,P2] [P1,P2] P1 P2 x3 = (P2[X] -P1[X]) / 3 x3 (P2[X] -P1[X]) / 3 P2[X] -P1[X] P2[X] P2 X P1[X] P1 X 3 y3 = (P2[Y] -P1[Y]) / 3 y3 (P2[Y] -P1[Y]) / 3 P2[Y] -P1[Y] P2[Y] P2 Y P1[Y] P1 Y 3 xa = x3 + P1[X] xa x3 + P1[X] x3 P1[X] P1 X ya = y3 + P1[Y] ya y3 + P1[Y] y3 P1[Y] P1 Y xc = P2[X] - x3 xc P2[X] - x3 P2[X] P2 X x3 yc = P2[Y] - y3 yc P2[Y] - y3 P2[Y] P2 Y y3 xb = (xc - xa) * cos60 - (yc - ya) * sin60 + xa xb (xc - xa) * cos60 - (yc - ya) * sin60 + xa (xc - xa) * cos60 - (yc - ya) * sin60 (xc - xa) * cos60 xc - xa xc xa cos60 (yc - ya) * sin60 yc - ya yc ya sin60 xa yb = (xc - xa) * sin60 + (yc - ya) * cos60 + ya yb (xc - xa) * sin60 + (yc - ya) * cos60 + ya (xc - xa) * sin60 + (yc - ya) * cos60 (xc - xa) * sin60 xc - xa xc xa sin60 (yc - ya) * cos60 yc - ya yc ya cos60 ya Pa = [xa,ya] Pa [xa,ya] xa ya Pb = [xb,yb] Pb [xb,yb] xb yb Pc = [xc,yc] Pc [xc,yc] xc yc Ps = [P1] Ps [P1] P1 f1 = fn(P1,Pa,n,l) f1 fn(P1,Pa,n,l) fn P1 Pa n l f2 = fn(Pa,Pb,n,l) f2 fn(Pa,Pb,n,l) fn Pa Pb n l f3 = fn(Pb,Pc,n,l) f3 fn(Pb,Pc,n,l) fn Pb Pc n l f4 = fn(Pc,P2,n,l) f4 fn(Pc,P2,n,l) fn Pc P2 n l Ps.extend(f1[1:]) Ps.extend Ps extend f1[1:] f1 1: 1 Ps.extend(f2[1:]) Ps.extend Ps extend f2[1:] f2 1: 1 Ps.extend(f3[1:]) Ps.extend Ps extend f3[1:] f3 1: 1 Ps.extend(f4[1:]) Ps.extend Ps extend f4[1:] f4 1: 1 return Ps Ps P1 P1 P2 P2 n n l l def main():
    """ ????????? """
    num = int(input().strip())
    p1 = [0,0]
    p2 = [100,0]
    k = fn(p1,p2,num,0)
    for i in k:
        print("{} {}".format(i[0],i[1])) main """ ????????? """ num = int(input().strip()) num int(input().strip()) int input().strip() ().strip () input strip p1 = [0,0] p1 [0,0] 0 0 p2 = [100,0] p2 [100,0] 100 0 k = fn(p1,p2,num,0) k fn(p1,p2,num,0) fn p1 p2 num 0 for i in k:
        print("{} {}".format(i[0],i[1])) i k print("{} {}".format(i[0],i[1])) print "{} {}".format(i[0],i[1]) "{} {}".format "{} {}" format i[0] i 0 i[1] i 1 if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main X = 0 0 X cos60 = math.cos(math.radians(60)) math.cos(math.radians(60)) cos60 Y = 1 1 Y def main():
    """ ????????? """
    num = int(input().strip())
    p1 = [0,0]
    p2 = [100,0]
    k = fn(p1,p2,num,0)
    for i in k:
        print("{} {}".format(i[0],i[1])) def main():
    """ ????????? """
    num = int(input().strip())
    p1 = [0,0]
    p2 = [100,0]
    k = fn(p1,p2,num,0)
    for i in k:
        print("{} {}".format(i[0],i[1])) main sin60 = math.sin(math.radians(60)) math.sin(math.radians(60)) sin60 def fn(P1, P2, n, l):
    l += 1
    if l > n:
        return [P1,P2]
    
    x3 = (P2[X] -P1[X]) / 3
    y3 = (P2[Y] -P1[Y]) / 3
    xa = x3 + P1[X]
    ya = y3 + P1[Y]
    xc = P2[X] - x3
    yc = P2[Y] - y3
    xb = (xc - xa) * cos60 - (yc - ya) * sin60 + xa
    yb = (xc - xa) * sin60 + (yc - ya) * cos60 + ya
    Pa = [xa,ya]
    Pb = [xb,yb]
    Pc = [xc,yc]
    Ps = [P1]
    f1 = fn(P1,Pa,n,l)
    f2 = fn(Pa,Pb,n,l)
    f3 = fn(Pb,Pc,n,l)
    f4 = fn(Pc,P2,n,l)
    Ps.extend(f1[1:])
    Ps.extend(f2[1:])
    Ps.extend(f3[1:])
    Ps.extend(f4[1:])
    return Ps def fn(P1, P2, n, l):
    l += 1
    if l > n:
        return [P1,P2]
    
    x3 = (P2[X] -P1[X]) / 3
    y3 = (P2[Y] -P1[Y]) / 3
    xa = x3 + P1[X]
    ya = y3 + P1[Y]
    xc = P2[X] - x3
    yc = P2[Y] - y3
    xb = (xc - xa) * cos60 - (yc - ya) * sin60 + xa
    yb = (xc - xa) * sin60 + (yc - ya) * cos60 + ya
    Pa = [xa,ya]
    Pb = [xb,yb]
    Pc = [xc,yc]
    Ps = [P1]
    f1 = fn(P1,Pa,n,l)
    f2 = fn(Pa,Pb,n,l)
    f3 = fn(Pb,Pc,n,l)
    f4 = fn(Pc,P2,n,l)
    Ps.extend(f1[1:])
    Ps.extend(f2[1:])
    Ps.extend(f3[1:])
    Ps.extend(f4[1:])
    return Ps fn
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
???????????????
??´??° n ?????\???????????±??? n ????????°????????????????????£??????????????????
?????????????????????????????§?¨????????????????????????°????????????????????????????????????

????????????????????????????????????????¨???¨????????\?????????????????????
?????????????????¨????????°???????§??????????????????¢????????¨??§???
??\????????????????????°????????¢??°????????????????????¨???????????????????????¨?????§????????????

????????????????????? (p1,p2) ??? 3 ???????????????
????????? 3???????????? 2 ??? s,ts,t ???????????¨????????£????§???¢ (s,u,t) ??????????????????
?????? (p1,s)????????? (s,u)????????? (u,t)????????? (t,p2)?????????????????°???????????????????????°????????????

"""
import math

X = 0
Y = 1
sin60 = math.sin(math.radians(60))
cos60 = math.cos(math.radians(60))

def fn(P1, P2, n, l):
    l += 1
    if l > n:
        return [P1,P2]
    
    x3 = (P2[X] -P1[X]) / 3
    y3 = (P2[Y] -P1[Y]) / 3
    xa = x3 + P1[X]
    ya = y3 + P1[Y]
    xc = P2[X] - x3
    yc = P2[Y] - y3
    xb = (xc - xa) * cos60 - (yc - ya) * sin60 + xa
    yb = (xc - xa) * sin60 + (yc - ya) * cos60 + ya
    Pa = [xa,ya]
    Pb = [xb,yb]
    Pc = [xc,yc]
    Ps = [P1]
    f1 = fn(P1,Pa,n,l)
    f2 = fn(Pa,Pb,n,l)
    f3 = fn(Pb,Pc,n,l)
    f4 = fn(Pc,P2,n,l)
    Ps.extend(f1[1:])
    Ps.extend(f2[1:])
    Ps.extend(f3[1:])
    Ps.extend(f4[1:])
    return Ps

def main():
    """ ????????? """
    num = int(input().strip())
    p1 = [0,0]
    p2 = [100,0]
    k = fn(p1,p2,num,0)
    for i in k:
        print("{} {}".format(i[0],i[1]))

if __name__ == '__main__':
    main()