This invention provides a compound of the formula (I): ##STR00001## or
the pharmaceutically acceptable salts thereof, wherein Y.sup.1, Y.sup.2,
Y.sup.3 and Y.sup.4 are independently selected from N, CH, etc.; R.sup.1
is H, C.sub.1-8 alkyl, etc.; Q.sup.1 is a 5-12 membered monocyclic or
bicyclic aromatic ring optionally containing up to 4 heteroatoms selected
from O, N and S, etc.; A is a 5-6 membered monocyclic aromatic ring
optionally containing up to 3 heteroatoms selected from O, N and S, etc.;
B is C.sub.1-6 alkylene optionally substituted with an oxo group, etc.; W
is NH, O, etc.; R.sup.2 is H, C.sub.1-4 alkyl, etc.; Z is a 5-12 membered
monocyclic or bicyclic aromatic ring optionally containing up to 3
heteroatoms selected from O, N and S, etc.; L is halo, C.sub.1-4 alkyl,
etc.; m is 0, 1 or 2; R.sup.3 and R.sup.4 are independently selected from
H and C.sub.1-4 alkyl ; R.sup.5 is H, C.sub.1-4 alkyl, etc.; Q.sup.2 is a
5-12 membered monocyclic or bicyclic aromatic ring or tricyclic ring
optionally containing up to 3 heteroatoms selected from O, N and S, etc.
These compounds are useful for the treatment of medical conditions
mediated by prostaglamadin such as pain, fever or inflammation, etc. This
invention also provides a pharmaceutical composition comprising the above
compound.