300684: CF130E. Tribonacci numbers

Memory Limit:64 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

E. Tribonacci numberstime limit per test2 secondsmemory limit per test64 megabytesinputstandard inputoutputstandard output

Tribonacci numbers are a sequence of numbers, defined as follows:

  • t0 = t1 = 0,
  • t2 = 1,
  • ti = ti - 1 + ti - 2 + ti - 3.

You are given n; calculate n-th tribonacci number modulo 26.

Input

The only line of input contains an integer n (1 ≤ n ≤ 1000).

Output

Output n-th tribonacci number modulo 26.

ExamplesInput
4
Output
2
Input
9
Output
18

Input

加入题单

上一题 下一题 算法标签: