public static ListNode swapPairs(ListNode head) {
		if (head == null)
			return null;
		if (head.next == null)
			return head;

		ListNode newHead = null;
		boolean start = true;
		;

		ListNode first;
		ListNode second;
		ListNode thrid;
		ListNode last = null;
		while (head != null && head.next != null) {
			first = head;
			second = head.next;
			if (last != null) {
				last.next = second;
			}
			if (start) {
				newHead = second;
				start = false;
			}
			if (head.next.next != null) {
				thrid = head.next.next;
				first.next = thrid;
				second.next = first;
				head = thrid;
				if (head.next == null) {
					break;
				}
			} else {
				first.next = null;
				second.next = first;
				break;
			}
			last = first;
		}
		return newHead;
	}