#include<stdio.h>#include<string.h>int main(){int t, count[10001];scanf("%d", &t);while (t--){memset(count, 0, sizeof(count));int max = -1, n, i, x, y1, y2;scanf("%d", &n);while (n--){scanf("%d %d %d", &x, &y1, &y2);for (i = y1; i <= y2; i++)count[i]++;}for (i = 0; i < 10001; i++)if (count[i] > max)max = count[i];printf("%dn", max);}return 0;}


