Given the task definition and input, reply with output. In this task, you are given a question. You have to answer the question based on your information.

How did James III of Scotland acquire the town of Kirkwall?
marriage to Margaret of Denmark