write the reducers for hadoop streaming in R and Python