Splitting sets of cardinality greater than omega

Let $\omega \leq \kappa \leq 2^{\omega}$ and $cf(\kappa) > \omega$. Show that if $X \subseteq \mathbf{R}$ s.t. $|X| = \kappa$ then $\exists q \in \mathbf{Q}$ s.t. $|X \cap (-\infty , q)| = |X \cap (q, \infty)| = \kappa$

It seems obvious, but I just can't put together a proper proof. Thanks for any help.

• Not quite a duplicate, but closely related to this question. – user642796 Feb 15 '15 at 15:18

Let $$A:=\{a\in\mathbb Q; |X\cap(-\infty,a)|<\kappa\}\\ B:=\{b\in\mathbb Q; |X\cap(b,+\infty)|<\kappa\}$$ First let us notice that $A$ is downward-closed and $B$ is upward-closed.
Let us notice that the assumption $A\cup B=\mathbb Q$ leads to a contradiction, since this would mean that there is a real number $$r=\sup A=\inf B$$ and $$X\subseteq \left(X\cap(-\infty,r)\right)\cup\left(X\cap(r,+\infty)\right)\cup\{r\} = \left(\bigcup_{a\in A} X\cap(-\infty,a)\right)\cup\left(\bigcup_{b\in B} X\cap(b,+\infty)\right)\cup\{r\},$$ i.e., $X$ would be a union of countably many subsets such that each of them has cardinality $<\kappa$.
So we know that $$\mathbb Q\setminus(A\cup B)\ne\emptyset.$$ Is suffices to take arbitrary $q\in\mathbb Q\setminus(A\cup B)$.