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

        ListNode pre, first, second, post;
        boolean flag = true;

        pre = null;
        first = head;
        second = first.next;

        while (second != null) {
            post = second.next;

            second.next = first;
            first.next = post;

            if (flag) {
                flag = false;
                head = second;
                pre = first;
            } else {
                pre.next = second;
                pre = first;
            }


            if (post == null || post.next == null) {
                break;
            } else {
                first = post;
                second = post.next;
            }
        }

        return head;
    }