GOST 28147-89 is a standard symmetric encryption based on a Feistel network.



The structure of the algorithm consists of three levels:

   encryption modes - simple replacement, application range, imposing a range of feedback and authentication code generation;
   cycles - 32-З, 32-Р and 16-З, is a repetition of the main step;
   main step, a function that takes a 64-bit block of text and one of the eight 32-bit encryption key elements, and uses the replacement table (8x16 matrix of 4-bit values), and returns encrypted block.


Task

Implement the main step of this encryption algorithm.




ИП6	С/П	+	П6	ИП7	С/П	+	П7	ИПE	-
x>=0	14	П7	КИП6	ИП6	ИПE	-	x>=0	20	П6
8	П2	П3	2	П1	4	П0	0	П8	1
П9	КИП2	ИПB	/	[x]	ПA	Вх	{x}	ИПB	*
С/П	ИП9	*	ИП8	+	П8	ИП9	ИПB	*	П9
ИПA	L0	32	ИП8	КП3	L1	25	8	П0	ИП7
ПП	93	П1	ИП6	ПП	93	ИП5	+	П6	ИП1
ИП4	+	П7	ИП4	ИП6	С/П	П4	ИП5	ИП7	С/П
П5	ИП4	ИП6	П4	<->	П6	ИП5	ИП7	П5	<->
П7	БП	00	ИПC	/	[x]	КП0	Вx	{x}	ИПC
*	ИПD	*	В/О