take it into one's head

Verb

 * 1) To be seized with a sudden (often ill-advised) notion.
 * After winning a modest sum on the lottery, he took it into his head to buy a boat.

Translations

 * Hungarian: fejébe vesz