We study the optimal determination the structure of debt as a function of the stochastic process of output in an economy in which credit markets and decision makers are risk neutral and have the same discount rate. We consider debt that can vary in three dimensions: its face value, its coupon rate, and expected maturity. We find that the optimal maturity of the debt balances the risk of default due to low output with the risk of strategic default. In a quantitative version of the model we find that, holding technology characteristics constant, when potential output is low (and, hence, the probability of strategic default is high) firms choose to issue short term debt. More generally, we find a positive relationship between potential output and maturity. We also show that firms operating in more uncertain environments choose to issue shorter debt, while firms whose assets have higher resale value (e.g. face lower costs of fire sales) issue longer maturity debt.