class Fixnum
    alias :div :/
    def /(x)
        if self < 0
            return -abs.div(x)
        else
            div(x)
        end
    end
end

n = gets.to_i
n.times do
    p eval(gets[0..-3])
end