#include <bits/stdc++.h>
using namespace std;
int dx[] = {0, 0, 1, -1, 1, -1, 1, -1}, dy[] = {1, -1, 0, 0, 1, -1, -1, 1};
using namespace std;
inline void cn(long& n) {
  n = 0;
  long ch = getchar();
  int sign = 1;
  while (ch < '0' || ch > '9') {
    if (ch == '-') sign = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9')
    n = (n << 3) + (n << 1) + ch - '0', ch = getchar();
  n = n * sign;
}
template <class T>
void cmin(T& a, T b) {
  if (b < a) a = b;
}
template <class T>
void cmax(T& a, T b) {
  if (b > a) a = b;
}
template <class T>
int len(const T& c) {
  return (int)c.size();
}
template <class T>
int len(char c[]) {
  return (int)strlen(c);
}
string itos(long n) {
  string s;
  while (n) {
    s += (n % 10 + 48);
    n /= 10;
  }
  reverse(s.begin(), s.end());
  return s;
}
long stoi(string s) {
  long n = 0;
  for (int i(0), _n(len(s)); i < _n; ++i) n = (n << 3) + (n << 1) + (s[i] - 48);
  return n;
}
long long ar[100005], f[1000];
int main() {
  long n, m, fl, a, b;
  f[0] = 1;
  f[1] = 1;
  for (int i(2), _b(101); i <= _b; ++i)
    f[i] = (f[i - 1] + f[i - 2]) % 1000000000;
  cin >> n >> m;
  for (int i(1), _n(n); i <= _n; ++i) cin >> ar[i];
  for (int i(0), _n(m); i < _n; ++i) {
    cin >> fl;
    cin >> a >> b;
    if (fl == 1) {
      ar[a] = b;
    } else {
      long long sum = 0;
      int k = 0;
      for (int j(a), _b(b); j <= _b; ++j) {
        sum = (sum + (f[k] * ar[j])) % 1000000000;
        k++;
      }
      cout << sum % 1000000000 << endl;
    }
  }
  return 0;
}
