A compound represented by formula (1) (in the formula: ring-D represents a three- to eight-membered hydrocarbon ring; R a represents an optionally substituted amino C 1-6 alkyl group or the like; R b1 and R b2 each independently represent a hydrogen atom, a halogen atom, or the like; R c represents an optionally substituted C 6-10 aryl group or the like; R d represents a hydrogen atom or the like; and ring-Q represents a (hetero)aryl group or the like which may be substituted with a carboxyl group or the like) or a pharmaceutically acceptable salt thereof exhibits an excellent FXIa inhibitory activity, and is useful as a therapeutic agent against thrombosis or the like.