I can help for you deciding how to fill the form.
First, I am presuming that you have nothing on line 5.
That being so, then the amount excluded from income is applied on lines 6 through 13, in that order.
So, go down starting at line six and put the amount in for each line until the total you have put on the lines is the amount excluded (you said it was 6167 in your case).
What the line 10 instructions are saying is that you will not count as your cost (basis) amounts that you owe (liabilities) after the discharge of debt.
That is, if you were still insolvent after this particular debt was discharged then 10a is zero.
Since you said that before the discharge of 6167 you were at (39475) then you will have zero on 10a since you have zero when you take cost basis minus liabilities after the discharge.
When there is debt discharge the amount of income excluded reduces your cost basis (and so later increases gain on sale) or reduces other tax attributes.
If my liability is more than my cost than there is no cost basis to reduce and that particular line is zero.
Please ask if you need more discussion or clarification.