#include using namespace std; // Numeric Constants #define MOD 1000000007 #define maxs 250005 #define mins 1005 #define eps 0.000000000001 #define pi 3.141592653589793 // Others #define ll long long int #define pb push_back #define iosbase ios_base::sync_with_stdio(false) #define pii pair #define pll pair #define ppi pair,int> #define ppl pair #define vi vector #define F first #define S second #define siter set::iterator #define p_pq priority_queue #define ub upper_bound #define lb lower_bound inline ll power(ll a, ll b, ll c) { ll ans=1; while(b>0) { if(b&1) { ans=(ans*a)%c; } a=(a*a)%c; b=b>>1; } return ans; } ll c[100010]; int main() { ll p=1000000007; ll n,a,b,q,ty,x,y; cin>>n>>a>>b>>q; for(ll i=0;i>c[i]; } while(q--) { cin>>ty>>x>>y; if(ty==1) { c[x]=y; } else { ll ans=0; for(ll i=x;i<=y;++i) { ll tt=power(a,i-x,p); if((i-x)%2==0) ans=(ans+((power(b,i-x,p)*power(tt,p-2,p))%p*c[i])%p)%p; else ans=(ans+p-((power(b,i-x,p)*power(tt,p-2,p))%p*c[i])%p)%p; } if(ans) cout<<"No"<