#include<bits/stdc++.h>
using namespace std;
const int N=1e5+5;
int n,m,A[N],B[N];
inline void Work()
{
Rd(n),Rd(m);
for(int i=1;i<=n;i++)Rd(A[i]);
for(int i=1;i<=m;i++)Rd(B[i]);
sort(A+1,A+n+1);
sort(B+1,B+m+1);
B[0]=-1,B[m+1]=1e9;
int Mx=0;
for(int i=1;i<=m+1;i++)
{
int K=lower_bound(A+1,A+n+1,B[i])-upper_bound(A+1,A+n+1,B[i-1]);
Mx=max(Mx,K);
}
if(Mx==0)return puts("Impossible"),void();
printf("%d\n",Mx);
}
inline void Rd(int &s)
{
s=0;char ch=getchar();
while(ch<'0'||ch>'9')ch=getchar();
while(ch>='0'&&ch<='9'){s=(s<<3)+(s<<1)+(ch-'0');ch=getchar();}
}
int main()
{
int T;Rd(T);
while(T--)Work();
}