\documentclass[openany]{mwbk} 
\usepackage{polski}\usepackage{hyperref} 
\newcount\nr \def\pattern#1{\nr=1 \loop {\phantomsection 
\chapter*{\Huge Rozdzial \the\nr}} \advance\nr by 1 \ifnum\nr<#1 
\repeat} 
\begin{document} 
\tableofcontents 
\pattern{20} 
\end{document} 
