#include <bits/stdc++.h>
long long a[105], f[105];
int n, m, t;
int main() {
  f[0] = 1;
  f[1] = 1;
  for (int i = 2; i <= 101; ++i) f[i] = (f[i - 1] + f[i - 2]) % 1000000000;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) scanf("%I64d", a + i);
  for (int i = 0; i < m; ++i) {
    scanf("%d", &t);
    if (t == 1) {
      int x, v;
      scanf("%d%d", &x, &v);
      a[x] = v;
    } else if (t == 2) {
      int l, r;
      scanf("%d%d", &l, &r);
      long long ans = 0;
      for (int j = 0; j <= r - l; ++j)
        ans = (ans + f[j] * a[l + j] % 1000000000) % 1000000000;
      printf("%I64d\n", ans);
    }
  }
  return 0;
}
