A well-known linear recursive sequence f(n) is defined as follows.
For k≤0, f(k)=1
For k≥1, f(k)=a*f(k - p)+b*f(k - q).
Given n,a,b,p,q, find the value of f(n) modulo 119.
The input consists of several tests. For each tests:
5 integers n,a,b,p,q (1≤n≤10
9,0≤a,b≤10
9,1≤p<q≤10
4).