program bly(input,ouput);
var
x:array[1..1000000] of longint;
h:array[1..1000] of longint;
i,j,k:longint;
n,m,ans,a,b,min,num:longint;
f1,f2:text;
begin
assign(f1,'exhibit.in');
reset(f1);
readln(f1,n,m);
for i:=1 to n do read(f1,x[i]);
close(f1);
min:=maxlongint;
for i:=1 to n do begin
for j:=i+1 to n do begin
num:=j-i+1;
for k:=i to j do inc(h[x[k]]);
for k:=1 to m do if h[k]<>0 then inc(ans);
if (ans=m)and(num<min) then begin min:=num; a:=i; b:=j; end;
for k:=1 to m do h[k]:=0;
ans:=0;
end;
end;
assign(f2,'exhibit.out');
rewrite(f2);
writeln(f2,a,' ',b);
close(f2);
end.