function kock(n, p1, p2){
    if(n < 1) return;

    const s = {
        x: (2 * p1.x + 1 * p2.x)  / 3,
        y: (2 * p1.y + 1 * p2.y)  / 3,
    };

    const t = {
        x: (1 * p1.x + 2 * p2.x)  / 3,
        y: (1 * p1.y + 2 * p2.y)  / 3,
    };

    const u = {
        x: (t.x - s.x) * Math.cos(60 * (Math.PI / 180))  - (t.y - s.y) * Math.sin(60 * (Math.PI / 180)) + s.x,
        y: (t.x - s.x) * Math.sin(60 * (Math.PI / 180)) + (t.y - s.y) * Math.cos(60 * (Math.PI / 180)) + s.y
    };

    kock(n-1, p1, s);
    console.log(s.x, s.y);
    kock(n-1, s, u);
    console.log(u.x, u.y);
    kock(n-1, u, t);
    console.log(t.x, t.y);
    kock(n-1, t, p2);
}

function main(stdin){
    const n = stdin.split('\n').shift();
    const p1 = {x: 0, y: 0};
    const p2 = {x: 100, y: 0};

    console.log(p1.x, p1.y);
    kock(n, p1, p2);
    console.log(p2.x, p2.y);
}


main(require('fs').readFileSync('/dev/stdin', 'utf8'));

