#include <bits/stdc++.h>
using namespace std;
long long MOD = 1000000000;
int main() {
  int n, m;
  cin >> n >> m;
  vector<long long> a(n);
  for (int i = 0; i < n; ++i) cin >> a[i];
  vector<long long> f(1000);
  f[0] = f[1] = 1;
  for (int i = 2; i < f.size(); ++i) {
    f[i] = (f[i - 1] + f[i - 2]) % MOD;
  }
  for (int i = 0; i < m; ++i) {
    int t;
    cin >> t;
    if (t == 1) {
      int x, v;
      cin >> x >> v;
      a[x - 1] = v;
    } else if (t == 2) {
      int l, r;
      cin >> l >> r;
      long long res = 0;
      for (int i = 0; i <= r - l; ++i) {
        res = (res + f[i] * a[l + i - 1]) % MOD;
      }
      cout << res << endl;
    }
  }
}
