Let D(x) be the number of positive divisors of a positive integer x. For example, D(2) = 2 (2 is divisible by 1 and 2), D(6) = 4 (6 is divisible by 1, 2, 3 and 6).

You are given an array a of n integers. You have to process two types of queries:

  1. REPLACE l r — for every <image> replace ai with D(ai); 
  2. SUM l r — calculate <image>. 



Print the answer for each SUM query.

Input

The first line contains two integers n and m (1 ≤ n, m ≤ 3·105) — the number of elements in the array and the number of queries to process, respectively.

The second line contains n integers a1, a2, ..., an (1 ≤ ai ≤ 106) — the elements of the array.

Then m lines follow, each containing 3 integers ti, li, ri denoting i-th query. If ti = 1, then i-th query is REPLACE li ri, otherwise it's SUM li ri (1 ≤ ti ≤ 2, 1 ≤ li ≤ ri ≤ n).

There is at least one SUM query.

Output

For each SUM query print the answer to it.

Example

Input

7 6
6 4 1 10 3 2 4
2 1 7
2 4 5
1 3 5
2 4 4
1 5 7
2 1 7


Output

30
13
4
22
#include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
const int maxn = 1.2e6 + 10;
const int maxm = 1e6 + 10;
long long n, m, a[maxn], s[maxn], f[maxn], ma[maxn];
int prime[maxm], cnt = 0;
bool vis[maxm];
inline void prepare() {
  memset(vis, 0, sizeof(vis));
  f[1] = 1;
  for (int i = 2; i < maxm; i++) {
    if (!vis[i]) {
      prime[cnt++] = i;
      f[i] = 2;
    }
    for (int j = 0; j < cnt && i * prime[j] < maxm; j++) {
      vis[i * prime[j]] = 1;
      if (i % prime[j])
        f[i * prime[j]] = 2 * f[i];
      else {
        int cnt = 0, x = i;
        while (x % prime[j] == 0) {
          x /= prime[j];
          cnt++;
        }
        f[i * prime[j]] = f[i] * (cnt + 2) / (cnt + 1);
      }
    }
  }
}
inline long long lson(long long o) { return o << 1; }
inline long long rson(long long o) { return o << 1 | 1; }
inline void pushup(long long o) {
  s[o] = s[lson(o)] + s[rson(o)];
  ma[o] = max(ma[lson(o)], ma[rson(o)]);
}
inline void build(long long o, long long l, long long r) {
  if (l == r) {
    s[o] = ma[o] = a[l];
    return;
  }
  long long mid = (l + r) >> 1;
  build(lson(o), l, mid);
  build(rson(o), mid + 1, r);
  pushup(o);
}
inline void change(long long o, long long l, long long r, long long ql,
                   long long qr) {
  if (l == r) {
    s[o] = ma[o] = f[s[o]];
    return;
  }
  long long mid = (l + r) >> 1;
  if (ql <= mid && ma[lson(o)] > 2) change(lson(o), l, mid, ql, qr);
  if (qr > mid && ma[rson(o)] > 2) change(rson(o), mid + 1, r, ql, qr);
  pushup(o);
}
inline long long query(long long o, long long l, long long r, long long ql,
                       long long qr) {
  if (ql <= l && r <= qr) {
    return s[o];
  }
  long long mid = (l + r) >> 1, ans = 0;
  if (ql <= mid) ans += query(lson(o), l, mid, ql, qr);
  if (qr > mid) ans += query(rson(o), mid + 1, r, ql, qr);
  return ans;
}
int main() {
  prepare();
  scanf("%I64d%I64d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%I64d", &a[i]);
  build(1, 1, n);
  while (m--) {
    int t, x, y;
    scanf("%d%d%d", &t, &x, &y);
    if (t == 1)
      change(1, 1, n, x, y);
    else
      printf("%lld\n", query(1, 1, n, x, y));
  }
  return 0;
}
