program exhibit;
var
s:array[1..1000000] of longint;
f:array[1..2000] of integer;
i,j,k,m,n,min,tou,wei:longint;
flag:boolean;
begin
assign(input,'exhibit.in');reset(input);
assign(output,'exhibit.out');rewrite(output);
readln(n,m);
min:=maxint;
for i:=1 to n do
read(s[i]);
i:=0;
while i<n-m+1 do
begin
inc(i);
for j:=i to n do
begin
inc(f[s[j]]);
flag:=false;
for k:=1 to m do if f[k]<1 then flag:=true;
if not flag then begin if j-i+1<min then begin min:=j-i+1;
tou:=i; wei:=j; end;
for k:=1 to m do f[k]:=0; break; end;
end;
end;
writeln(tou,' ',wei);
close(output);
end.