import sys
from math import sin, cos, radians
input = sys.stdin.readline
deg = radians(60)

def Koch(n, p1_x, p1_y, p2_x, p2_y):
    if n != 0:
        s_x = (2 * p1_x + p2_x) / 3
        s_y = (2 * p1_y + p2_y) / 3
        t_x = (p1_x + 2 * p2_x) / 3
        t_y = (p1_y + 2 * p2_y) / 3
        u_x = (t_x - s_x) * cos(deg) - (t_y - s_y) * sin(deg) + s_x
        u_y = (t_x - s_x) * sin(deg) + (t_y - s_y) * cos(deg) + s_y
        Koch(n - 1, p1_x, p1_y, s_x, s_y)
        print('{:.8f} {:.8f}'.format(s_x, s_y))
        Koch(n - 1, s_x, s_y, u_x, u_y)
        print('{:.8f} {:.8f}'.format(u_x, u_y))
        Koch(n - 1, u_x, u_y, t_x, t_y)
        print('{:.8f} {:.8f}'.format(t_x, t_y))
        Koch(n - 1, t_x, t_y, p2_x, p2_y)
    else:
        return

n = int(input())
p1_x, p1_y = 0, 0
p2_x, p2_y = 100, 0
print('{:.8f} {:.8f}'.format(p1_x, p1_y))
Koch(n, p1_x, p1_y, p2_x, p2_y)
print('{:.8f} {:.8f}'.format(p2_x, p2_y))
 import sys sys from math import sin, cos, radians input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline deg = radians(60) deg radians(60) radians 60 def Koch(n, p1_x, p1_y, p2_x, p2_y):
    if n != 0:
        s_x = (2 * p1_x + p2_x) / 3
        s_y = (2 * p1_y + p2_y) / 3
        t_x = (p1_x + 2 * p2_x) / 3
        t_y = (p1_y + 2 * p2_y) / 3
        u_x = (t_x - s_x) * cos(deg) - (t_y - s_y) * sin(deg) + s_x
        u_y = (t_x - s_x) * sin(deg) + (t_y - s_y) * cos(deg) + s_y
        Koch(n - 1, p1_x, p1_y, s_x, s_y)
        print('{:.8f} {:.8f}'.format(s_x, s_y))
        Koch(n - 1, s_x, s_y, u_x, u_y)
        print('{:.8f} {:.8f}'.format(u_x, u_y))
        Koch(n - 1, u_x, u_y, t_x, t_y)
        print('{:.8f} {:.8f}'.format(t_x, t_y))
        Koch(n - 1, t_x, t_y, p2_x, p2_y)
    else:
        return Koch if n != 0:
        s_x = (2 * p1_x + p2_x) / 3
        s_y = (2 * p1_y + p2_y) / 3
        t_x = (p1_x + 2 * p2_x) / 3
        t_y = (p1_y + 2 * p2_y) / 3
        u_x = (t_x - s_x) * cos(deg) - (t_y - s_y) * sin(deg) + s_x
        u_y = (t_x - s_x) * sin(deg) + (t_y - s_y) * cos(deg) + s_y
        Koch(n - 1, p1_x, p1_y, s_x, s_y)
        print('{:.8f} {:.8f}'.format(s_x, s_y))
        Koch(n - 1, s_x, s_y, u_x, u_y)
        print('{:.8f} {:.8f}'.format(u_x, u_y))
        Koch(n - 1, u_x, u_y, t_x, t_y)
        print('{:.8f} {:.8f}'.format(t_x, t_y))
        Koch(n - 1, t_x, t_y, p2_x, p2_y)
    else:
        return n != 0 n 0 s_x = (2 * p1_x + p2_x) / 3 s_x (2 * p1_x + p2_x) / 3 2 * p1_x + p2_x 2 * p1_x 2 p1_x p2_x 3 s_y = (2 * p1_y + p2_y) / 3 s_y (2 * p1_y + p2_y) / 3 2 * p1_y + p2_y 2 * p1_y 2 p1_y p2_y 3 t_x = (p1_x + 2 * p2_x) / 3 t_x (p1_x + 2 * p2_x) / 3 p1_x + 2 * p2_x p1_x 2 * p2_x 2 p2_x 3 t_y = (p1_y + 2 * p2_y) / 3 t_y (p1_y + 2 * p2_y) / 3 p1_y + 2 * p2_y p1_y 2 * p2_y 2 p2_y 3 u_x = (t_x - s_x) * cos(deg) - (t_y - s_y) * sin(deg) + s_x u_x (t_x - s_x) * cos(deg) - (t_y - s_y) * sin(deg) + s_x (t_x - s_x) * cos(deg) - (t_y - s_y) * sin(deg) (t_x - s_x) * cos(deg) t_x - s_x t_x s_x cos(deg) cos deg (t_y - s_y) * sin(deg) t_y - s_y t_y s_y sin(deg) sin deg s_x u_y = (t_x - s_x) * sin(deg) + (t_y - s_y) * cos(deg) + s_y u_y (t_x - s_x) * sin(deg) + (t_y - s_y) * cos(deg) + s_y (t_x - s_x) * sin(deg) + (t_y - s_y) * cos(deg) (t_x - s_x) * sin(deg) t_x - s_x t_x s_x sin(deg) sin deg (t_y - s_y) * cos(deg) t_y - s_y t_y s_y cos(deg) cos deg s_y Koch(n - 1, p1_x, p1_y, s_x, s_y) Koch n - 1 n 1 p1_x p1_y s_x s_y print('{:.8f} {:.8f}'.format(s_x, s_y)) print '{:.8f} {:.8f}'.format(s_x, s_y) '{:.8f} {:.8f}'.format '{:.8f} {:.8f}' format s_x s_y Koch(n - 1, s_x, s_y, u_x, u_y) Koch n - 1 n 1 s_x s_y u_x u_y print('{:.8f} {:.8f}'.format(u_x, u_y)) print '{:.8f} {:.8f}'.format(u_x, u_y) '{:.8f} {:.8f}'.format '{:.8f} {:.8f}' format u_x u_y Koch(n - 1, u_x, u_y, t_x, t_y) Koch n - 1 n 1 u_x u_y t_x t_y print('{:.8f} {:.8f}'.format(t_x, t_y)) print '{:.8f} {:.8f}'.format(t_x, t_y) '{:.8f} {:.8f}'.format '{:.8f} {:.8f}' format t_x t_y Koch(n - 1, t_x, t_y, p2_x, p2_y) Koch n - 1 n 1 t_x t_y p2_x p2_y return n n p1_x p1_x p1_y p1_y p2_x p2_x p2_y p2_y n = int(input()) n int(input()) int input() input p1_x, p1_y = 0, 0 p1_x 0 p1_y 0 p2_x, p2_y = 100, 0 p2_x 100 p2_y 0 print('{:.8f} {:.8f}'.format(p1_x, p1_y)) print '{:.8f} {:.8f}'.format(p1_x, p1_y) '{:.8f} {:.8f}'.format '{:.8f} {:.8f}' format p1_x p1_y Koch(n, p1_x, p1_y, p2_x, p2_y) Koch n p1_x p1_y p2_x p2_y print('{:.8f} {:.8f}'.format(p2_x, p2_y)) print '{:.8f} {:.8f}'.format(p2_x, p2_y) '{:.8f} {:.8f}'.format '{:.8f} {:.8f}' format p2_x p2_y def Koch(n, p1_x, p1_y, p2_x, p2_y):
    if n != 0:
        s_x = (2 * p1_x + p2_x) / 3
        s_y = (2 * p1_y + p2_y) / 3
        t_x = (p1_x + 2 * p2_x) / 3
        t_y = (p1_y + 2 * p2_y) / 3
        u_x = (t_x - s_x) * cos(deg) - (t_y - s_y) * sin(deg) + s_x
        u_y = (t_x - s_x) * sin(deg) + (t_y - s_y) * cos(deg) + s_y
        Koch(n - 1, p1_x, p1_y, s_x, s_y)
        print('{:.8f} {:.8f}'.format(s_x, s_y))
        Koch(n - 1, s_x, s_y, u_x, u_y)
        print('{:.8f} {:.8f}'.format(u_x, u_y))
        Koch(n - 1, u_x, u_y, t_x, t_y)
        print('{:.8f} {:.8f}'.format(t_x, t_y))
        Koch(n - 1, t_x, t_y, p2_x, p2_y)
    else:
        return def Koch(n, p1_x, p1_y, p2_x, p2_y):
    if n != 0:
        s_x = (2 * p1_x + p2_x) / 3
        s_y = (2 * p1_y + p2_y) / 3
        t_x = (p1_x + 2 * p2_x) / 3
        t_y = (p1_y + 2 * p2_y) / 3
        u_x = (t_x - s_x) * cos(deg) - (t_y - s_y) * sin(deg) + s_x
        u_y = (t_x - s_x) * sin(deg) + (t_y - s_y) * cos(deg) + s_y
        Koch(n - 1, p1_x, p1_y, s_x, s_y)
        print('{:.8f} {:.8f}'.format(s_x, s_y))
        Koch(n - 1, s_x, s_y, u_x, u_y)
        print('{:.8f} {:.8f}'.format(u_x, u_y))
        Koch(n - 1, u_x, u_y, t_x, t_y)
        print('{:.8f} {:.8f}'.format(t_x, t_y))
        Koch(n - 1, t_x, t_y, p2_x, p2_y)
    else:
        return Koch p2_y = 100, 0 0 p2_y input = sys.stdin.readline sys.stdin.readline input p2_x, p2_y = 100, 0 100 p2_x deg = radians(60) radians(60) deg p1_x, p1_y = 0, 0 0 p1_x p1_y = 0, 0 0 p1_y n = int(input()) int(input()) n
