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

### Instruction:
what is the average foreign imports s tone when the total s tone is 3,157,247 and the foreign exports s ton is less than 358,493?

### Inputs:
table_name: table, columns: ['Year', 'U.S. Rank', 'Total s Ton', 'Domestic s Ton', 'Foreign Total s Ton', 'Foreign Imports s Ton', 'Foreign Exports s Ton']

### Response:
SELECT AVG Foreign Imports s Ton FROM table WHERE Total s Ton = 3,157,247 AND Foreign Exports s Ton < 358,493