#include <iostream>
#include <vector>
using namespace std;
#define MAXN 1000001
#define MOD 1000000007
typedef long long ll;
int arr[MAXN];
vector<ll> tree;
int N,M,K;
ll init(int node, int start, int end){
if (start == end) return tree[node] = arr[start];
int mid = (start+end)/2;
return tree[node] = ((init(node*2,start,mid)%MOD)*(init(node*2+1,mid+1, end)%MOD))%MOD;
}
ll update(int node, int start, int end, int idx, ll val){
if (!(start <= idx && idx <= end)){
return tree[node];
}
if (start == end) return tree[node] = val;
int mid = (start + end) / 2;
return tree[node] = (update(node*2,start,mid,idx,val)*update(node*2+1,mid+1,end,idx,val))%MOD;
}
ll mul(int node, int start, int end, int left, int right){
if (left > end || right < start) return 1;
if (left <= start && end <= right) return tree[node];
int mid = (start + end) / 2;
return (mul(node*2,start,mid,left,right)*mul(node*2+1,mid+1,end,left,right))%MOD;
}
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
cin >> N >> M >> K;
M += K;
for (int i = 0; i<N;i++){
cin >> arr[i];
}
int h = 1;
while (h < N) h<<=1;
tree = vector<ll> (h*2);
init(1,0,N-1);
while (M--){
int a;
cin >> a;
if (a == 1){
int idx;
ll val;
cin >> idx >> val;
update(1,0,N-1,idx-1,val);
}
else{
int left,right;
cin >> left >> right;
cout << mul(1,0,N-1,left-1,right-1)%MOD <<"\n";
}
}
return 0;
}