#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000000;
long long arr[2 * 140], fibon[2 * 140];
long long fibo(int n) {
  if (n < 2) return fibon[n] = 1;
  if (fibon[n] != -1) return fibon[n];
  return fibon[n] = (fibo(n - 1) + fibo(n - 2)) % mod;
}
int main() {
  int n, m, i, j, a, b, q;
  memset(fibon, -1, sizeof fibon);
  fibo(150);
  cin >> n >> m;
  for (i = 1; i <= n; i++) cin >> arr[i];
  for (int k = 0; k < m; k++) {
    scanf("%d", &q);
    if (q == 1) {
      cin >> a >> b;
      arr[a] = b;
    }
    if (q == 2) {
      cin >> a >> b;
      long long sum = 0;
      for (j = 0; j <= b - a; j++) {
        long long tem = (arr[a + j] % mod) * (fibon[j] % mod) % mod;
        sum = (sum + tem) % mod;
      }
      cout << sum << endl;
    }
  }
  return 0;
}
