shanghai rules