human
Considering the provided database schema and associated query, produce SQL code to retrieve the answer to the query. 
###Database Schema: Driver, Constructor, Laps, Time/Retired, Grid
###Question: When the driver is Juan Manuel Fangio and laps is less than 39, what is the highest grid?
gpt
SELECT MAX Grid FROM table WHERE Laps < 39 AND Driver = juan manuel fangio