On judicious partitions of graphs