{"raw_statement":[{"iden":"problem statement","content":"Given is an integer $N$. Determine whether there is a pair of positive integers $(A, B)$ such that $3^A + 5^B = N$, and find one such pair if it exists."},{"iden":"constraints","content":"*   $1 \\leq N \\leq 10^{18}$\n*   All values in input are integers."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$"},{"iden":"sample input 1","content":"106"},{"iden":"sample output 1","content":"4 2\n\nWe have $3^4 + 5^2 = 81 + 25 = 106$, so $(A, B) = (4, 2)$ satisfies the condition."},{"iden":"sample input 2","content":"1024"},{"iden":"sample output 2","content":"\\-1"},{"iden":"sample input 3","content":"10460353208"},{"iden":"sample output 3","content":"21 1"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}