// https://yukicoder.me/problems/no/2947 fun main() { val n = readln().toInt() var (s, t) = readln().split(" ") val a = readln().split(" ").map { it.toInt() } for(w in a) { for(i in 0..(w/t.length)){ if((w - i*t.length) % s.length == 0) { val j = (w - i*t.length) / s.length for(k in 0..