include iostream>
include cstring>
include algorithm>
const int N = 100010;
int n,q;
int arr[N];
int erfen1(int arr[],int len,int x)
{
int r,l,mid;
l=-1;
r=len;
while(l+1<r)
{
mid=(l+r)/2;
if(arr[mid]<x)
{
l=mid;
}
else
{
r=mid;
}
}
if(arr[r]==x)
{
return r;
}
else
{
return -1;
}
}
int erfen2(int arr[],int len,int x)
{
int r,l,mid;
l=-1;
r=len;
while(l+1<r)
{
mid=(l+r)/2;
if(arr[mid]<=x)
{
l=mid;
}
else
{
r=mid;
}
}
if(arr[l]==x)
{
return l;
}
else
{
return -1;
}
}
int main()
{
scanf(“%d %d”,&n,&q);
for(int i=0;i<n;i++)
{
scanf(“%d”,&arr[i]);
}
while(q–)
{
int k= 0;
scanf(“%d”,&k);
int res1=erfen1(arr,n,k);
if(res1==-1)
{
printf(“%d %d\n”,-1,-1);
continue;
}
int res2=erfen2(arr,n,k);
printf(“%d %d\n”,res1,res2);
}
return 0;
}