human
Considering the provided database schema and associated query, produce SQL code to retrieve the answer to the query. 
###Database Schema: Rank, Nation, Gold, Silver, Bronze, Total
###Question: What is the average gold medals for countries with more than 0 bronze, more than 0 silver, rank over 2 and total over 3?
gpt
SELECT AVG Gold FROM table WHERE Bronze > 0 AND Silver > 0 AND Rank > 2 AND Total > 3