There is provided a compound having an excellent controlling effect on pests represented by the formula (1):wherein, A1 represents —NR7—, etc., A2 represents a nitrogen atom, etc., A3 represents a nitrogen atom, etc., R1 represents a C1-C6 chain hydrocarbon group optionally substituted by one or more atoms or groups selected from Group X, etc., R2, R3 and R4 are the same or different and each represents a C1-C6 chain hydrocarbon group optionally substituted by one or more halogen atoms, etc., R5 and R6 are the same or different and each represents a C1-C6 chain hydrocarbon group optionally substituted by one or more atoms or groups selected from Group X, etc., R7 represents a C1-C6 chain hydrocarbon group optionally substituted by one or more atoms or groups selected from Group W, etc., n represents 0, 1 or 2, or an N-oxide thereof.