In stark farewell, Obama warns of threat to U. S. democracy