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
import java.util.*;
import java.io.*;
import java.math.*;
public class Main {


    void solve() {
        int n=ni(),m=ni();
        cnt=new int[1000001];
        for(int i=1;i<=1e6;i++){
            for(int j=i;j<=1e6;j+=i) cnt[j]++;
        }
        constant=new boolean[4*n+1];
        tree=new long[4*n+1];
        a=new int[n+1];
        for(int i=1;i<=n;i++) {
            a[i] = ni();
        }
        build(1,1,n);
        while(m-->0){
            int t=ni(),l=ni(),r=ni();
            if(t==1){
                update(1,l,r,1,n);
            }else {
                long ans=querry(1,l,r,1,n);
                pw.println(ans);
            }
        }


    }
    int cnt[];
    long tree[];
    boolean constant[];
    int a[];
    void build(int id,int l,int r){
        if(l==r){
            tree[id]=a[l];
            if(a[l]<=2) constant[id]=true;
        }else {
            int mid=(l+r)/2;
            build(2*id,l,mid);
            build(2*id+1,mid+1,r);
            tree[id]=tree[2*id]+tree[2*id+1];
            constant[id]=constant[2*id] && constant[2*id+1];

        }
    }
    void update(int id,int x,int y,int l,int r){
        if(r<x || l>y) return;
        if(constant[id]) return;
        if(l==r){
            a[l]=cnt[a[l]];
            tree[id]=a[l];
            if(a[l]<=2) constant[id]=true;
            return;
        }
        int mid=(l+r)/2;
        update(2*id,x,y,l,mid);
        update(2*id+1,x,y,mid+1,r);
        tree[id]=tree[2*id]+tree[2*id+1];
        constant[id]=constant[2*id] && constant[2*id+1];
    }
    long querry(int id,int x,int y,int l,int r){
        if(r<x || l>y) return 0;
        if(x<=l && r<=y) return tree[id];
        int mid=(l+r)/2;
        return querry(2*id,x,y,l,mid)+querry(2*id+1,x,y,mid+1,r);
    }

    long M=(long)1e9+7;
    InputStream is;
    PrintWriter pw;
    String INPUT = "";
    void run() throws Exception {
        is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());
        pw = new PrintWriter(System.out);
        long s = System.currentTimeMillis();
        solve();
        pw.flush();
        if(!INPUT.isEmpty())tr(System.currentTimeMillis()-s+"ms");
    }

    public static void main(String[] args) throws Exception { new Main().run(); }

    private byte[] inbuf = new byte[1024];
    public int lenbuf = 0, ptrbuf = 0;

    private int readByte() {
        if(lenbuf == -1)throw new InputMismatchException();
        if(ptrbuf >= lenbuf){
            ptrbuf = 0;
            try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }
            if(lenbuf <= 0)return -1;
        }
        return inbuf[ptrbuf++];
    }

    private boolean isSpaceChar(int c) { return !(c >= 33 && c <= 126); }
    private int skip() { int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }

    private double nd() { return Double.parseDouble(ns()); }
    private char nc() { return (char)skip(); }

    private String ns() {
        int b = skip();
        StringBuilder sb = new StringBuilder();
        while(!(isSpaceChar(b))){ // when nextLine, (isSpaceChar(b) && b != ' ')
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    private char[] ns(int n) {
        char[] buf = new char[n];
        int b = skip(), p = 0;
        while(p < n && !(isSpaceChar(b))){
            buf[p++] = (char)b;
            b = readByte();
        }
        return n == p ? buf : Arrays.copyOf(buf, p);
    }

    private char[][] nm(int n, int m) {
        char[][] map = new char[n][];
        for(int i = 0;i < n;i++)map[i] = ns(m);
        return map;
    }

    private int[] na(int n) {
        int[] a = new int[n];
        for(int i = 0;i < n;i++)a[i] = ni();
        return a;
    }

    private int ni() {
        int num = 0, b;
        boolean minus = false;
        while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
        if(b == '-'){
            minus = true;
            b = readByte();
        }

        while(true){
            if(b >= '0' && b <= '9'){
                num = num * 10 + (b - '0');
            }else{
                return minus ? -num : num;
            }
            b = readByte();
        }
    }

    private long nl() {
        long num = 0;
        int b;
        boolean minus = false;
        while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
        if(b == '-'){
            minus = true;
            b = readByte();
        }

        while(true){
            if(b >= '0' && b <= '9'){
                num = num * 10 + (b - '0');
            }else{
                return minus ? -num : num;
            }
            b = readByte();
        }
    }

    private void tr(Object... o) { if(INPUT.length() > 0)System.out.println(Arrays.deepToString(o)); }
}