from enum import Enum
from queue import Queue
import collections

import sys
import math

BIG_NUM = 2000000000
MOD = 1000000007
EPS = 0.000000001

def kock(n,p1x,p1y,p2x,p2y):
    if n == 0:
        return

    sx = (2 * p1x + 1 * p2x) / 3
    sy = (2 * p1y + 1 * p2y) / 3
    tx = (1 * p1x + 2 * p2x) / 3
    ty = (1 * p1y + 2 * p2y) / 3
    ux = (tx - sx)*math.cos(math.pi/3) - (ty - sy)*math.sin(math.pi/3) + sx
    uy = (tx - sx)*math.sin(math.pi/3) + (ty - sy)*math.cos(math.pi/3) + sy

    kock(n-1,p1x,p1y,sx,sy)
    print("%f %f"%(sx,sy))
    kock(n-1,sx,sy,ux,uy)
    print("%f %f"%(ux,uy))
    kock(n-1,ux,uy,tx,ty)
    print("%f %f"%(tx,ty))
    kock(n-1,tx,ty,p2x,p2y)
#    print("%f %f"%(p2x,p2y))

n = int(input())
p1x = 0; p1y = 0; p2x = 100; p2y = 0
print("%f %f"%(p1x,p1y))
kock(n,p1x,p1y,p2x,p2y)
print("%f %f"%(p2x,p2y))
 from enum import Enum from queue import Queue import collections collections import sys sys import math math BIG_NUM = 2000000000 BIG_NUM 2000000000 MOD = 1000000007 MOD 1000000007 EPS = 0.000000001 EPS 0.000000001 def kock(n,p1x,p1y,p2x,p2y):
    if n == 0:
        return

    sx = (2 * p1x + 1 * p2x) / 3
    sy = (2 * p1y + 1 * p2y) / 3
    tx = (1 * p1x + 2 * p2x) / 3
    ty = (1 * p1y + 2 * p2y) / 3
    ux = (tx - sx)*math.cos(math.pi/3) - (ty - sy)*math.sin(math.pi/3) + sx
    uy = (tx - sx)*math.sin(math.pi/3) + (ty - sy)*math.cos(math.pi/3) + sy

    kock(n-1,p1x,p1y,sx,sy)
    print("%f %f"%(sx,sy))
    kock(n-1,sx,sy,ux,uy)
    print("%f %f"%(ux,uy))
    kock(n-1,ux,uy,tx,ty)
    print("%f %f"%(tx,ty))
    kock(n-1,tx,ty,p2x,p2y)
#    print("%f %f"%(p2x,p2y)) kock if n == 0:
        return

     n == 0 n 0 return sx = (2 * p1x + 1 * p2x) / 3 sx (2 * p1x + 1 * p2x) / 3 2 * p1x + 1 * p2x 2 * p1x 2 p1x 1 * p2x 1 p2x 3 sy = (2 * p1y + 1 * p2y) / 3 sy (2 * p1y + 1 * p2y) / 3 2 * p1y + 1 * p2y 2 * p1y 2 p1y 1 * p2y 1 p2y 3 tx = (1 * p1x + 2 * p2x) / 3 tx (1 * p1x + 2 * p2x) / 3 1 * p1x + 2 * p2x 1 * p1x 1 p1x 2 * p2x 2 p2x 3 ty = (1 * p1y + 2 * p2y) / 3 ty (1 * p1y + 2 * p2y) / 3 1 * p1y + 2 * p2y 1 * p1y 1 p1y 2 * p2y 2 p2y 3 ux = (tx - sx)*math.cos(math.pi/3) - (ty - sy)*math.sin(math.pi/3) + sx ux (tx - sx)*math.cos(math.pi/3) - (ty - sy)*math.sin(math.pi/3) + sx (tx - sx)*math.cos(math.pi/3) - (ty - sy)*math.sin(math.pi/3) (tx - sx)*math.cos(math.pi/3) tx - sx tx sx math.cos(math.pi/3) math.cos math cos math.pi/3 math.pi math pi 3 (ty - sy)*math.sin(math.pi/3) ty - sy ty sy math.sin(math.pi/3) math.sin math sin math.pi/3 math.pi math pi 3 sx uy = (tx - sx)*math.sin(math.pi/3) + (ty - sy)*math.cos(math.pi/3) + sy uy (tx - sx)*math.sin(math.pi/3) + (ty - sy)*math.cos(math.pi/3) + sy (tx - sx)*math.sin(math.pi/3) + (ty - sy)*math.cos(math.pi/3) (tx - sx)*math.sin(math.pi/3) tx - sx tx sx math.sin(math.pi/3) math.sin math sin math.pi/3 math.pi math pi 3 (ty - sy)*math.cos(math.pi/3) ty - sy ty sy math.cos(math.pi/3) math.cos math cos math.pi/3 math.pi math pi 3 sy kock(n-1,p1x,p1y,sx,sy) kock n-1 n 1 p1x p1y sx sy print("%f %f"%(sx,sy)) print "%f %f"%(sx,sy) "%f %f" (sx,sy) sx sy kock(n-1,sx,sy,ux,uy) kock n-1 n 1 sx sy ux uy print("%f %f"%(ux,uy)) print "%f %f"%(ux,uy) "%f %f" (ux,uy) ux uy kock(n-1,ux,uy,tx,ty) kock n-1 n 1 ux uy tx ty print("%f %f"%(tx,ty)) print "%f %f"%(tx,ty) "%f %f" (tx,ty) tx ty kock(n-1,tx,ty,p2x,p2y) kock n-1 n 1 tx ty p2x p2y n n p1x p1x p1y p1y p2x p2x p2y p2y n = int(input()) n int(input()) int input() input p1x = 0 p1x 0 p1y = 0 p1y 0 p2x = 100 p2x 100 p2y = 0 p2y 0 print("%f %f"%(p1x,p1y)) print "%f %f"%(p1x,p1y) "%f %f" (p1x,p1y) p1x p1y kock(n,p1x,p1y,p2x,p2y) kock n p1x p1y p2x p2y print("%f %f"%(p2x,p2y)) print "%f %f"%(p2x,p2y) "%f %f" (p2x,p2y) p2x p2y MOD = 1000000007 1000000007 MOD n = int(input()) int(input()) n p2x = 100 100 p2x def kock(n,p1x,p1y,p2x,p2y):
    if n == 0:
        return

    sx = (2 * p1x + 1 * p2x) / 3
    sy = (2 * p1y + 1 * p2y) / 3
    tx = (1 * p1x + 2 * p2x) / 3
    ty = (1 * p1y + 2 * p2y) / 3
    ux = (tx - sx)*math.cos(math.pi/3) - (ty - sy)*math.sin(math.pi/3) + sx
    uy = (tx - sx)*math.sin(math.pi/3) + (ty - sy)*math.cos(math.pi/3) + sy

    kock(n-1,p1x,p1y,sx,sy)
    print("%f %f"%(sx,sy))
    kock(n-1,sx,sy,ux,uy)
    print("%f %f"%(ux,uy))
    kock(n-1,ux,uy,tx,ty)
    print("%f %f"%(tx,ty))
    kock(n-1,tx,ty,p2x,p2y)
