#include <bits/stdc++.h>
using namespace std;
const int maxn = 110, mod = 1000000000;
int n, m;
int a[maxn];
long long f[maxn];
int main() {
  int i, j;
  scanf("%d%d", &n, &m);
  for (i = 1; i <= n; i++) scanf("%d", &a[i]);
  f[0] = f[1] = 1;
  for (i = 2; i <= 100; i++) f[i] = (f[i - 1] + f[i - 2]) % mod;
  for (i = 1; i <= m; i++) {
    int k, x, y;
    scanf("%d%d%d", &k, &x, &y);
    if (k == 1) a[x] = y;
    if (k == 2) {
      long long ans = 0;
      for (j = 0; j <= y - x; j++)
        ans = (ans + (long long)f[j] * a[x + j] % mod) % mod;
      cout << ans << endl;
    }
  }
  return 0;
}
