gets *r=0,0,0,a=1 4.upto(5e3){|i|a=a-r[i-4]+r[i]=a%17};$<.map{|n|p r[~-n.to_i%4912]}