gets $<.map{p eval(gets.gsub(/\d+/,'-~\&*')+?1)%(10**9+7)-1}