Hamilton edges out Verstappen in thrilling qualifying for sprint race