#include <stdio.h>
#include <math.h>

struct typedef node{
  int x; 
  int y;
}Node;

int kock(int, int, int);

int p1, p2, d;

int main(){

  int n;

  scanf("%d", &n);

  kock(d, p1, p2);

  printf();   //???????????§??????????????????
  return 0;
}

int kock(int d, int p1, int p2){

  int s, t, u;

  if(n == 0){
    return n;
  }

  s.x = (2 * p1.x + 1 * p2.x) / 3;
  s.y = (2 * p1.y + 1 * p2.y) / 3;
  t.x = (1 * p1.x + 2 * p2.x) / 3;
  t.y = (1 * p1.y + 2 * p2.y) / 3;
  u.x = ((t.x - s.x) * (1 / 2)) - ((t.y - s.y) * (2 / sqrt(3))) + s.x;
  u.y = ((t.x - s.x) * (2 / sqrt(3)) + (t.y - s.y) * (1 / 2)) + s.y;

  kock(d-1, p1, s);
  printf("%d", s);
  kock(d-1, s, u);
  printf("%d", u);
  kock(d-1, u, t);
  printf("%d", t);
  kock(d-1, t, p2);
}