Journal of Computer Systems and Sciences, (JCSS), vol. 57, no. 1, pp. 37-49, 1998.Preliminary version appeared in Proceedings of the 27th Symposium on the Theory of Computing (STOC), pp. 103-111, 1995.