public static ListNode deleteDuplicates(ListNode head) {
		// write your code here
		ListNode dummy=new ListNode(0), p=dummy, c=head;
		while (c!=null) {
			if (c.next==null||c.next.val!=c.val) {
				p.next=c;
				p=c;
				c=c.next;
				p.next=null;
			} else {
				ListNode t=c;
				while (c!=null&&c.val==t.val)
					c=c.next;
			}
		}
		return dummy.next;
	}