class Fixnum
  alias old_div /
  def /(b)
    if((self<0) ^ (b<0))
      return -(self.abs.old_div(b.abs))
    else
      return self.old_div(b)
    end
  end
end

gets.to_i.times{puts eval(gets.chomp.chop)}