Problem: <image>

After William is done with work for the day, he enjoys playing his favorite video game.

The game happens in a 2D world, starting at turn 0. William can pick any cell in the game world and spawn in it. Then, each turn, William may remain at his current location or move from the current location (x, y) to one of the following locations: (x + 1, y), (x - 1, y), (x, y + 1), (x, y - 1).

To accelerate movement the game has n fast travel towers. i-th tower is located at location (xa_i, ya_i). To be able to instantly travel to the tower from any location in the game world it must first be activated. Activation of tower i happens at the moment when the player is in cell (xa_i, ya_i) after this the tower remains active throughout the entire game.

William also knows that the game has m quests. i-th quest can be completed instantly by being at location (xb_i, yb_i) on turn t_i.

William wants to find out the maximal number of quests he will be able to complete by optimally traversing the game world.

Input

The first line contains two integers n and m (0 ≤ n ≤ 14, 1 ≤ m ≤ 100), which are the number of towers and the number of quests, respectively.

Each of the next n lines contains two integers xa_i, ya_i (1 ≤ xa_i, ya_i ≤ 10^6), which are the coordinates of fast travel towers.

Each of the next m lines contains two integers xb_i, yb_i and t_i (1 ≤ xb_i, yb_i ≤ 10^6, 1 ≤ t_i ≤ 10^9), which are the coordinates of quests and the turn at which it may be completed.

It is guaranteed that all locations in a test are different.

Output

Print a single number — the maximal number of quests William will be able to complete.

Example

Input


3 4
1 1
2 3
5 2
2 2 12
5 1 4
6 2 11
3 5 10


Output


3

Note

In the first sample test one of the possible sequences of William's actions is as follows: 

  * Spawn at (3, 2) 
  * On turn 1 move to (4, 2) 
  * On turn 2 move to (5, 2). By visiting this cell William activates tower number 3. 
  * On turn 3 move to (5, 1), where he waits for 1 turn to complete the 2nd quest 
  * On turn 5 move to (5, 2) 
  * On turn 6 move to (5, 3) 
  * On turn 7 move to (5, 4) 
  * On turn 8 move to (5, 5) 
  * On turn 9 move to (4, 5) 
  * On turn 10 move to (3, 5). By moving to this location William will complete the 4th quest 
  * On turn 10 instantly move to an already activated fast travel tower at (5, 2) 
  * On turn 11 move to (6, 2). By moving to this location William will complete the 3rd quest 
  * William will not be able to complete the quest number 1, because the tower at (2, 3) was not activated 

Solution (in CPP):

Solution:
#include<bits/stdc++.h>
namespace my_std{
	using namespace std;
	#define pii pair<int,int>
	#define fir first
	#define sec second
	#define MP make_pair
	#define rep(i,x,y) for (int i=(x);i<=(y);i++)
	#define drep(i,x,y) for (int i=(x);i>=(y);i--)
	#define go(x) for (int i=head[x];i;i=edge[i].nxt)
	#define templ template<typename T>
	#define sz 121
	typedef long long ll;
	typedef double db;
	mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
	templ inline T rnd(T l,T r) {return uniform_int_distribution<T>(l,r)(rng);}
	templ inline bool chkmax(T &x,T y){return x<y?x=y,1:0;}
	templ inline bool chkmin(T &x,T y){return x>y?x=y,1:0;}
	templ inline void read(T& t)
	{
		t=0;char f=0,ch=getchar();double d=0.1;
		while(ch>'9'||ch<'0') f|=(ch=='-'),ch=getchar();
		while(ch<='9'&&ch>='0') t=t*10+ch-48,ch=getchar();
		if(ch=='.'){ch=getchar();while(ch<='9'&&ch>='0') t+=d*(ch^48),d*=0.1,ch=getchar();}
		t=(f?-t:t);
	}
	template<typename T,typename... Args>inline void read(T& t,Args&... args){read(t); read(args...);}
	char __sr[1<<21],__z[20];int __C=-1,__zz=0;
	inline void Ot(){fwrite(__sr,1,__C+1,stdout),__C=-1;}
	inline void print(int x)
	{
		if(__C>1<<20)Ot();if(x<0)__sr[++__C]='-',x=-x;
		while(__z[++__zz]=x%10+48,x/=10);
		while(__sr[++__C]=__z[__zz],--__zz);__sr[++__C]='\n';
	}
	void file()
	{
		#ifdef NTFOrz
		freopen("a.in","r",stdin);
		#endif
	}
	inline void chktime()
	{
		#ifdef NTFOrz
		cerr<<clock()/1000.0<<'\n';
		#endif
	}
	#ifdef mod
	ll ksm(ll x,int y){ll ret=1;for (;y;y>>=1,x=x*x%mod) if (y&1) ret=ret*x%mod;return ret;}
	ll inv(ll x){return ksm(x,mod-2);}
	#else
	ll ksm(ll x,int y){ll ret=1;for (;y;y>>=1,x=x*x) if (y&1) ret=ret*x;return ret;}
	#endif
//	inline ll mul(ll a,ll b){ll d=(ll)(a*(double)b/mod+0.5);ll ret=a*b-d*mod;if (ret<0) ret+=mod;return ret;}
}
using namespace my_std;

int n,m;
ll X[sz],Y[sz],T[sz];
ll dd(int i,int j){return abs(X[i]-X[j])+abs(Y[i]-Y[j]);}

ll f[1<<14][sz],dis[1<<14][sz]; int g[1<<14][sz];

int main()
{
	file();
	read(n,m);
	rep(i,0,n-1) read(X[i+m],Y[i+m]);
	{
		static pair<int,pii> P[sz];
		rep(i,0,m-1) read(P[i].sec.fir,P[i].sec.sec,P[i].fir);
		sort(P,P+m);
		rep(i,0,m-1) T[i]=P[i].fir,tie(X[i],Y[i])=P[i].sec;
	}
	int S=1<<n;
	rep(s,1,S-1) rep(i,0,n+m-1) { ll w=1e10; rep(k,0,n-1) if (s>>k&1) chkmin(w,dd(i,k+m)); dis[s][i]=w; }
	memset(f,0x3f,sizeof(f)); memset(g,-1,sizeof(g));
	rep(i,0,n-1) f[1<<i][0]=0; rep(i,0,m-1) g[0][i]=1;
	rep(s,0,S-1)
	{
		int p=0,q=0;
		auto work1=[&](int i)
		{
			if (g[s][i]>=0&&s) chkmin(f[s][g[s][i]],T[i]);
			if (g[s][i]>=0)
			{
				rep(j,i+1,m-1) if (dd(i,j)<=T[j]-T[i]) chkmax(g[s][j],g[s][i]+1);
				rep(j,0,n-1) if (!(s>>j&1)) chkmin(f[1<<j|s][g[s][i]],T[i]+dd(i,j+m));
			}
		};
		auto work2=[&](int i)
		{
			if (!s||f[s][i]>1e9) return;
			rep(j,i,m-1) if (dis[s][j]<=T[j]-f[s][i]) chkmax(g[s][j],i+1);
			rep(j,0,n-1) if (!(s>>j&1)) chkmin(f[1<<j|s][i],f[s][i]+dis[s][j+m]);
		};
		while (p<m&&q<m) { rep(i,p+1,m-1) if (f[s][i]<=f[s][p]) p=i; if (f[s][p]<T[q]) work2(p),++p; else work1(q),++q; }
		while (p<m) work2(p),++p; while (q<m) work1(q),++q;
	}
	int ans=0;
	rep(s,0,S-1) rep(i,0,m-1) chkmax(ans,g[s][i]);
	cout<<ans;
	return 0;
}