n = gets.chomp.to_i a = [] n.times do a << gets.chomp.to_i end b=[nil,0,0,0,1,1,2,4,8,15] if a.max > 9 (a.max-9).times do |i| c = 0 c = a[9+i]*2 - a[5+i] b << c end end a.each do |i| p b[i] % 17 end