import math
import string
import itertools
import fractions
import heapq
import collections
import re
import array
import bisect
import sys
import random
import time
inf = 10**9


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


def kock(n, p1, p2):
    if n == 0:
        return

    s = Coordinate((2 * p1.x + p2.x) / 3, (2 * p1.y + p2.y) / 3)
    t = Coordinate((p1.x + 2 * p2.x) / 3, (p1.y + 2 * p2.y) / 3)
    u = Coordinate(
        (t.x - s.x) * math.cos(math.pi / 3) -
        (t.y - s.y) * math.sin(math.pi / 3) + s.x,
        (t.x - s.x) * math.sin(math.pi / 3) +
        (t.y - s.y) * math.cos(math.pi / 3) + s.y
    )

    kock(n - 1, p1, s)
    print(s.x, s.y)
    kock(n - 1, s, u)
    print(u.x, u.y)
    kock(n - 1, u, t)
    print(t.x, t.y)
    kock(n - 1, t, p2)


def main():
    n = int(input())

    p1 = Coordinate(0, 0)
    p2 = Coordinate(100, 0)

    print(p1.x, p1.y)
    kock(n, p1, p2)
    print(p2.x, p2.y)


if __name__ == '__main__':
    main()
 import math math import string string import itertools itertools import fractions fractions import heapq heapq import collections collections import re re import array array import bisect bisect import sys sys import random random import time time inf = 10**9 inf 10**9 10 9 class Coordinate:
    def __init__(self, x, y):
        self.x = x
        self.y = y Coordinate 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 kock(n, p1, p2):
    if n == 0:
        return

    s = Coordinate((2 * p1.x + p2.x) / 3, (2 * p1.y + p2.y) / 3)
    t = Coordinate((p1.x + 2 * p2.x) / 3, (p1.y + 2 * p2.y) / 3)
    u = Coordinate(
        (t.x - s.x) * math.cos(math.pi / 3) -
        (t.y - s.y) * math.sin(math.pi / 3) + s.x,
        (t.x - s.x) * math.sin(math.pi / 3) +
        (t.y - s.y) * math.cos(math.pi / 3) + s.y
    )

    kock(n - 1, p1, s)
    print(s.x, s.y)
    kock(n - 1, s, u)
    print(u.x, u.y)
    kock(n - 1, u, t)
    print(t.x, t.y)
    kock(n - 1, t, p2) kock if n == 0:
        return

     n == 0 n 0 return s = Coordinate((2 * p1.x + p2.x) / 3, (2 * p1.y + p2.y) / 3) s Coordinate((2 * p1.x + p2.x) / 3, (2 * p1.y + p2.y) / 3) Coordinate (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 = Coordinate((p1.x + 2 * p2.x) / 3, (p1.y + 2 * p2.y) / 3) t Coordinate((p1.x + 2 * p2.x) / 3, (p1.y + 2 * p2.y) / 3) Coordinate (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 = Coordinate(
        (t.x - s.x) * math.cos(math.pi / 3) -
        (t.y - s.y) * math.sin(math.pi / 3) + s.x,
        (t.x - s.x) * math.sin(math.pi / 3) +
        (t.y - s.y) * math.cos(math.pi / 3) + s.y
    ) u Coordinate(
        (t.x - s.x) * math.cos(math.pi / 3) -
        (t.y - s.y) * math.sin(math.pi / 3) + s.x,
        (t.x - s.x) * math.sin(math.pi / 3) +
        (t.y - s.y) * math.cos(math.pi / 3) + s.y
    ) Coordinate (t.x - s.x) * math.cos(math.pi / 3) -
        (t.y - s.y) * math.sin(math.pi / 3) + s.x (t.x - s.x) * math.cos(math.pi / 3) -
        (t.y - s.y) * math.sin(math.pi / 3) (t.x - s.x) * math.cos(math.pi / 3) t.x - s.x t.x t x s.x s x math.cos(math.pi / 3) math.cos math cos math.pi / 3 math.pi math pi 3 (t.y - s.y) * math.sin(math.pi / 3) t.y - s.y t.y t y s.y s y math.sin(math.pi / 3) math.sin math sin math.pi / 3 math.pi math pi 3 s.x s x (t.x - s.x) * math.sin(math.pi / 3) +
        (t.y - s.y) * math.cos(math.pi / 3) + s.y (t.x - s.x) * math.sin(math.pi / 3) +
        (t.y - s.y) * math.cos(math.pi / 3) (t.x - s.x) * math.sin(math.pi / 3) t.x - s.x t.x t x s.x s x math.sin(math.pi / 3) math.sin math sin math.pi / 3 math.pi math pi 3 (t.y - s.y) * math.cos(math.pi / 3) t.y - s.y t.y t y s.y s y math.cos(math.pi / 3) math.cos math cos math.pi / 3 math.pi math pi 3 s.y s y kock(n - 1, p1, s) kock n - 1 n 1 p1 s print(s.x, s.y) print s.x s x s.y s y kock(n - 1, s, u) kock n - 1 n 1 s u print(u.x, u.y) print u.x u x u.y u y kock(n - 1, u, t) kock n - 1 n 1 u t print(t.x, t.y) print t.x t x t.y t y kock(n - 1, t, p2) kock n - 1 n 1 t p2 n n p1 p1 p2 p2 def main():
    n = int(input())

    p1 = Coordinate(0, 0)
    p2 = Coordinate(100, 0)

    print(p1.x, p1.y)
    kock(n, p1, p2)
    print(p2.x, p2.y) main n = int(input()) n int(input()) int input() input p1 = Coordinate(0, 0) p1 Coordinate(0, 0) Coordinate 0 0 p2 = Coordinate(100, 0) p2 Coordinate(100, 0) Coordinate 100 0 print(p1.x, p1.y) print p1.x p1 x p1.y p1 y kock(n, p1, p2) kock n p1 p2 print(p2.x, p2.y) print p2.x p2 x p2.y p2 y if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main inf = 10**9 10**9 inf def main():
    n = int(input())

    p1 = Coordinate(0, 0)
    p2 = Coordinate(100, 0)

    print(p1.x, p1.y)
    kock(n, p1, p2)
    print(p2.x, p2.y) def main():
    n = int(input())

    p1 = Coordinate(0, 0)
    p2 = Coordinate(100, 0)

    print(p1.x, p1.y)
    kock(n, p1, p2)
    print(p2.x, p2.y) main class Coordinate:
    def __init__(self, x, y):
        self.x = x
        self.y = y class Coordinate:
    def __init__(self, x, y):
        self.x = x
        self.y = y Coordinate def kock(n, p1, p2):
    if n == 0:
        return

    s = Coordinate((2 * p1.x + p2.x) / 3, (2 * p1.y + p2.y) / 3)
    t = Coordinate((p1.x + 2 * p2.x) / 3, (p1.y + 2 * p2.y) / 3)
    u = Coordinate(
        (t.x - s.x) * math.cos(math.pi / 3) -
        (t.y - s.y) * math.sin(math.pi / 3) + s.x,
        (t.x - s.x) * math.sin(math.pi / 3) +
        (t.y - s.y) * math.cos(math.pi / 3) + s.y
    )

    kock(n - 1, p1, s)
    print(s.x, s.y)
    kock(n - 1, s, u)
    print(u.x, u.y)
    kock(n - 1, u, t)
    print(t.x, t.y)
    kock(n - 1, t, p2) def kock(n, p1, p2):
    if n == 0:
        return

    s = Coordinate((2 * p1.x + p2.x) / 3, (2 * p1.y + p2.y) / 3)
    t = Coordinate((p1.x + 2 * p2.x) / 3, (p1.y + 2 * p2.y) / 3)
    u = Coordinate(
        (t.x - s.x) * math.cos(math.pi / 3) -
        (t.y - s.y) * math.sin(math.pi / 3) + s.x,
        (t.x - s.x) * math.sin(math.pi / 3) +
        (t.y - s.y) * math.cos(math.pi / 3) + s.y
    )

    kock(n - 1, p1, s)
    print(s.x, s.y)
    kock(n - 1, s, u)
    print(u.x, u.y)
    kock(n - 1, u, t)
    print(t.x, t.y)
    kock(n - 1, t, p2) kock
import math
import string
import itertools
import fractions
import heapq
import collections
import re
import array
import bisect
import sys
import random
import time
inf = 10**9


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


def kock(n, p1, p2):
    if n == 0:
        return

    s = Coordinate((2 * p1.x + p2.x) / 3, (2 * p1.y + p2.y) / 3)
    t = Coordinate((p1.x + 2 * p2.x) / 3, (p1.y + 2 * p2.y) / 3)
    u = Coordinate(
        (t.x - s.x) * math.cos(math.pi / 3) -
        (t.y - s.y) * math.sin(math.pi / 3) + s.x,
        (t.x - s.x) * math.sin(math.pi / 3) +
        (t.y - s.y) * math.cos(math.pi / 3) + s.y
    )

    kock(n - 1, p1, s)
    print(s.x, s.y)
    kock(n - 1, s, u)
    print(u.x, u.y)
    kock(n - 1, u, t)
    print(t.x, t.y)
    kock(n - 1, t, p2)


def main():
    n = int(input())

    p1 = Coordinate(0, 0)
    p2 = Coordinate(100, 0)

    print(p1.x, p1.y)
    kock(n, p1, p2)
    print(p2.x, p2.y)


if __name__ == '__main__':
    main()

