Input (grade 4): King Frederick III of Denmark (1648 - 1670).
Output (grade 2): Tsar Aleksey I of Russia (1645 - 1676).