The present invention provides a compound of formula (I): wherein R 1a is optionally substituted C 1-6 alkyl, etc.; R 1m is hydrogen atom, etc.; G 1 , G 2 , G 3 and G 4 are (i), etc. ((i) G 1 is -N(R 1b )-, G 2 is -CO-, G 3 is -C(R 1c )(R 1d )-, and G 4 is oxygen, etc.); R 1b is optionally substituted C 1-6 alkyl, etc.; R 1c and R 1d are each independently optionally substituted C 1-6 alkyl, etc.; R 2 is optionally substituted C 1-6 alkyl, etc.; R 3a , R 3b , R 3c , and R 3d are each independently a group: -A-B (A is a single bond, etc., B is hydrogen atom, etc.), etc.; n is 1, etc.; R 5 is C 1-4 alkoxycarbonyl, etc., or a pharmaceutically acceptable salt thereof, which is useful as a renin inhibitor.