Optimal Deterministic Debt Contracts