PROGRAM AA;
type
mode=record
s:integer;
l:integer;
end;
var
se:set of 1..255;
j,k,ll:integer;
f:text;
n,m,flag,head,js,min:integer;
a:array[1..1000000]of integer;
a1:array[1..1000000]of mode;
begin
assign(f,'exhibit.in');
reset(f);
readln(f,n,m);
for j:=1 to n do
read(f,a[j]);
close(f);
head:=1;
for j:=1 to n-m do
begin
se:=[1..m];
k:=j;
flag:=0;
ll:=0;
{while (flag=0)or (k<=n-m) do}
repeat
begin
if a[k] in se then se:=se-[a[k]];
inc(k);
inc(ll);
if se=[] then flag:=1;
end;
until (flag=1) or (k>n);
if flag=1 then
begin
a1[head].s:=j;
a1[head].l:=ll;
inc(head);
end;
end;
assign(f,'exhibit.out');
rewrite(f);
min:=maxint;
for j:=1 to head-1 do
if a1[j].l < min then begin min:=a1[j].l;k:=a1[j].s;end;
writeln(f,k,' ',k+min-1);
close(f);
end.