def answer(query):
    parts = query.query.split()

    if len(parts) < 2:
        return []

    try:
        args = list(map(float, parts[1:]))
    except:
        return []

    func = parts[0]
    answer = None

    if func == b'min':
        answer = min(args)
    elif func == b'max':
        answer = max(args)
    elif func == b'avg':
        answer = sum(args) / len(args)
    elif func == b'sum':
        answer = sum(args)
    elif func == b'prod':
        answer = reduce(mul, args, 1)

    if answer is None:
        return []

    return [{'answer': unicode(answer)}]