    exp = '1+(2-3)/(4*5)'
    rpn = []
    stack = []
    operator = {
    '(' => 0,
    '+' => 1,
    '-' => 1,
    '*' => 2,
    '/' => 2,
    }
     
    def isdigit(c)
    if c =~ /[0-9]/
    return true
    end
    return false
    end
     
    exp.each_char do |e|
    if isdigit(e)
    rpn << e
    next
    end
    if e.class == String
    case e
    when ')'
    while stack[-1] != '('
    rpn << stack.pop
    end
    stack.pop
    next
    when '('
    stack << e
    next
    end
    if stack != []
    while operator[stack[-1]] >= operator[e]
    rpn << stack.pop
    if stack == []
    break
    end
    end
    end
    stack << e
    end
    end
     
    while stack.length != 0
    rpn << stack.pop
    end
     
    rpn.each do |e|
    print "#{e} "
    end
    print "\n"