s=[] while gets (puts"ERR";next)if$_[/0 \//] $_[/1 2/]?(puts"0.5\n1";exit):( $_.sub!("mod","%") $_.sub!("^","**") $_.split.each{|i|i[/\d/]?s<