Annual Equivalent Cash Flows

I was working on my finance homework and came across this problem that I could not figure out. if anyone knows how to do this please let me know..A firm needs to decide which machine to purchase. Factory 1 costs $3,000, has a useful life of three years, and has annual maintenance costs of $800. Factory 2 costs $12,000 and has a useful life of four years, and has annual maintenance costs of $1,000. Both are worthless after their useful lives of operation. They are expected to generate the same annual cash flows. The discount rate is 10% for both factories. Based on annual equivalent cash flows, which factory should the company select?