q=gets.to_i q.times do s, t, u, v=gets.split.map(&:to_i) puts "SELECT count(*) FROM point WHERE #{s}<=x AND x<=#{u} AND #{t}<=y AND y<=#{v};" STDOUT.flush end