#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000000;
const int MAXN = 100;
int n, m;
int a[MAXN], f[MAXN];
int main() {
  f[0] = f[1] = 1;
  for (int i = 2; i < MAXN; i++) f[i] = (f[i - 1] + f[i - 2]) % MOD;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  for (int q = 0; q < m; q++) {
    int typ;
    scanf("%d", &typ);
    if (typ == 1) {
      int x, v;
      scanf("%d%d", &x, &v);
      x--;
      a[x] = v;
    } else if (typ == 2) {
      int l, r;
      scanf("%d%d", &l, &r);
      l--;
      r--;
      int ans = 0;
      for (int i = 0; i <= r - l; i++)
        ans = (ans + (long long)f[i] * a[l + i] % MOD) % MOD;
      printf("%d\n", ans);
    }
  }
  return 0;
}
