import math

class Point:
    def __init__(self,x,y):
        self.x = x
        self.y = y

    def __add__(self,a):
        return self.__class__(self.x+a.x,self.y+a.y)

    def __sub__(self,a):
        return self.__class__(self.x-a.x,self.y-a.y)

    def __mul__(self,d):
        return self.__class__(self.x*d,self.y*d)

    def __truediv__(self,d):
        return self.__class__(self.x/d,self.y/d)

    def __str__(self):
        return '%.10f %.10f'%(self.x,self.y)

    def abs(self):
        return (self.x*self.x+self.y*self.y)**(1.0/2.0)

    def rotate(self,d):
        r = math.pi*d/180.0
        return self.__class__( self.x*math.cos(r)-self.y*math.sin(r),
                               self.x*math.sin(r)+self.y*math.cos(r))

def func(p1,p2,n):

    if n==0:return

    v = (p2-p1)
    a = p1+v/3.0
    c = p1+v*2.0/3.0
    b = a+(c-a).rotate(60.0)

    func(p1,a,n-1)
    print (a)
    func(a,b,n-1)
    print (b)
    func(b,c,n-1)
    print (c)
    func(c,p2,n-1)

def main():
    n = int(input())
    a = Point(0.0,0.0)
    b = Point(100.0,0.0)
    print (a)
    func(a,b,n)
    print (b)

if __name__ == '__main__':
    main()

 import math math class Point:
    def __init__(self,x,y):
        self.x = x
        self.y = y

    def __add__(self,a):
        return self.__class__(self.x+a.x,self.y+a.y)

    def __sub__(self,a):
        return self.__class__(self.x-a.x,self.y-a.y)

    def __mul__(self,d):
        return self.__class__(self.x*d,self.y*d)

    def __truediv__(self,d):
        return self.__class__(self.x/d,self.y/d)

    def __str__(self):
        return '%.10f %.10f'%(self.x,self.y)

    def abs(self):
        return (self.x*self.x+self.y*self.y)**(1.0/2.0)

    def rotate(self,d):
        r = math.pi*d/180.0
        return self.__class__( self.x*math.cos(r)-self.y*math.sin(r),
                               self.x*math.sin(r)+self.y*math.cos(r)) Point 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 __add__(self,a):
        return self.__class__(self.x+a.x,self.y+a.y)

     __add__ return self.__class__(self.x+a.x,self.y+a.y) self.__class__(self.x+a.x,self.y+a.y) self.__class__ self __class__ self.x+a.x self.x self x a.x a x self.y+a.y self.y self y a.y a y self self a a def __sub__(self,a):
        return self.__class__(self.x-a.x,self.y-a.y)

     __sub__ return self.__class__(self.x-a.x,self.y-a.y) self.__class__(self.x-a.x,self.y-a.y) self.__class__ self __class__ self.x-a.x self.x self x a.x a x self.y-a.y self.y self y a.y a y self self a a def __mul__(self,d):
        return self.__class__(self.x*d,self.y*d)

     __mul__ return self.__class__(self.x*d,self.y*d) self.__class__(self.x*d,self.y*d) self.__class__ self __class__ self.x*d self.x self x d self.y*d self.y self y d self self d d def __truediv__(self,d):
        return self.__class__(self.x/d,self.y/d)

     __truediv__ return self.__class__(self.x/d,self.y/d) self.__class__(self.x/d,self.y/d) self.__class__ self __class__ self.x/d self.x self x d self.y/d self.y self y d self self d d def __str__(self):
        return '%.10f %.10f'%(self.x,self.y)

     __str__ return '%.10f %.10f'%(self.x,self.y) '%.10f %.10f'%(self.x,self.y) '%.10f %.10f' (self.x,self.y) self.x self x self.y self y self self def abs(self):
        return (self.x*self.x+self.y*self.y)**(1.0/2.0)

     abs return (self.x*self.x+self.y*self.y)**(1.0/2.0) (self.x*self.x+self.y*self.y)**(1.0/2.0) self.x*self.x+self.y*self.y self.x*self.x self.x self x self.x self x self.y*self.y self.y self y self.y self y 1.0/2.0 1.0 2.0 self self def rotate(self,d):
        r = math.pi*d/180.0
        return self.__class__( self.x*math.cos(r)-self.y*math.sin(r),
                               self.x*math.sin(r)+self.y*math.cos(r)) rotate r = math.pi*d/180.0 r math.pi*d/180.0 math.pi*d math.pi math pi d 180.0 return self.__class__( self.x*math.cos(r)-self.y*math.sin(r),
                               self.x*math.sin(r)+self.y*math.cos(r)) self.__class__( self.x*math.cos(r)-self.y*math.sin(r),
                               self.x*math.sin(r)+self.y*math.cos(r)) self.__class__ self __class__ self.x*math.cos(r)-self.y*math.sin(r) self.x*math.cos(r) self.x self x math.cos(r) math.cos math cos r self.y*math.sin(r) self.y self y math.sin(r) math.sin math sin r self.x*math.sin(r)+self.y*math.cos(r) self.x*math.sin(r) self.x self x math.sin(r) math.sin math sin r self.y*math.cos(r) self.y self y math.cos(r) math.cos math cos r self self d d def func(p1,p2,n):

    if n==0:return

    v = (p2-p1)
    a = p1+v/3.0
    c = p1+v*2.0/3.0
    b = a+(c-a).rotate(60.0)

    func(p1,a,n-1)
    print (a)
    func(a,b,n-1)
    print (b)
    func(b,c,n-1)
    print (c)
    func(c,p2,n-1) func if n==0:return

     n==0 n 0 v = (p2-p1) v p2-p1 p2 p1 a = p1+v/3.0 a p1+v/3.0 p1 v/3.0 v 3.0 c = p1+v*2.0/3.0 c p1+v*2.0/3.0 p1 v*2.0/3.0 v*2.0 v 2.0 3.0 b = a+(c-a).rotate(60.0) b a+(c-a).rotate(60.0) a (c-a).rotate(60.0) c-a).rotate c-a c a rotate 60.0 func(p1,a,n-1) func p1 a n-1 n 1 print (a) print a func(a,b,n-1) func a b n-1 n 1 print (b) print b func(b,c,n-1) func b c n-1 n 1 print (c) print c func(c,p2,n-1) func c p2 n-1 n 1 p1 p1 p2 p2 n n def main():
    n = int(input())
    a = Point(0.0,0.0)
    b = Point(100.0,0.0)
    print (a)
    func(a,b,n)
    print (b) main n = int(input()) n int(input()) int input() input a = Point(0.0,0.0) a Point(0.0,0.0) Point 0.0 0.0 b = Point(100.0,0.0) b Point(100.0,0.0) Point 100.0 0.0 print (a) print a func(a,b,n) func a b n print (b) print b if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main class Point:
    def __init__(self,x,y):
        self.x = x
        self.y = y

    def __add__(self,a):
        return self.__class__(self.x+a.x,self.y+a.y)

    def __sub__(self,a):
        return self.__class__(self.x-a.x,self.y-a.y)

    def __mul__(self,d):
        return self.__class__(self.x*d,self.y*d)

    def __truediv__(self,d):
        return self.__class__(self.x/d,self.y/d)

    def __str__(self):
        return '%.10f %.10f'%(self.x,self.y)

    def abs(self):
        return (self.x*self.x+self.y*self.y)**(1.0/2.0)

    def rotate(self,d):
        r = math.pi*d/180.0
        return self.__class__( self.x*math.cos(r)-self.y*math.sin(r),
                               self.x*math.sin(r)+self.y*math.cos(r)) class Point:
    def __init__(self,x,y):
        self.x = x
        self.y = y

    def __add__(self,a):
        return self.__class__(self.x+a.x,self.y+a.y)

    def __sub__(self,a):
        return self.__class__(self.x-a.x,self.y-a.y)

    def __mul__(self,d):
        return self.__class__(self.x*d,self.y*d)

    def __truediv__(self,d):
        return self.__class__(self.x/d,self.y/d)

    def __str__(self):
        return '%.10f %.10f'%(self.x,self.y)

    def abs(self):
        return (self.x*self.x+self.y*self.y)**(1.0/2.0)

    def rotate(self,d):
        r = math.pi*d/180.0
        return self.__class__( self.x*math.cos(r)-self.y*math.sin(r),
                               self.x*math.sin(r)+self.y*math.cos(r)) Point def main():
    n = int(input())
    a = Point(0.0,0.0)
    b = Point(100.0,0.0)
    print (a)
    func(a,b,n)
    print (b) def main():
    n = int(input())
    a = Point(0.0,0.0)
    b = Point(100.0,0.0)
    print (a)
    func(a,b,n)
    print (b) main def func(p1,p2,n):

    if n==0:return

    v = (p2-p1)
    a = p1+v/3.0
    c = p1+v*2.0/3.0
    b = a+(c-a).rotate(60.0)

    func(p1,a,n-1)
    print (a)
    func(a,b,n-1)
    print (b)
    func(b,c,n-1)
    print (c)
    func(c,p2,n-1) def func(p1,p2,n):

    if n==0:return

    v = (p2-p1)
    a = p1+v/3.0
    c = p1+v*2.0/3.0
    b = a+(c-a).rotate(60.0)

    func(p1,a,n-1)
    print (a)
    func(a,b,n-1)
    print (b)
    func(b,c,n-1)
    print (c)
    func(c,p2,n-1) func
