The first line contains the number of test cases T. (1≤T≤100)
The first line of each test case contains the integers c1, c2, c3, c4, q separated by spaces. (1≤c1<c2<c3<c4≤1000, 1≤q≤100)
Each of the next q lines contains one query, made of the integers d1, d2, d3, d4, v. (1≤d1,d2,d3,d4,v≤105)