Social Security did not get this straighten out until 2018, so report the SSA-1099 for 2017 as it was given to you, and then for 2018, the amount on the SSA-1099 should be reduced by the repayment.
So bottom line, report the SSA-1099 for 2017 as you received it on your tax return.