Below is an instruction that describes a task. Write a response that appropriately completes the request.

### Instruction:
WHAT IS THE LOWEST AVERAGE FINISH FOR 40TH POSITION, WITH A TOP 5 LARGER THAN 0?

### Inputs:
table_name: table, columns: ['Year', 'Starts', 'Wins', 'Top 5', 'Top 10', 'Poles', 'Avg. Start', 'Avg. Finish', 'Position']

### Response:
SELECT MIN Avg. Finish FROM table WHERE Position = 40th AND Top 5 > 0