\documentclass[a4paper,12pt]{scrartcl}
\usepackage{mathtext}
\usepackage[T2A,T2B,T2C,T1]{fontenc}
\usepackage[ukrainian,russian,ngerman]{babel}
\usepackage[koi8-r]{inputenc}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Author: Thomas Braun
% begin: Mon June 19 2005
% last edit: 
% License: GPLv2 or later
% 
% (probably all) cyrillic letters
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\include{definitions}

\iffalse
\newcommand{\selectlanguage}[1]{}
\newcommand{\command}[1]
\fi
\newcommand{\ukrainian}[1]{%
{\selectlanguage{ukrainian}\fontencoding{T2A}\selectfont#1}}
\newcommand{\ttwob}[1]{%
{\fontencoding{T2B}\selectfont#1}}

\begin{document}
\selectlanguage{russian}
% begin russian alphabet
\begin{neededpkgs}[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext}
\command{\CYRA}
\command{\CYRB}
\command{\CYRV}
\command{\CYRG}
\command{\CYRD}
\command{\CYRE}
\command{\CYRYO}
\command{\CYRZH}
\command{\CYRZ}
\command{\CYRI}
\command{\CYRISHRT}
\command{\CYRK}
\command{\CYRL}
\command{\CYRM}
\command{\CYRN}
\command{\CYRO}
\command{\CYRP}
\command{\CYRR}
\command{\CYRS}
\command{\CYRT}
\command{\CYRU}
\command{\CYRF}
\command{\CYRH}
\command{\CYRC}
\command{\CYRCH}
\command{\CYRSH}
\command{\CYRSHCH}
\command{\CYRHRDSN}
\command{\CYRERY}
\command{\CYRSFTSN}
\command{\CYREREV}
\command{\CYRYU}
\command{\CYRYA}
\par
\command{\cyra}
\command{\cyrb}
\command{\cyrv}
\command{\cyrg}
\command{\cyrd}
\command{\cyre}
\command{\cyryo}
\command{\cyrzh}
\command{\cyrz}
\command{\cyri}
\command{\cyrishrt}
\command{\cyrk}
\command{\cyrl}
\command{\cyrm}
\command{\cyrn}
\command{\cyro}
\command{\cyrp}
\command{\cyrr}
\command{\cyrs}
\command{\cyrt}
\command{\cyru}
\command{\cyrf}
\command{\cyrh}
\command{\cyrc}
\command{\cyrch}
\command{\cyrsh}
\command{\cyrshch}
\command{\cyrhrdsn}
\command{\cyrery}
\command{\cyrsftsn}
\command{\cyrerev}
\command{\cyryu}
\command{\cyrya}
\par % end of russian alphabet
\command{\CYRABHCH}
\command{\CYRABHCHDSC}
\end{neededpkgs}
\begin{neededpkgs}[ukrainian,koi8-r,T2A,]{babel,inputenc,fontenc,mathtext}
\ukrainian{
\command{\CYRZHDSC}
}
\end{neededpkgs}
\pkgs[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext}\command{\CYRABHDZE}
\begin{neededpkgs}[ukrainian,koi8-r,T2A,]{babel,inputenc,fontenc,mathtext}
\ukrainian{
\command{\CYRZDSC}
}
\end{neededpkgs}
\begin{neededpkgs}[koi8-r,T2B,]{inputenc,fontenc,mathtext}
\ttwob{
\command{\CYRKHK}
}
\end{neededpkgs}
\pkgs[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext}\command{\CYRKHCRS}
\pkgs[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext}\command{\CYRKDSC}
\begin{neededpkgs}[ukrainian,koi8-r,T2A,]{babel,inputenc,fontenc,mathtext}
\ukrainian{
\command{\CYRKVCRS}
\command{\CYRLJE}
}
\end{neededpkgs}
\begin{neededpkgs}[koi8-r,T2B,]{inputenc,fontenc,mathtext}
\ttwob{
\command{\CYRLDSC}
}
\end{neededpkgs}
\pkgs[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext}\command{\CYRMDSC}
\pkgs[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext}\command{\CYRNDSC}
\begin{neededpkgs}[ukrainian,koi8-r,T2A,]{babel,inputenc,fontenc,mathtext}
\ukrainian{
\command{\CYRNG}
\command{\CYRNJE}
}
\end{neededpkgs}
\begin{neededpkgs}[koi8-r,T2B,]{inputenc,fontenc,mathtext}
\ttwob{
\command{\CYRNHK}
}
\end{neededpkgs}
\begin{neededpkgs}[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext}
\command{\CYROTLD}
\command{\CYRPHK}
\command{\CYRRTICK}
\end{neededpkgs}
\begin{neededpkgs}[ukrainian,koi8-r,T2A,]{babel,inputenc,fontenc,mathtext}
\ukrainian{
\command{\CYRSDSC}
}
\end{neededpkgs}
\pkgs[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext}\command{\CYRTDSC}
\begin{neededpkgs}[ukrainian,koi8-r,T2A,]{babel,inputenc,fontenc,mathtext}
\ukrainian{
\command{\CYRTSHE}
\command{\CYRDJE}
\command{\CYRUSHRT}
}
\end{neededpkgs}
\pkgs[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext}\command{\CYRSHHA}
\pkgs[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext}\command{\CYRGHK}
\begin{neededpkgs}[ukrainian,koi8-r,T2A,]{babel,inputenc,fontenc,mathtext}
\ukrainian{
\command{\CYRGUP}
\command{\CYRGHCRS}
}
\end{neededpkgs}
\begin{neededpkgs}[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext}
\command{\CYRHDSC}
\command{\CYRDZHE}
\command{\CYRDZE}
\command{\CYRTETSE}
\end{neededpkgs}
\begin{neededpkgs}[koi8-r,T2B,]{inputenc,fontenc,mathtext}
\ttwob{
\command{\CYRCHLDSC}
}
\end{neededpkgs}
\begin{neededpkgs}[ukrainian,koi8-r,T2A,]{babel,inputenc,fontenc,mathtext}
\ukrainian{
\command{\CYRCHVCRS}
}
\end{neededpkgs}
\pkgs[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext}\command{\CYRCHRDSC}
\pkgs[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext}\command{\CYRSEMISFTSN}
\begin{neededpkgs}[ukrainian,koi8-r,T2A,]{babel,inputenc,fontenc,mathtext}
\ukrainian{
\command{\CYRIE}
}
\end{neededpkgs}
\begin{neededpkgs}[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext}
\command{\CYRSCHWA}
\command{\CYRII}
\command{\CYRJE}
\end{neededpkgs}
\begin{neededpkgs}[ukrainian,koi8-r,T2A,]{babel,inputenc,fontenc,mathtext}
\ukrainian{
\command{\CYRYI}
\command{\CYRY}
\command{\CYRYHCRS}
\command{\CYRAE}
}
\end{neededpkgs}
\begin{neededpkgs}[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext}
\command{\CYRABHHA}
\command{\CYRpalochka}
\command{\cyrabhch}
\command{\cyrabhchdsc}
\end{neededpkgs}
\begin{neededpkgs}[ukrainian,koi8-r,T2A,]{babel,inputenc,fontenc,mathtext}
\ukrainian{
\command{\cyrzhdsc}
}
\end{neededpkgs}
\pkgs[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext}\command{\cyrabhdze}
\begin{neededpkgs}[ukrainian,koi8-r,T2A,]{babel,inputenc,fontenc,mathtext}
\ukrainian{
\command{\cyrzdsc}
}
\end{neededpkgs}
\begin{neededpkgs}[koi8-r,T2B,]{inputenc,fontenc,mathtext}
\ttwob{
\command{\cyrkhk}
}
\end{neededpkgs}
\pkgs[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext}\command{\cyrkhcrs}
\pkgs[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext}\command{\cyrkdsc}
\begin{neededpkgs}[ukrainian,koi8-r,T2A,]{babel,inputenc,fontenc,mathtext}
\ukrainian{
\command{\cyrkvcrs}
\command{\cyrlje}
}
\end{neededpkgs}
\begin{neededpkgs}[koi8-r,T2B,]{inputenc,fontenc,mathtext}
\ttwob{
\command{\cyrldsc}
}
\end{neededpkgs}
\pkgs[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext}\command{\cyrmdsc}
\pkgs[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext}\command{\cyrndsc}
\begin{neededpkgs}[ukrainian,koi8-r,T2A,]{babel,inputenc,fontenc,mathtext}
\ukrainian{
\command{\cyrng}
\command{\cyrnje}
}
\end{neededpkgs}
\begin{neededpkgs}[koi8-r,T2B,]{inputenc,fontenc,mathtext}
\ttwob{
\command{\cyrnhk}
}
\end{neededpkgs}
\begin{neededpkgs}[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext}
\command{\cyrotld}
\command{\cyrphk}
\command{\cyrrtick}
\end{neededpkgs}
\begin{neededpkgs}[ukrainian,koi8-r,T2A,]{babel,inputenc,fontenc,mathtext}
\ukrainian{
\command{\cyrsdsc}
}
\end{neededpkgs}
\pkgs[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext}\command{\cyrtdsc}
\begin{neededpkgs}[ukrainian,koi8-r,T2A,]{babel,inputenc,fontenc,mathtext}
\ukrainian{
\command{\cyrtshe}
\command{\cyrdje}
\command{\cyrushrt}
}
\end{neededpkgs}
\pkgs[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext}\command{\cyrshha}
\pkgs[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext}\command{\cyrghk}
\begin{neededpkgs}[ukrainian,koi8-r,T2A,]{babel,inputenc,fontenc,mathtext}
\ukrainian{
\command{\cyrgup}
\command{\cyrghcrs}
}
\end{neededpkgs}
\begin{neededpkgs}[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext}
\command{\cyrhdsc}
\command{\cyrdzhe}
\command{\cyrdze}
\command{\cyrtetse}
\end{neededpkgs}
\begin{neededpkgs}[koi8-r,T2B,]{inputenc,fontenc,mathtext}
\ttwob{
\command{\cyrchldsc}
}
\end{neededpkgs}
\begin{neededpkgs}[ukrainian,koi8-r,T2A,]{babel,inputenc,fontenc,mathtext}
\ukrainian{
\command{\cyrchvcrs}
}
\end{neededpkgs}
\begin{neededpkgs}[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext}
\command{\cyrchrdsc}
\command{\cyrsemisftsn}
\end{neededpkgs}
\begin{neededpkgs}[ukrainian,koi8-r,T2A,]{babel,inputenc,fontenc,mathtext}
\ukrainian{
\command{\cyrie}
}
\end{neededpkgs}
\begin{neededpkgs}[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext}
\command{\cyrschwa}
\command{\cyrii}
\command{\cyrje}
\end{neededpkgs}
\begin{neededpkgs}[ukrainian,koi8-r,T2A,]{babel,inputenc,fontenc,mathtext}
\ukrainian{
\command{\cyryi}
\command{\cyry}
\command{\cyryhcrs}
\command{\cyrae}
}
\end{neededpkgs}
\pkgs[russian,koi8-r,T2C,]{babel,inputenc,fontenc,mathtext}\command{\cyrabhha}

\end{document}