#    print("%f %f"%(p2x,p2y)) def kock(n,p1x,p1y,p2x,p2y):
    if n == 0:
        return

    sx = (2 * p1x + 1 * p2x) / 3
    sy = (2 * p1y + 1 * p2y) / 3
    tx = (1 * p1x + 2 * p2x) / 3
    ty = (1 * p1y + 2 * p2y) / 3
    ux = (tx - sx)*math.cos(math.pi/3) - (ty - sy)*math.sin(math.pi/3) + sx
    uy = (tx - sx)*math.sin(math.pi/3) + (ty - sy)*math.cos(math.pi/3) + sy

    kock(n-1,p1x,p1y,sx,sy)
    print("%f %f"%(sx,sy))
    kock(n-1,sx,sy,ux,uy)
    print("%f %f"%(ux,uy))
    kock(n-1,ux,uy,tx,ty)
    print("%f %f"%(tx,ty))
    kock(n-1,tx,ty,p2x,p2y)
#    print("%f %f"%(p2x,p2y)) kock p2y = 0 0 p2y p1x = 0 0 p1x p1y = 0 0 p1y BIG_NUM = 2000000000 2000000000 BIG_NUM EPS = 0.000000001 0.000000001 EPS
from enum import Enum
from queue import Queue
import collections

import sys
import math

BIG_NUM = 2000000000
MOD = 1000000007
EPS = 0.000000001

def kock(n,p1x,p1y,p2x,p2y):
    if n == 0:
        return

    sx = (2 * p1x + 1 * p2x) / 3
    sy = (2 * p1y + 1 * p2y) / 3
    tx = (1 * p1x + 2 * p2x) / 3
    ty = (1 * p1y + 2 * p2y) / 3
    ux = (tx - sx)*math.cos(math.pi/3) - (ty - sy)*math.sin(math.pi/3) + sx
    uy = (tx - sx)*math.sin(math.pi/3) + (ty - sy)*math.cos(math.pi/3) + sy

    kock(n-1,p1x,p1y,sx,sy)
    print("%f %f"%(sx,sy))
    kock(n-1,sx,sy,ux,uy)
    print("%f %f"%(ux,uy))
    kock(n-1,ux,uy,tx,ty)
    print("%f %f"%(tx,ty))
    kock(n-1,tx,ty,p2x,p2y)
#    print("%f %f"%(p2x,p2y))

n = int(input())
p1x = 0; p1y = 0; p2x = 100; p2y = 0
print("%f %f"%(p1x,p1y))
kock(n,p1x,p1y,p2x,p2y)
print("%f %f"%(p2x,p2y))

