Input (grade 9): Tehran finally became the capital of Iran in 1795, when the Qajar king Agha Mohammad Khan was crowned in the city.
Output (grade 8): Finally, Tehran became the capital of Iran, in 1795, when Agha Mohammad Khan, became Iran King.