#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  int n, m;
  cin >> n >> m;
  vector<int> f(n + 1);
  f[0] = 1;
  f[1] = 1;
  for (int i = 2; i < n; ++i) {
    f[i] = (f[i - 1] + f[i - 2]) % 1000000000;
  }
  vector<long long> a(n + 1);
  int x;
  a[0] = 0;
  for (int i = 0; i < n; ++i) {
    cin >> a[i + 1];
  }
  long long y, z, per;
  for (int i = 0; i < m; ++i) {
    cin >> x;
    if (x == 1) {
      cin >> y >> z;
      a[y] = z;
    } else if (x == 2) {
      cin >> y >> z;
      per = 0;
      for (int i = 0; i <= z - y; ++i) {
        per += (a[y + i] * f[i]) % 1000000000;
      }
      cout << per % 1000000000 << endl;
    }
  }
  return 0;
}
