The present invention provides, for example, a compound mentioned below as a medicament for treating or preventing the diseases induced by production, secretion or deposition of amyloid-² proteins. A compound of the formula (I): wherein R 1 , R 2a , R 2b , R 3 , R 4 , R 5a , R 5b , R 6a , R 6b , X, Y, Z, ring A and the dashed lines are defined in the specification, its pharmaceutically acceptable salt or a solvate thereof.