Using Retirement for First time homebuyer

I just purchased a house in April and used some of my 401K retirement for the downpayment.

I am a first time homebuyer, and pulled out more than the $10k that would not be penalized.

1. How will I be able to write off the $10k on my taxes?

2. Would there be another instance for writing off any further expense?