n=gets.to_i aa=gets.split.map &:to_i def isk(a,b,c) a!=c&&ac end m=0 z=nil f=true while(f) f=false n.times{|i| (i+1).upto(n){|j| (k+1).upto(n){|k| if isk(aa[i],aa[j],aa[k]) z=[i,j,k] unless z f=true m+=1 aa[i]=aa[j]=aa[k]=nil end } } } aa.delete(nil) end if m.even? puts -1 else puts z*' ' end