#include <bits/stdc++.h>
using namespace std;
long long int F[102];
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> A(n, 0);
  vector<long long int> ans;
  for (int i = 0; i < n; i++) cin >> A[i];
  F[0] = 1;
  F[1] = 1;
  for (int i = 2; i <= 101; i++) {
    F[i] = F[i - 1] + F[i - 2];
    F[i] %= 1000000000;
  }
  for (int i = 0; i < m; i++) {
    int ch;
    cin >> ch;
    if (ch == 1) {
      int x, v;
      cin >> x >> v;
      A[x - 1] = v;
    } else {
      int l, r;
      cin >> l >> r;
      l--;
      r--;
      long long int tans = 0;
      for (int j = l; j <= r; j++) {
        tans += (F[j - l] * A[j]);
        tans %= 1000000000;
      }
      ans.push_back(tans);
    }
  }
  for (int i = 0; i < ans.size(); i++) cout << ans[i] << "\n";
  return 0;
}
