CF840D Destiny

Description

Once, Leha found in the left pocket an array consisting of $ n $ integers, and in the right pocket $ q $ queries of the form $ l $ $ r $ $ k $ . If there are queries, then they must be answered. Answer for the query is minimal $ x $ such that $ x $ occurs in the interval $ l $ $ r $ strictly more than ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF840D/c2e8ec3f500434412245cc8e8d90787dc635e07f.png) times or $ -1 $ if there is no such number. Help Leha with such a difficult task.

Input Format

N/A

Output Format

N/A