Bava Basra 163: The Five Sources of the Letters

And the reason Dalet and Teis are interchangeable.