fun main(args:Array) { val n = readLine()!!.toInt() val base = mutableListOf( 0, 0, 0, 1 ) for( i in (4..4_912) ) { val next = (base[i-4] + base[i-3] + base[i-2] + base[i-1])%17 base.add(next) } (1..n).map { // 4912のサイクルの周期性がある val t = (readLine()!!.toLong() % 4912).toInt() base[t-1] }.map { println(it) } }