#include <bits/stdc++.h>
using namespace std;
const int N = 200000 + 5;
const int mod = 1000000000;
int a[N], f[N];
int main() {
  int n, m, type, x, v, l, r, d, sum;
  scanf("%d%d", &n, &m);
  f[0] = f[1] = 1;
  for (int i = 2; i < n; ++i) f[i] = (f[i - 1] + f[i - 2]) % mod;
  for (int i = 0; i < n; ++i) scanf("%d", &a[i]);
  for (int i = 0; i < m; ++i) {
    scanf("%d", &type);
    if (type == 1) {
      scanf("%d%d", &x, &v);
      x--;
      a[x] = v;
    } else if (type == 2) {
      scanf("%d%d", &l, &r);
      sum = 0;
      r--;
      l--;
      for (int j = 0; j <= r - l; ++j) {
        sum = (sum + (long long)(f[j]) * (long long)(a[l + j])) % mod;
      }
      cout << sum << endl;
    }
  }
}
