program ooo;
var
i,j,k,n,m,x,y,min:longint;
a:array[1..100000] of longint;
b:array[1..2000] of longint;
f:boolean;
t:text;
procedure oo;
var
i:longint;
begin
f:=false;
for i:=1 to n do
if a[i]=0 then begin f:=true;exit;end;
end;
begin
min:=maxlongint;
assign(t,'exhibit.in');
reset(t);
readln(t,m,n);
for i:=1 to m do
read(t,a[i]);
close(t);
for i:=1 to m do
begin
j:=i;k:=0;
fillchar(b,sizeof(b),0);
while (j<=m)and(k<>n) do
if b[a[j]]=0 then
begin
inc(k);inc(b[a[j]]);inc(j)
end else inc(j);
if (k=n)and(j-i<min) then begin min:=j-i;x:=i;y:=j-1;end;
end;
assign(t,'exhibit.out');
rewrite(t);
write(t,x,' ',y);
close(t);
end.