#include <bits/stdc++.h>
using namespace std;
long long f[150];
long long mod = 1000000000;
long long a[150];
int main(int argc, char** argv) {
  int n, m;
  scanf("%d%d", &n, &m);
  f[0] = 1;
  f[1] = 1;
  for (int i = 2; i <= n; i++) f[i] = (f[i - 2] + f[i - 1]) % mod;
  for (int i = 1; i <= n; i++) scanf("%lld", &a[i]);
  for (int i = 0; i < m; i++) {
    int t;
    scanf("%d", &t);
    if (t == 1) {
      long long x, v;
      scanf("%lld%lld", &x, &v);
      a[x] = v;
    } else {
      int l, r;
      scanf("%d%d", &l, &r);
      long long res = 0;
      for (int i = l; i <= r; i++) {
        res = (res + (f[i - l] * a[i]) % mod) % mod;
      }
      printf("%lld\n", res);
    }
  }
  return 0;
}
