# Sereja and Commands

import java.io.;
import java.math.
;
import java.util.*;

import static java.util.Arrays.fill;
import static java.lang.Math.*;
import static java.util.Arrays.sort;
import static java.util.Collections.sort;

class SEACO {

``````public static int mod = 1000000007;
static FasterScanner in = new FasterScanner();
static PrintWriter out = new PrintWriter(System.out);
static class Query
{
int type;
int l;
int r;
Query(int type,int l,int r)
{
this.type=type;
this.l=l;
this.r=r;
}

}
public static void main(String[] args) {

int testcases=in.nextInt();
while(testcases-->0)
{
int n=in.nextInt();
int m=in.nextInt();
long[] temparray=new long[n+2];
long[] count=new long[m+2];
long[] differencecount=new long[m+1];
Query[] query=new Query[m+1];
for(int i=1;i<=m;i++)
{
query[i]=new Query(in.nextInt(), in.nextInt(), in.nextInt());
}
count[m+1]=1;
for(int i=m;i>=1;i--)
{
count[i]=count[i+1]+differencecount[i];
if(query[i].type==2)
{
differencecount[query[i].r]+=count[i];
differencecount[query[i].l-1]-=count[i];
//differencecount[query[i].r]%=mod;
//differencecount[query[i].l-1]%=mod;
}
/*else if(query[i].type==1)
{
temparray[query[i].l]+=count[i];
temparray[query[i].r+1]-=count[i];
temparray[query[i].l]%mod;
temparray[query[i].r+1]%=mod;
}*/
}
for(int i=1;i<=m;i++)
{
if(query[i].type==1)
{
}
}
for(int i=1;i<=n;i++)
{
}
for(int i=1;i<=n;i++)
{
}
out.println();
}
out.close();

}

public static long pow(long x, long n, long mod) {
long res = 1;
for (long p = x; n > 0; n >>= 1, p = (p * p) % mod) {
if ((n & 1) != 0) {
res = (res * p % mod);
}
}
return res;
}

public static long gcd(long n1, long n2) {
long r;
while (n2 != 0) {
r = n1 % n2;
n1 = n2;
n2 = r;
}
return n1;
}

static class FasterScanner {
private byte[] buf = new byte[1024];
private int curChar;
private int snumChars;

if (snumChars == -1)
throw new InputMismatchException();
if (curChar >= snumChars) {
curChar = 0;
try {
} catch (IOException e) {
throw new InputMismatchException();
}
if (snumChars <= 0)
return -1;
}
return buf[curChar++];
}

public String nextLine() {
while (isSpaceChar(c))
StringBuilder res = new StringBuilder();
do {
res.appendCodePoint(c);
} while (!isEndOfLine(c));
return res.toString();
}

public String nextString() {
while (isSpaceChar(c))
StringBuilder res = new StringBuilder();
do {
res.appendCodePoint(c);
} while (!isSpaceChar(c));
return res.toString();
}

public long nextLong() {
while (isSpaceChar(c))
int sgn = 1;
if (c == '-') {
sgn = -1;
}
long res = 0;
do {
if (c < '0' || c > '9')
throw new InputMismatchException();
res *= 10;
res += c - '0';
} while (!isSpaceChar(c));
return res * sgn;
}

public int nextInt() {
while (isSpaceChar(c))
int sgn = 1;
if (c == '-') {
sgn = -1;
}
int res = 0;
do {
if (c < '0' || c > '9')
throw new InputMismatchException();
res *= 10;
res += c - '0';
} while (!isSpaceChar(c));
return res * sgn;
}

public int[] nextIntArray(int n) {
int[] arr = new int[n];
for (int i = 0; i < n; i++) {
arr[i] = nextInt();
}
return arr;
}

public long[] nextLongArray(int n) {
long[] arr = new long[n];
for (int i = 0; i < n; i++) {
arr[i] = nextLong();
}
return arr;
}

private boolean isSpaceChar(int c) {
return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
}

private boolean isEndOfLine(int c) {
return c == '\n' || c == '\r' || c == -1;
}
}
``````

}