a,*s=gets puts (s.index(a))?"#{(t=s.index(/[^#{a}]/))+2} #{s[t]}":"1 #{a}"