By the age of three Smart Beaver mastered all arithmetic operations and got this summer homework from the amazed teacher:
You are given a sequence of integers
a1,a2,...,an. Your task is to perform on it
m consecutive operations of the following type:
-
For given numbers xi and vi assign value vi to element axi.
-
For given numbers li and ri you've got to calculate sum , where f0=f1=1 and at i≥2: fi=fi-1+fi-2.
-
For a group of three numbers li ri di you should increase value ax by di for all x (li≤x≤ri).
Smart Beaver planned a tour around great Canadian lakes, so he asked you to help him solve the given problem.
Output
For each query print the calculated sum modulo
1000000000 (109).