problem6 in go