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

### Instruction:
Which Males Rank is the highest one that has Females (%) smaller than 40, and Females Rank smaller than 22?

### Inputs:
table_name: table, columns: ['Males Rank', 'Females Rank', 'State', 'HIV awareness (males%)', 'Females (%)']

### Response:
SELECT MAX Males Rank FROM table WHERE Females (%) < 40 AND Females Rank < 22