Input (grade 7): Mahmud fought against the Seljuk Sultan of Khorasan, Ahmed Sanjar, whom Mehmed I had revolted against in 1105.
Output (grade 11): Mahmud II (Kab zl k) (died 1131) proclaimed himself the Seljuk sultan of Baghdad in 1118 following the death of Mehmed I (probably Mahmuds father).