Fibonacci's soup is one of the most well-known recipe in Fibonacci's hometown. Besides making soup, Fibonacci also enjoys seeking weird sequences.
We all know that we would not like to add two days before yesterday's soup into Fibonacci's soup, otherwise, It would cause food safety issues, and it would become "Bad Fibonacci's soup", aka "BFS".
One day, Fibonacci found a new sequence again. Since Fibonacci just eat Bad Fibonacci's soup for his lunch and was vomiting, he decided to name this newly found sequence "Bad Fibonacci's sequence".
The following is the formula for the sequence:
If your program gets a "Time Limit Exceeded", your program may solve a same problem (e.g., f(m) or g(n)) too many times. We suggest that you use the dynamic programming method as follows:
In this way, we can avoid repeated computation and reduce the computation time significantly.
The input contains one line: nonnegative integers a, b, c, d and n.
Testcase constraints
Output one line, including f(n) and g(n).
Please remember to print '\n' at the end.