import sys
import math
import copy
from typing import Tuple, List, Union
input = sys.stdin.readline

sin60 = math.sqrt(3) / 2
cos60 = 1/ 2

class Position:
    def __init__(self, x, y):
        self.x = x
        self.y = y
    def __repr__(self):
        return "{:.8f} {:.8f}".format(self.x, self.y)


def koch(n: int, p1, p2):
    if n == 0:
        return
    s = Position((2 * p1.x + p2.x) / 3, (2 * p1.y + p2.y) / 3)
    t = Position((p1.x + 2 * p2.x) / 3, (p1.y +  2 * p2.y) / 3)
    u = Position((t.x - s.x) * cos60 - (t.y - s.y) * sin60 + s.x,
                 (t.x - s.x) * sin60 + (t.y - s.y) * cos60 + s.y)
    koch(n - 1, p1, s)
    print(s)
    koch(n-1, s, u)
    print(u)
    koch(n-1, u, t)
    print(t)
    koch(n-1, t, p2)



def main():
    n = int(input())
    p1 = Position(0.0, 0.0)
    p2 = Position(100.0, 0.0)
    print(p1)
    koch(n, p1, p2)
    print(p2)

if __name__ == '__main__':
    main()
 import sys sys import math math import copy copy from typing import Tuple, List, Union input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline sin60 = math.sqrt(3) / 2 sin60 math.sqrt(3) / 2 math.sqrt(3) math.sqrt math sqrt 3 2 cos60 = 1/ 2 cos60 1/ 2 1 2 class Position:
    def __init__(self, x, y):
        self.x = x
        self.y = y
    def __repr__(self):
        return "{:.8f} {:.8f}".format(self.x, self.y) Position 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 __repr__(self):
        return "{:.8f} {:.8f}".format(self.x, self.y) __repr__ return "{:.8f} {:.8f}".format(self.x, self.y) "{:.8f} {:.8f}".format(self.x, self.y) "{:.8f} {:.8f}".format "{:.8f} {:.8f}" format self.x self x self.y self y self self def koch(n: int, p1, p2):
    if n == 0:
        return
    s = Position((2 * p1.x + p2.x) / 3, (2 * p1.y + p2.y) / 3)
    t = Position((p1.x + 2 * p2.x) / 3, (p1.y +  2 * p2.y) / 3)
    u = Position((t.x - s.x) * cos60 - (t.y - s.y) * sin60 + s.x,
                 (t.x - s.x) * sin60 + (t.y - s.y) * cos60 + s.y)
    koch(n - 1, p1, s)
    print(s)
    koch(n-1, s, u)
    print(u)
    koch(n-1, u, t)
    print(t)
    koch(n-1, t, p2) koch if n == 0:
        return
     n == 0 n 0 return s = Position((2 * p1.x + p2.x) / 3, (2 * p1.y + p2.y) / 3) s Position((2 * p1.x + p2.x) / 3, (2 * p1.y + p2.y) / 3) Position (2 * p1.x + p2.x) / 3 2 * p1.x + p2.x 2 * p1.x 2 p1.x p1 x p2.x p2 x 3 (2 * p1.y + p2.y) / 3 2 * p1.y + p2.y 2 * p1.y 2 p1.y p1 y p2.y p2 y 3 t = Position((p1.x + 2 * p2.x) / 3, (p1.y +  2 * p2.y) / 3) t Position((p1.x + 2 * p2.x) / 3, (p1.y +  2 * p2.y) / 3) Position (p1.x + 2 * p2.x) / 3 p1.x + 2 * p2.x p1.x p1 x 2 * p2.x 2 p2.x p2 x 3 (p1.y +  2 * p2.y) / 3 p1.y +  2 * p2.y p1.y p1 y 2 * p2.y 2 p2.y p2 y 3 u = Position((t.x - s.x) * cos60 - (t.y - s.y) * sin60 + s.x,
                 (t.x - s.x) * sin60 + (t.y - s.y) * cos60 + s.y) u Position((t.x - s.x) * cos60 - (t.y - s.y) * sin60 + s.x,
                 (t.x - s.x) * sin60 + (t.y - s.y) * cos60 + s.y) Position (t.x - s.x) * cos60 - (t.y - s.y) * sin60 + s.x (t.x - s.x) * cos60 - (t.y - s.y) * sin60 (t.x - s.x) * cos60 t.x - s.x t.x t x s.x s x cos60 (t.y - s.y) * sin60 t.y - s.y t.y t y s.y s y sin60 s.x s x (t.x - s.x) * sin60 + (t.y - s.y) * cos60 + s.y (t.x - s.x) * sin60 + (t.y - s.y) * cos60 (t.x - s.x) * sin60 t.x - s.x t.x t x s.x s x sin60 (t.y - s.y) * cos60 t.y - s.y t.y t y s.y s y cos60 s.y s y koch(n - 1, p1, s) koch n - 1 n 1 p1 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, p2) koch n-1 n 1 t p2 n: int n p1 p1 p2 p2 def main():
    n = int(input())
    p1 = Position(0.0, 0.0)
    p2 = Position(100.0, 0.0)
    print(p1)
    koch(n, p1, p2)
    print(p2) main n = int(input()) n int(input()) int input() input p1 = Position(0.0, 0.0) p1 Position(0.0, 0.0) Position 0.0 0.0 p2 = Position(100.0, 0.0) p2 Position(100.0, 0.0) Position 100.0 0.0 print(p1) print p1 koch(n, p1, p2) koch n p1 p2 print(p2) print p2 if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main input = sys.stdin.readline sys.stdin.readline input sin60 = math.sqrt(3) / 2 math.sqrt(3) / 2 sin60 def main():
    n = int(input())
    p1 = Position(0.0, 0.0)
    p2 = Position(100.0, 0.0)
    print(p1)
    koch(n, p1, p2)
    print(p2) def main():
    n = int(input())
    p1 = Position(0.0, 0.0)
    p2 = Position(100.0, 0.0)
    print(p1)
    koch(n, p1, p2)
    print(p2) main class Position:
    def __init__(self, x, y):
        self.x = x
        self.y = y
    def __repr__(self):
        return "{:.8f} {:.8f}".format(self.x, self.y) class Position:
    def __init__(self, x, y):
        self.x = x
        self.y = y
    def __repr__(self):
        return "{:.8f} {:.8f}".format(self.x, self.y) Position def koch(n: int, p1, p2):
    if n == 0:
        return
    s = Position((2 * p1.x + p2.x) / 3, (2 * p1.y + p2.y) / 3)
    t = Position((p1.x + 2 * p2.x) / 3, (p1.y +  2 * p2.y) / 3)
    u = Position((t.x - s.x) * cos60 - (t.y - s.y) * sin60 + s.x,
                 (t.x - s.x) * sin60 + (t.y - s.y) * cos60 + s.y)
    koch(n - 1, p1, s)
    print(s)
    koch(n-1, s, u)
    print(u)
    koch(n-1, u, t)
    print(t)
    koch(n-1, t, p2) def koch(n: int, p1, p2):
    if n == 0:
        return
    s = Position((2 * p1.x + p2.x) / 3, (2 * p1.y + p2.y) / 3)
    t = Position((p1.x + 2 * p2.x) / 3, (p1.y +  2 * p2.y) / 3)
    u = Position((t.x - s.x) * cos60 - (t.y - s.y) * sin60 + s.x,
                 (t.x - s.x) * sin60 + (t.y - s.y) * cos60 + s.y)
    koch(n - 1, p1, s)
    print(s)
    koch(n-1, s, u)
    print(u)
    koch(n-1, u, t)
    print(t)
    koch(n-1, t, p2) koch cos60 = 1/ 2 1/ 2 cos60
import sys
import math
import copy
from typing import Tuple, List, Union
input = sys.stdin.readline

sin60 = math.sqrt(3) / 2
cos60 = 1/ 2

class Position:
    def __init__(self, x, y):
        self.x = x
        self.y = y
    def __repr__(self):
        return "{:.8f} {:.8f}".format(self.x, self.y)


def koch(n: int, p1, p2):
    if n == 0:
        return
    s = Position((2 * p1.x + p2.x) / 3, (2 * p1.y + p2.y) / 3)
    t = Position((p1.x + 2 * p2.x) / 3, (p1.y +  2 * p2.y) / 3)
    u = Position((t.x - s.x) * cos60 - (t.y - s.y) * sin60 + s.x,
                 (t.x - s.x) * sin60 + (t.y - s.y) * cos60 + s.y)
    koch(n - 1, p1, s)
    print(s)
    koch(n-1, s, u)
    print(u)
    koch(n-1, u, t)
    print(t)
    koch(n-1, t, p2)



def main():
    n = int(input())
    p1 = Position(0.0, 0.0)
    p2 = Position(100.0, 0.0)
    print(p1)
    koch(n, p1, p2)
    print(p2)

if __name__ == '__main__':
    main()

