NEW YORK (AP) — Authorities say a homeless man who told police he was "mad at God" is going to prison for burglarizing four New York City houses of worship.

Queens District Attorney Richard A. Brown announced on Monday that 24-year-old Joseph Woznik has been sentenced to 1½ to 4½ years after pleading guilty to burglary as a hate crime and other charges.

The break-ins occurred in March and April at a Hindu temple and three churches.

Woznik pried open donation boxes, ransacked church offices, broke windows and pawned a church's digital camera. One church was hit three times.