P4483 [BJWC2018] Magical Clock Times

Description

One day, Xiao L saw three clocks showing $\texttt{01:08}$, $\texttt{03:40}$, and $\texttt{13:52}$. Xiao L noticed that each time is in the form $\texttt{hh:mm}$, where $\texttt{hh}$ is the hour and $\texttt{mm}$ is the minute, and none of them is on the hour (i.e., $0\leqslant\texttt{hh}

Input Format

The input contains only a single positive integer $k$.

Output Format

Output the $k$-th smallest triplet that satisfies the magical property described in the statement, with the three times separated by a space; see the sample output. If the answer does not exist, output `-1`.

Explanation/Hint

【Sample Explanation】 Note that the times may be identical. 【Constraints】 For $30\%$ of the testdata, $k\leqslant 1000$. For $60\%$ of the testdata, $k\leqslant 20000$. For $100\%$ of the testdata, $1\leqslant k\leqslant 2\times 10^9$. Translated by ChatGPT 5