First of all you need to remove all the spammy links connected to your site, then alter the content of your website with unique content maintaining the keyword diversity. Then again you need to adopt SEO techniques this time with some genuine links.
For the recovery from Panda, put unique content on your page and if the existing content is of bad quality or copied, remove it. For the recovery from Penguin update, if your backlinks are spammy or low quality then disable all of them through disavow section of Google Webmaster.
Over the past two years, Google has stepped up its efforts to battle link spam, affiliate sites, and poor quality content with significant updates known collectively as Panda and Penguin..Concentrate on the quality of the content to avoid spam activities which will helps you to regain rankings..