import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;
public class Main {
static int nodeCnt, changeCnt, mulCnt;
static long[] tree;
static final int MOD = 1000000007;
static int powTwoK;
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringTokenizer(br.readLine());
nodeCnt = Integer.parseInt(st.nextToken());
changeCnt = Integer.parseInt(st.nextToken());
mulCnt = Integer.parseInt(st.nextToken());
// powTwoK 구하기
int exponext = 0;
while (powTwoK < nodeCnt) {
powTwoK = (int) Math.pow(2, exponext);
exponext++;
}
// tree 초기화
setTree(br);
for (int i = 1; i <= changeCnt + mulCnt; i++) {
st = new StringTokenizer(br.readLine());
int a = Integer.parseInt(st.nextToken());
int b = Integer.parseInt(st.nextToken());
if (a == 1) {
long c = Long.parseLong(st.nextToken());
update(b, c);
} else if (a == 2) {
int c = Integer.parseInt(st.nextToken());
System.out.println(getMul(b, c));
}
}
}
private static long getMul(int s, int e) {
s = s + powTwoK - 1;
e = e + powTwoK - 1;
long partMul = 1;
while (s <= e) {
if (s % 2 == 1)
partMul = partMul * tree[s] % MOD;
if (e % 2 == 0)
partMul = partMul * tree[e] % MOD;
s = (s + 1) / 2;
e = (e - 1) / 2;
}
return partMul;
}
private static void update(int fromIdx, long to) {
fromIdx = fromIdx + powTwoK - 1;
for (int i = fromIdx; i >= 1; i /= 2) {
if (i == fromIdx) {
tree[i] = to;
} else {
tree[i] = (tree[2 * i] * tree[2 * i + 1]) % MOD;
}
}
}
private static void setTree(BufferedReader br) throws IOException {
tree = new long[powTwoK * 2];
Arrays.fill(tree, 1);
for (int i = powTwoK; i <= nodeCnt + powTwoK - 1; i++) {
long tmp = Long.parseLong(br.readLine());
tree[i] = tmp;
}
for (int i = powTwoK - 1; i >= 1; i--) {
tree[i] = (tree[2 * i] * tree[2 * i + 1]) % MOD;
}
}
}