A Theory of Input Exchange Agreements