Disclosed are compounds of formulae: (I), and (II) and pharmaceutically acceptable salts thereof, wherein the variables, R, R1, R2, R3, R21, R22, R23, R34, R37, R33, R39, D, Q, Y, X, X1, X3, and X4 are defined herein. These compounds are useful for treating Gram-negative bacteria infections.