let N = Int(readLine()!)!
let TA: [Int] = readLine()!.split(separator: " ").map { Int($0)! }
let diffA: [Int] = readLine()!.split(separator: " ").map { abs(TA[0]*1000 - Int($0)!*6 - TA[1]*1000) }
print(diffA.firstIndex(of: diffA.min()!)! + 1)