The 2-part episode The Ship of Spies (Part 1, Part 2), written by Buck Henry and Leonard Stern, is one of my favorites. They won the Emmy award in June, 1967 for Outstanding Writing Achievement in Comedy. The plot summaries are given, with screenshots, here: Part 1 and Part 2. Terrific, clever writing. Very funny stuff!