A compound having the structure of formula: or a pharmaceutically acceptable salt, or N -oxide thereof, or solvate or hydrate thereof, wherein m is 1 or 2; p is 0 or 1; X is -CH 2 - or -O-; A is (a) n is 0, 1, 2, 3, 4, or 5; wherein each R 1 is independently halogen, -C 1 -C 6 alkyl, -C 1 -C 6 haloalkyl, -C 1 -C 6 alkoxy, -C 1- C 6 haloalkoxy, C 3-8 Cak(C 0-6 alkyl), Hca(C 0-6 alkyl), Ar(C 0-6 alkyl), Het(C 0-6 alkyl), -O-(C 0 -C 6 alkyl)-Ar, -O-(C 0 -C 6 alkyl)-Het, -O-(C 0 -C 6 alkyl)-Cak, -O-(C 0 -C 6 alkyl)-Hca, -NO 2, or -CN, wherein the Ar, Het, Cak, Hca, and alkyl are optionally substituted with 1, 2, 3, or 4 groups that are each independently halogen, cyano, nitro, -OR a, -SR a, -NR a 2, -C OR a, -C NR a 2, -C R a, -S R a, -S 2 R a, -S OR a, -S 2 OR a, -S NR a 2, -S 2 NR a 2, -OC R a, -OC OR a, -OC NR a 2, -N C R a, -N C OR a, -N C NR a 2, -N S R a, -N(R a)S 2R a, C 1 -C 6 alkyl, or C 1 -C 6 haloalkyl; each R a is independently hydrogen, C 1 -C 6 alkyl, C 1 -C 6 haloalkyl, -(C 0 -C 6 alkyl)-Ar, -(C 0 -C 6 alkyl)-Het, -(C 0 -C 6 alkyl)-Cak, or -(C 0 -C 6 alkyl)-Hca, wherein Ar, Het, Cak, Hca, alkyl, and haloalkyl are optionally substituted with C 1 -C 6 alkyl, halogen, C 1 -C 6 haloalkyl or cyano; or (b) wherein the Y ring is a 5- to 9-membered Hca optionally substituted by halo or C 1 -C 6 alkyl; each R 2 is independently halogen, C 1 -C 6 alkyl, C 1 -C 6 haloalkyl, -OR c, -SR c, -NR c 2, C 3-8 Cak, -NO 2 or -CN, wherein each R c is independently hydrogen, C 1 -C 6 alkyl, or C 1 -C 6 haloalkyl; and Z is or wherein Z is optionally substituted by one or two -R Z groups that are each independently halogen, cyano, C 1-6 alkyl, C 1-6 haloalkyl, -OR, -SR, -NR 2, -C R, -C OR, -C NR 2, -S 2 NR 2, -S 2 R, -OC R, -N C R, -OC OR, -OC NR 2, -N S 2 R, -O-C 1-6 alkyl-OR, -O-C 1-6 alkyl-SR, -O-C 1-6 alkyl-NR 2, or C 3-8 Cak wherein each Cak and alkyl group is optionally substituted by one or two -R Z2 groups; wherein each -R Z2 is independently halogen, cyano, C 1-6 alkyl, C 1-6 haloalkyl, -C 1 -C 6 alkoxy, -OR b, -NR b 2, -C R b, -C OR b, -C NR b 2, -S 2 NR b 2, or -S 2 R b; each R is independently hydrogen, C 1 -C 6 alkyl, C 1 -C 6 haloalkyl, -(C 0 -C 6 alkyl)-Ar, -(C 0 -C 6 alkyl)-Het, -(C 0 -C 6 alkyl)-Cak, or -(C 0 -C 6 alkyl)-Hca, wherein Ar, Het, Cak, Hca, and alkyl are optionally substituted with C 1 -C 6 alkyl, halogen, or C 1 -C 6 haloalkyl; and each R b is independently hydrogen or C 1 -C 6 alkyl. m is 1 or 2; p is 0 or 1; X is -CH 2 - or -O-; A is (a) n is 0, 1, 2, 3, 4, or 5; wherein each R 1 is independently halogen, -C 1 -C 6 alkyl, -C 1 -C 6 haloalkyl, -C 1 -C 6 alkoxy, -C 1- C 6 haloalkoxy, C 3-8 Cak(C 0-6 alkyl), Hca(C 0-6 alkyl), Ar(C 0-6 alkyl), Het(C 0-6 alkyl), -O-(C 0 -C 6 alkyl)-Ar, -O-(C 0 -C 6 alkyl)-Het, -O-(C 0 -C 6 alkyl)-Cak, -O-(C 0 -C 6 alkyl)-Hca, -NO 2, or -CN, wherein the Ar, Het, Cak, Hca, and alkyl are optionally substituted with 1, 2, 3, or 4 groups that are each independently halogen, cyano, nitro, -OR a, -SR a, -NR a 2, -C OR a, -C NR a 2, -C R a, -S R a, -S 2 R a, -S OR a, -S 2 OR a, -S NR a 2, -S 2 NR a 2, -OC R a, -OC OR a, -OC NR a 2, -N C R a, -N C OR a, -N C NR a 2, -N S R a, -N(R a)S 2R a, C 1 -C 6 alkyl, or C 1 -C 6 haloalkyl; each R a is independently hydrogen, C 1 -C 6 alkyl, C 1 -C 6 haloalkyl, -(C 0 -C 6 alkyl)-Ar, -(C 0 -C 6 alkyl)-Het, -(C 0 -C 6 alkyl)-Cak, or -(C 0 -C 6 alkyl)-Hca, wherein Ar, Het, Cak, Hca, alkyl, and haloalkyl are optionally substituted with C 1 -C 6 alkyl, halogen, C 1 -C 6 haloalkyl or cyano; or wherein each R 1 is independently halogen, -C 1 -C 6 alkyl, -C 1 -C 6 haloalkyl, -C 1 -C 6 alkoxy, -C 1- C 6 haloalkoxy, C 3-8 Cak(C 0-6 alkyl), Hca(C 0-6 alkyl), Ar(C 0-6 alkyl), Het(C 0-6 alkyl), -O-(C 0 -C 6 alkyl)-Ar, -O-(C 0 -C 6 alkyl)-Het, -O-(C 0 -C 6 alkyl)-Cak, -O-(C 0 -C 6 alkyl)-Hca, -NO 2, or -CN, wherein the Ar, Het, Cak, Hca, and alkyl are optionally substituted with 1, 2, 3, or 4 groups that are each independently halogen, cyano, nitro, -OR a, -SR a, -NR a 2, -C OR a, -C NR a 2, -C R a, -S R a, -S 2 R a, -S OR a, -S 2 OR a, -S NR a 2, -S 2 NR a 2, -OC R a, -OC OR a, -OC NR a 2, -N C R a, -N C OR a, -N C NR a 2, -N S R a, -N(R a)S 2R a, C 1 -C 6 alkyl, or C 1 -C 6 haloalkyl; each R a is independently hydrogen, C 1 -C 6 alkyl, C 1 -C 6 haloalkyl, -(C 0 -C 6 alkyl)-Ar, -(C 0 -C 6 alkyl)-Het, -(C 0 -C 6 alkyl)-Cak, or -(C 0 -C 6 alkyl)-Hca, wherein Ar, Het, Cak, Hca, alkyl, and haloalkyl are optionally substituted with C 1 -C 6 alkyl, halogen, C 1 -C 6 haloalkyl or cyano; or (b) wherein the Y ring is a 5- to 9-membered Hca optionally substituted by halo or C 1 -C 6 alkyl; Z is optionally substituted by one or two -R Z groups that are each independently halogen, cyano, C 1-6 alkyl, C 1-6 haloalkyl, -OR, -SR, -NR 2, -C R, -C OR, -C NR 2, -S 2 NR 2, -S 2 R, -OC R, -N C R, -OC OR, -OC NR 2, -N S 2 R, -O-C 1-6 alkyl-OR, -O-C 1-6 alkyl-SR, -O-C 1-6 alkyl-NR 2, or C 3-8 Cak wherein each Cak and alkyl group is optionally substituted by one or two -R Z2 groups; wherein each -R Z2 is independently halogen, cyano, C 1-6 alkyl, C 1-6 haloalkyl, -C 1 -C 6 alkoxy, -OR b, -NR b 2, -C R b, -C OR b, -C NR b 2, -S 2 NR b 2, or -S 2 R b; each R is independently hydrogen, C 1 -C 6 alkyl, C 1 -C 6 haloalkyl, -(C 0 -C 6 alkyl)-Ar, -(C 0 -C 6 alkyl)-Het, -(C 0 -C 6 alkyl)-Cak, or -(C 0 -C 6 alkyl)-Hca, wherein Ar, Het, Cak, Hca, and alkyl are optionally substituted with C 1 -C 6 alkyl, halogen, or C 1 -C 6 haloalkyl; and each R b is independently hydrogen or C 1 -C 6 alkyl.