write dice solution