The man who assaulted Danish Prime Minister Mette Frederiksen was sentenced to four months in jail.