program EmberAsh;
const
maxn=1000000;
var
a:array[1..maxn]of integer;
t:array[1..2000]of boolean;
i,j,k,ss,la,lb,len,n,m:longint;
fin,fout:text;
BEGIN
assign(fin,'exhibit.in');reset(fin);
assign(fout,'exhibit.out');rewrite(fout);
readln(fin,n,m);
for i:=1 to n do
read(fin,a[i]);
close(fin);
len:=maxlongint;
for i:=1 to n do
begin
for j:=i+m to n do
begin
fillchar(t,sizeof(t),false);
ss:=0;
for k:=i to j do
if t[a[k]]=false then
begin
inc(ss);
t[a[k]]:=true;
end;
if ss>=m then
if len>j-i+1 then
begin
len:=j-i+1;
la:=i;
lb:=j;
end;
end;
end;
writeln(fout,la,' ',lb);
close(fout);
END.