Instruct: When was the incumbent first elected in the district where the result was a democratic-republican gain? 
Output: SELECT First elected FROM table WHERE Result = Democratic-Republican gain