#include <iostream>
#include <string>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <unordered_map>
#include <numeric>
#include <iomanip>
using namespace std;
#define pii pair<long long, long long>
#define ll long long
#define FAST ios_base::sync_with_stdio(false); cin.tie(NULL)
const long long dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
const long long dl[2] = {1, -1};
const long long MOD = 1000000007;
const long long MAX = 1000005;
const long long MAXN = 1000005;
int N, M , K;
long long arr[MAXN];
long long seg[MAXN * 4];
long long build(int x, int s, int e){
if(s == e){
return seg[x] = arr[s];
}
int mid = (s + e)/2;
return seg[x] = (build(x * 2, s, mid) * build(x * 2 + 1, mid + 1, e)) % MOD;
}
void update(int x, int s, int e, int idx, long long val){
if(idx < s || idx > e) return;
if(s == e){
seg[x] = val;
return;
}
int mid = (s + e)/2;
update(x * 2, s, mid, idx, val);
update(x * 2 + 1, mid + 1, e, idx, val);
seg[x] = (seg[x * 2] * seg[x * 2 + 1]) % MOD;
}
long long query(int x, int s, int e, int a, int b){
if(a > e || b < s) return 1;
if(a <= s && e <= b){
return seg[x];
}
int mid = (s + e)/2;
return (query(x * 2, s, mid, a, b) * query(x * 2 + 1, mid + 1, e, a, b)) % MOD;
}
int main() {
FAST;
cin >> N >> M >> K;
for(int i = 1; i <= N; i++){
cin >> arr[i];
}
build(1, 1, N);
for(int i = 0; i < M + K; i++){
int a, b, c;
cin >> a >> b >> c;
if(a == 1){
update(1, 1, N, b, c);
}
else{
cout << query(1, 1, N, b, c) << "\n";
}
}
}
/*
5 2 2
1
2
3
4
5
1 3 6
2 2 5
1 5 2
2 3 5
*/