import math, cmath
 
def koch(p1, p2, n):
    if n == 0:
        return [p1, p2]
     
    rad60 = math.pi/3
    v1 = (p2 - p1)/3
    v2 = cmath.rect(abs(v1), cmath.phase(v1)+rad60)
    q1 = p1 + v1
    q2 = q1 + v2
    q3 = q1 + v1
    if n == 1:
        return [p1,q1,q2,q3,p2]
    else:
        x1 = koch(p1,q1,n-1)[:-1]
        x2 = koch(q1,q2,n-1)[:-1]
        x3 = koch(q2,q3,n-1)[:-1]
        x4 = koch(q3,p2,n-1)
        x = x1 + x2 + x3 + x4
    return x
 
n = int(raw_input())
p1 = complex(0,0)
p2 = complex(100,0)
 
for e in koch(p1,p2,n):
    print e.real,e.imag import math, cmath math cmath def koch(p1, p2, n):
    if n == 0:
        return [p1, p2]
     
    rad60 = math.pi/3
    v1 = (p2 - p1)/3
    v2 = cmath.rect(abs(v1), cmath.phase(v1)+rad60)
    q1 = p1 + v1
    q2 = q1 + v2
    q3 = q1 + v1
    if n == 1:
        return [p1,q1,q2,q3,p2]
    else:
        x1 = koch(p1,q1,n-1)[:-1]
        x2 = koch(q1,q2,n-1)[:-1]
        x3 = koch(q2,q3,n-1)[:-1]
        x4 = koch(q3,p2,n-1)
        x = x1 + x2 + x3 + x4
    return x
  koch if n == 0:
        return [p1, p2]
     
     n == 0 n 0 return [p1, p2] [p1, p2] p1 p2 rad60 = math.pi/3 rad60 math.pi/3 math.pi math pi 3 v1 = (p2 - p1)/3 v1 (p2 - p1)/3 p2 - p1 p2 p1 3 v2 = cmath.rect(abs(v1), cmath.phase(v1)+rad60) v2 cmath.rect(abs(v1), cmath.phase(v1)+rad60) cmath.rect cmath rect abs(v1) abs v1 cmath.phase(v1)+rad60 cmath.phase(v1) cmath.phase cmath phase v1 rad60 q1 = p1 + v1 q1 p1 + v1 p1 v1 q2 = q1 + v2 q2 q1 + v2 q1 v2 q3 = q1 + v1 q3 q1 + v1 q1 v1 if n == 1:
        return [p1,q1,q2,q3,p2]
    else:
        x1 = koch(p1,q1,n-1)[:-1]
        x2 = koch(q1,q2,n-1)[:-1]
        x3 = koch(q2,q3,n-1)[:-1]
        x4 = koch(q3,p2,n-1)
        x = x1 + x2 + x3 + x4
     n == 1 n 1 return [p1,q1,q2,q3,p2] [p1,q1,q2,q3,p2] p1 q1 q2 q3 p2 x1 = koch(p1,q1,n-1)[:-1] x1 koch(p1,q1,n-1)[:-1] (p1,q1,n-1) koch p1 q1 n-1 n 1 :-1 -1 x2 = koch(q1,q2,n-1)[:-1] x2 koch(q1,q2,n-1)[:-1] (q1,q2,n-1) koch q1 q2 n-1 n 1 :-1 -1 x3 = koch(q2,q3,n-1)[:-1] x3 koch(q2,q3,n-1)[:-1] (q2,q3,n-1) koch q2 q3 n-1 n 1 :-1 -1 x4 = koch(q3,p2,n-1) x4 koch(q3,p2,n-1) koch q3 p2 n-1 n 1 x = x1 + x2 + x3 + x4 x x1 + x2 + x3 + x4 x1 + x2 + x3 x1 + x2 x1 x2 x3 x4 return x x p1 p1 p2 p2 n n n = int(raw_input()) n int(raw_input()) int raw_input() raw_input p1 = complex(0,0) p1 complex(0,0) complex 0 0 p2 = complex(100,0) p2 complex(100,0) complex 100 0 for e in koch(p1,p2,n):
    print e.real,e.imag e koch(p1,p2,n) koch p1 p2 n print e.real e real e.imag e imag p2 = complex(100,0) complex(100,0) p2 p1 = complex(0,0) complex(0,0) p1 def koch(p1, p2, n):
    if n == 0:
        return [p1, p2]
     
    rad60 = math.pi/3
    v1 = (p2 - p1)/3
    v2 = cmath.rect(abs(v1), cmath.phase(v1)+rad60)
    q1 = p1 + v1
    q2 = q1 + v2
    q3 = q1 + v1
    if n == 1:
        return [p1,q1,q2,q3,p2]
    else:
        x1 = koch(p1,q1,n-1)[:-1]
        x2 = koch(q1,q2,n-1)[:-1]
        x3 = koch(q2,q3,n-1)[:-1]
        x4 = koch(q3,p2,n-1)
        x = x1 + x2 + x3 + x4
    return x
  def koch(p1, p2, n):
    if n == 0:
        return [p1, p2]
     
    rad60 = math.pi/3
    v1 = (p2 - p1)/3
    v2 = cmath.rect(abs(v1), cmath.phase(v1)+rad60)
    q1 = p1 + v1
    q2 = q1 + v2
    q3 = q1 + v1
    if n == 1:
        return [p1,q1,q2,q3,p2]
    else:
        x1 = koch(p1,q1,n-1)[:-1]
        x2 = koch(q1,q2,n-1)[:-1]
        x3 = koch(q2,q3,n-1)[:-1]
        x4 = koch(q3,p2,n-1)
        x = x1 + x2 + x3 + x4
    return x
  koch n = int(raw_input()) int(raw_input()) n
import math, cmath
 
def koch(p1, p2, n):
    if n == 0:
        return [p1, p2]
     
    rad60 = math.pi/3
    v1 = (p2 - p1)/3
    v2 = cmath.rect(abs(v1), cmath.phase(v1)+rad60)
    q1 = p1 + v1
    q2 = q1 + v2
    q3 = q1 + v1
    if n == 1:
        return [p1,q1,q2,q3,p2]
    else:
        x1 = koch(p1,q1,n-1)[:-1]
        x2 = koch(q1,q2,n-1)[:-1]
        x3 = koch(q2,q3,n-1)[:-1]
        x4 = koch(q3,p2,n-1)
        x = x1 + x2 + x3 + x4
    return x
 
n = int(raw_input())
p1 = complex(0,0)
p2 = complex(100,0)
 
for e in koch(p1,p2,n):
    print e.real,e.imag