include [HTML_REMOVED]
using namespace std;
const int N = 100010;
int a[N];
int main()
{
int n, q, k;
cin >> n >> q;
for (int i = 0; i < n; i ++)
cin >> a[i];
while (q –)
{
cin >> k;
int l = lower_bound(a, a + n, k) - a;
int r = upper_bound(a, a + n, k) - a;
if (a[l] != k)
cout << -1 << ‘ ‘ << -1 << endl;
else
cout << l << ‘ ‘ << r - 1 << endl;
}
return 0;
}