import math

class Point:
    def __init__(self,x,y):
        self.x = x
        self.y = y

    def __add__(self,a):
        return self.__class__(self.x+a.x,self.y+a.y)

    def __sub__(self,a):
        return self.__class__(self.x-a.x,self.y-a.y)

    def __mul__(self,d):
        return self.__class__(self.x*d,self.y*d)

    def __truediv__(self,d):
        return self.__class__(self.x/d,self.y/d)

    def __str__(self):
        return '%.10f %.10f'%(self.x,self.y)

    def abs(self):
        return (self.x*self.x+self.y*self.y)**(1.0/2.0)

    def rotate(self,d):
        r = math.pi*d/180.0
        return self.__class__( self.x*math.cos(r)-self.y*math.sin(r),
                               self.x*math.sin(r)+self.y*math.cos(r))

def func(p1,p2,n):

    if n==0:return

    v = (p2-p1)
    a = p1+v/3.0
    c = p1+v*2.0/3.0
    b = a+(c-a).rotate(60.0)

    func(p1,a,n-1)
    print (a)
    func(a,b,n-1)
    print (b)
    func(b,c,n-1)
    print (c)
    func(c,p2,n-1)

def main():
    n = int(input())
    a = Point(0.0,0.0)
    b = Point(100.0,0.0)
    print (a)
    func(a,b,n)
    print (b)

if __name__ == '__main__':
    main()


