program ex;
type
ss=array[1..100]of integer;
sz=array[1..2000]of integer;
var
a:ss;
b:sz;
f1,f2:text;
n,m:longint;
procedure init;
var
i:longint;
begin
assign(f1,'exhibit.in');
assign(f2,'exhibit.out');
reset(f1);
rewrite(f2);
readln(f1,n,m);
for i:=1 to n do
read(f1,a[i]);
close(f1);
end;
procedure main;
var
i,j,na,nb,max,num:longint;
begin
i:=1;j:=1;na:=1;nb:=1;
max:=n;num:=1;b[a[1]]:=1;
repeat
if num=m then
begin
if j-i+1<max then
begin
na:=i;nb:=j;
max:=j-i+1;
end;
inc(i);dec(b[a[i-1]]);
if b[a[i-1]]=0 then dec(num);
end else
begin
inc(j);
if b[a[j]]=0 then inc(num);
inc(b[a[j]]);
end;
until j=n;
writeln(f2,na,' ',nb);
end;
begin
init;
main;
close(f2);
end.