import sys
from math import sin, cos, radians
input = sys.stdin.readline
deg = radians(60)

def Koch(n, p1_x, p1_y, p2_x, p2_y):
    if n != 0:
        s_x = (2 * p1_x + p2_x) / 3
        s_y = (2 * p1_y + p2_y) / 3
        t_x = (p1_x + 2 * p2_x) / 3
        t_y = (p1_y + 2 * p2_y) / 3
        u_x = (t_x - s_x) * cos(deg) - (t_y - s_y) * sin(deg) + s_x
        u_y = (t_x - s_x) * sin(deg) + (t_y - s_y) * cos(deg) + s_y
        Koch(n - 1, p1_x, p1_y, s_x, s_y)
        print('{:.8f} {:.8f}'.format(s_x, s_y))
        Koch(n - 1, s_x, s_y, u_x, u_y)
        print('{:.8f} {:.8f}'.format(u_x, u_y))
        Koch(n - 1, u_x, u_y, t_x, t_y)
        print('{:.8f} {:.8f}'.format(t_x, t_y))
        Koch(n - 1, t_x, t_y, p2_x, p2_y)
    else:
        return

n = int(input())
p1_x, p1_y = 0, 0
p2_x, p2_y = 100, 0
print('{:.8f} {:.8f}'.format(p1_x, p1_y))
Koch(n, p1_x, p1_y, p2_x, p2_y)
print('{:.8f} {:.8f}'.format(p2_x, p2_y))

