Lazy Student

아직 제출이 없습니다시간 제한1초메모리 제한256 MB

문제

The Algorithms course exam is coming soon and there will be kk days when you can attempt to pass it. You can come on any subset of the days until you finally pass the exam. A young lazy student Raccoon definitely wants to pass the exam, but at the same time he wants to learn the smallest possible number of topics. It means that if there is only one exam day left, Raccoon will learn all the topics. On the other hand, if there are 1010 attempts, he may hope that it is enough to learn just a third of all the topics.

Let's describe the process in more detail. Let all the topics be a segment \[0,1]\[0,1]. Raccoon learns the first xx topics (which is a real number from 00 to 11). When Raccoon comes to an exam-day, he will pass with probability xx. Raccoon may learn any amount of topics before exams or in-between until he passes the exam. He never forgets what he already has learned. For example, Raccoon may learn 13\frac{1}{3} before the first exam day and up-learn 16\frac{1}{6} after a failure which will make a total of 12\frac{1}{2} learned topics. If Raccoon fails on all the days before the last one, he will make sure that he will know all the topics before the last attempt (he definitely wants to pass the exam, remember?).

Raccoon is lazy and doesn't want to learn a lot of topics. He is going to choose a strategy that will provide him with the least expected amount of topics that he needs to learn. What is this expected amount?

입력

The input contains a single integer kk: the number of attempts to pass the exam (1k10181 \le k \le 10^{18}).

출력

The answer can be represented as an irreducible fraction PQ\frac{P}{Q}. You are asked to output PmodMP \bmod M and QmodMQ \bmod M separated by a space, where M=1,000,000,007M = 1\\,000\\,000\\,007.

힌트

For the first input (when there are just 22 exam-days) Raccoon may learn 12\frac{1}{2} of all topics before the first attempt and another 12\frac{1}{2} if he fails on the first day. The expected amount of topics to be learned is therefore 1212+121=34\frac{1}{2} \cdot \frac{1}{2} + \frac{1}{2} \cdot 1 = \frac{3}{4}.