A compound represented by formula (1) (in the formula: ring-D represents a three- to eight-membered hydrocarbon ring; Ra represents an optionally substituted amino C1-6 alkyl group or the like; Rb1 and Rb2 each independently represent a hydrogen atom, a halogen atom, or the like; Rc represents an optionally substituted C6-10 aryl group or the like; Rd 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.本發明係關於如下式(1)所示化合物或其藥學上可被許可的鹽,其具有優良FXIa阻礙活性,可作為血栓症等治療藥使用。〔式中,環D表示3員~8員的烴環;Ra表示可被取代之胺基C1-6烷基等;Rb1及Rb2各獨立表示氫原子、鹵素原子等;Rc表示可被取代之C6-10芳基等;Rd表示氫原子等;環Q表示可被羧基等取代之(雜)芳基等〕。