object Main extends App {
  val sc = new java.util.Scanner(System.in)
  var n = sc.nextInt()
  var a = 17
  for (i <- 1 to n){
    if (i == 6) {
      println(1)
    }else if(i == 11){
      println(3)
    }else if(i == a){
      println(3)
    }else if(i == a+1){
      println(3)
      a+=6
    }else{
      println(0)
    }
  }
}
