The gang tries to help Ted when the perfect girl is finally available, and Marshall takes action when he finds a letter written by his younger self.