DZY loves colors, and he enjoys painting.

On a colorful day, DZY gets a colorful ribbon, which consists of n units (they are numbered from 1 to n from left to right). The color of the i-th unit of the ribbon is i at first. It is colorful enough, but we still consider that the colorfulness of each unit is 0 at first.

DZY loves painting, we know. He takes up a paintbrush with color x and uses it to draw a line on the ribbon. In such a case some contiguous units are painted. Imagine that the color of unit i currently is y. When it is painted by this paintbrush, the color of the unit becomes x, and the colorfulness of the unit increases by |x - y|.

DZY wants to perform m operations, each operation can be one of the following:

  1. Paint all the units with numbers between l and r (both inclusive) with color x. 
  2. Ask the sum of colorfulness of the units between l and r (both inclusive). 



Can you help DZY?

Input

The first line contains two space-separated integers n, m (1 ≤ n, m ≤ 105).

Each of the next m lines begins with a integer type (1 ≤ type ≤ 2), which represents the type of this operation.

If type = 1, there will be 3 more integers l, r, x (1 ≤ l ≤ r ≤ n; 1 ≤ x ≤ 108) in this line, describing an operation 1.

If type = 2, there will be 2 more integers l, r (1 ≤ l ≤ r ≤ n) in this line, describing an operation 2.

Output

For each operation 2, print a line containing the answer — sum of colorfulness.

Examples

Input

3 3
1 1 2 4
1 2 3 5
2 1 3


Output

8


Input

3 4
1 1 3 4
2 1 1
2 2 2
2 3 3


Output

3
2
1


Input

10 6
1 1 5 3
1 2 7 9
1 10 10 11
1 3 8 12
1 1 10 3
2 1 10


Output

129

Note

In the first sample, the color of each unit is initially [1, 2, 3], and the colorfulness is [0, 0, 0].

After the first operation, colors become [4, 4, 3], colorfulness become [3, 2, 0].

After the second operation, colors become [4, 5, 5], colorfulness become [3, 3, 2].

So the answer to the only operation of type 2 is 8.
#include <bits/stdc++.h>
using namespace std;
const long long sz = 2e5 + 10;
struct tre {
  long long now, sum;
} tree[4 * sz];
struct laz {
  long long v, ad;
} lazy[4 * sz];
void prop(long long lo, long long hi, long long node) {
  if (lo == hi) return;
  long long mid = lo + hi >> 1, l = node << 1, r = node << 1 | 1;
  tree[l] = {lazy[node].v, tree[l].sum + lazy[node].ad * (mid - lo + 1)};
  tree[r] = {lazy[node].v, tree[r].sum + lazy[node].ad * (hi - mid)};
  lazy[l] = {lazy[node].v, lazy[l].ad + lazy[node].ad};
  lazy[r] = {lazy[node].v, lazy[r].ad + lazy[node].ad};
  lazy[node] = {-1, 0};
}
void build(long long lo, long long hi, long long node) {
  if (lo == hi) {
    tree[node] = {lo, 0};
    lazy[node] = {-1, 0};
    return;
  }
  long long mid = lo + hi >> 1;
  build(lo, mid, node << 1);
  build(mid + 1, hi, node << 1 | 1);
  tree[node] = {-1, 0};
  lazy[node] = {-1, 0};
}
void update(long long lo, long long hi, long long l, long long r, long long v,
            long long node) {
  if (lazy[node].v != -1) prop(lo, hi, node);
  if (lo > r || hi < l) return;
  if (lo >= l && hi <= r && tree[node].now != -1) {
    long long d = abs(tree[node].now - v);
    tree[node] = {v, tree[node].sum + d * (hi - lo + 1)};
    lazy[node] = {v, lazy[node].ad + d};
    return;
  }
  long long mid = lo + hi >> 1;
  update(lo, mid, l, r, v, node << 1);
  update(mid + 1, hi, l, r, v, node << 1 | 1);
  if (tree[node << 1].now == tree[node << 1 | 1].now)
    tree[node].now = tree[node << 1].now;
  else
    tree[node].now = -1;
  tree[node].sum = tree[(node << 1)].sum + tree[(node << 1 | 1)].sum;
}
long long query(long long lo, long long hi, long long l, long long r,
                long long node) {
  if (lazy[node].v != -1) prop(lo, hi, node);
  if (lo > r || hi < l) return 0;
  if (lo >= l && hi <= r) return tree[node].sum;
  long long mid = (lo + hi) >> 1;
  return query(lo, mid, l, r, node << 1) +
         query(mid + 1, hi, l, r, node << 1 | 1);
}
int main() {
  long long n, q;
  cin >> n >> q;
  assert(1 <= n && n <= (long long)2e5);
  assert(1 <= q && q <= (long long)2e5);
  build(1, n, 1);
  while (q--) {
    long long typ, l, r;
    scanf("%lld", &typ), scanf("%lld", &l), scanf("%lld", &r);
    assert(1 <= typ && typ <= 2);
    assert(1 <= l && l <= n && l <= r);
    assert(1 <= r && r <= n);
    if (typ == 1) {
      long long v;
      scanf("%lld", &v);
      assert(0 <= v && v <= (long long)1e8);
      update(1, n, l, r, v, 1);
    } else
      printf("%lld\n", query(1, n, l, r, 1));
  }
  return 0;
}
