The top is for sure a 302/5.0L. It's most likely out of a full size car or truck based on the wide stance of those accessories. The second - it might be a 351, but the photos are poor enough that it's hard to tell. To tell the two apart when you get there - they both appear identical with just a casual look - is that the 351W intake is about an inch wider. The heads also have a 302/351 cast under the rocker covers. IMHO, the 351W is a much better choice as with very little problem, only money, can go to 427cid, tho many other parts wont interchange internally.. As far as suffix letters - not much difference. There is a myth about higher nickle content in some early 351W's, but everything I've read, including an article by a retired Ford metals engineer, says that ain't so.

When you get into OEM heads for a mild build, then you can be "discerning". Neither are roller cam engines, but that's easy to fix - again only $$$$$.

Either or both are good prices for a rebuildable core at $100 each (or less)