






from __future__ import annotations

A        =			tuple[int, int, int]
A        =			tuple[str, str, str]


# used alphabet --------------------------
# from string.ascii_uppercase
A        =			'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

# -------------------------- default selection --------------------------
# rotors --------------------------
A        =			'EGZWVONAHDCLFQMSIPJBYUKXTR'
A        =			'FOBHMDKEXQNRAULPGSJVTYICZW'
A        =			'ZJXESIUQLHAVRMDOYGTNFWPBKC'
# reflector --------------------------
A        =			{
    'A': 'N',
    'N': 'A',
    'B': 'O',
    'O': 'B',
    'C': 'P',
    'P': 'C',
    'D': 'Q',
    'Q': 'D',
    'E': 'R',
    'R': 'E',
    'F': 'S',
    'S': 'F',
    'G': 'T',
    'T': 'G',
    'H': 'U',
    'U': 'H',
    'I': 'V',
    'V': 'I',
    'J': 'W',
    'W': 'J',
    'K': 'X',
    'X': 'K',
    'L': 'Y',
    'Y': 'L',
    'M': 'Z',
    'Z': 'M',
}

# -------------------------- extra rotors --------------------------
A        =			'RMDJXFUWGISLHVTCQNKYPBEZOA'
A        =			'SGLCPQWZHKXAREONTFBVIYJUDM'
A        =			'HVSICLTYKQUBXDWAJZOMFGPREN'
A        =			'RZWQHFMVDBKICJLNTUXAGYPSOE'
A        =			'LFKIJODBEGAMQPXVUHYSTCZRWN'
A        =			'KOAEGVDHXPQZMLFTYWJNBRCIUS'



def 					_lowerCamelCase(			lowerCAmelCase__				:		RotorPositionT    ,    lowerCAmelCase__				:		RotorSelectionT    ,    lowerCAmelCase__				:		str      ):





				'''simple docstring'''







				if (unique_rotsel := len(set(lowerCAmelCase__      )      )) < 3:
								SCREAMING_SNAKE_CASE_   :	Tuple													=   F'''Please use 3 unique rotors (not {unique_rotsel})'''
								raise Exception(lowerCAmelCase__      )

				# Checks if rotor positions are valid
				SCREAMING_SNAKE_CASE_							,       SCREAMING_SNAKE_CASE_							,       SCREAMING_SNAKE_CASE_   :	Tuple													=   rotpos
				if not 0 < rotorposa <= len(lowerCAmelCase__      ):
								SCREAMING_SNAKE_CASE_   :	Tuple													=   F'''First rotor position is not within range of 1..26 ({rotorposa}'''
								raise ValueError(lowerCAmelCase__      )
				if not 0 < rotorposa <= len(lowerCAmelCase__      ):
								SCREAMING_SNAKE_CASE_   :	Union[str, Any]													=   F'''Second rotor position is not within range of 1..26 ({rotorposa})'''
								raise ValueError(lowerCAmelCase__      )
				if not 0 < rotorposa <= len(lowerCAmelCase__      ):
								SCREAMING_SNAKE_CASE_   :	Any													=   F'''Third rotor position is not within range of 1..26 ({rotorposa})'''
								raise ValueError(lowerCAmelCase__      )

				# Validates string and returns dict
				SCREAMING_SNAKE_CASE_   :	Dict													=   _plugboard(lowerCAmelCase__      )

				return rotpos, rotsel, pbdict



def 					_lowerCamelCase(			lowerCAmelCase__				:		str      ):





				'''simple docstring'''







				if not isinstance(lowerCAmelCase__    ,    lowerCAmelCase__      ):
								SCREAMING_SNAKE_CASE_   :	Dict													=   F'''Plugboard setting isn\'t type string ({type(lowerCAmelCase__      )})'''
								raise TypeError(lowerCAmelCase__      )
				elif len(lowerCAmelCase__      ) % 2 != 0:
								SCREAMING_SNAKE_CASE_   :	Dict													=   F'''Odd number of symbols ({len(lowerCAmelCase__      )})'''
								raise Exception(lowerCAmelCase__      )
				elif pbstring == "":
								return {}

				pbstring.replace(' '    ,    ''      )

				# Checks if all characters are unique
				SCREAMING_SNAKE_CASE_   :	int													=   set()
				for i in pbstring:
								if i not in abc:
												SCREAMING_SNAKE_CASE_   :	Optional[Any]													=   F'''\'{i}\' not in list of symbols'''
												raise Exception(lowerCAmelCase__      )
								elif i in tmppbl:
												SCREAMING_SNAKE_CASE_   :	Dict													=   F'''Duplicate symbol ({i})'''
												raise Exception(lowerCAmelCase__      )
								else:
												tmppbl.add(lowerCAmelCase__      )
				del tmppbl

				# Created the dictionary
				SCREAMING_SNAKE_CASE_   :	Union[str, Any]													=   {}
				for j in range(0    ,    len(lowerCAmelCase__      ) - 1    ,    2      ):
								SCREAMING_SNAKE_CASE_   :	Any													=   pbstring[j + 1]
								SCREAMING_SNAKE_CASE_   :	Any													=   pbstring[j]

				return pb



def 					_lowerCamelCase(			lowerCAmelCase__				:		str    ,    lowerCAmelCase__				:		RotorPositionT    ,    lowerCAmelCase__				:		RotorSelectionT = (rotora, rotora, rotora)    ,    lowerCAmelCase__				:		str = ""    ,    ):





				'''simple docstring'''







				SCREAMING_SNAKE_CASE_   :	Union[str, Any]													=   text.upper()
				SCREAMING_SNAKE_CASE_							,       SCREAMING_SNAKE_CASE_							,       SCREAMING_SNAKE_CASE_   :	Optional[Any]													=   _validator(
				    lowerCAmelCase__    ,    lowerCAmelCase__    ,    plugb.upper()      )

				SCREAMING_SNAKE_CASE_							,       SCREAMING_SNAKE_CASE_							,       SCREAMING_SNAKE_CASE_   :	Any													=   rotor_position
				SCREAMING_SNAKE_CASE_							,       SCREAMING_SNAKE_CASE_							,       SCREAMING_SNAKE_CASE_   :	Optional[Any]													=   rotor_selection
				rotorposa -= 1
				rotorposa -= 1
				rotorposa -= 1

				SCREAMING_SNAKE_CASE_   :	int													=   []

				# encryption/decryption process --------------------------
				for symbol in text:
								if symbol in abc:
												# 1st plugboard --------------------------
												if symbol in plugboard:
																SCREAMING_SNAKE_CASE_   :	Optional[Any]													=   plugboard[symbol]

												# rotor ra --------------------------
												SCREAMING_SNAKE_CASE_   :	Union[str, Any]													=   abc.index(lowerCAmelCase__      ) + rotorposa
												SCREAMING_SNAKE_CASE_   :	Optional[int]													=   rotora[index % len(lowerCAmelCase__      )]

												# rotor rb --------------------------
												SCREAMING_SNAKE_CASE_   :	Optional[int]													=   abc.index(lowerCAmelCase__      ) + rotorposa
												SCREAMING_SNAKE_CASE_   :	Any													=   rotora[index % len(lowerCAmelCase__      )]

												# rotor rc --------------------------
												SCREAMING_SNAKE_CASE_   :	Optional[int]													=   abc.index(lowerCAmelCase__      ) + rotorposa
												SCREAMING_SNAKE_CASE_   :	List[str]													=   rotora[index % len(lowerCAmelCase__      )]

												# reflector --------------------------
												# this is the reason you don't need another machine to decipher

												SCREAMING_SNAKE_CASE_   :	Any													=   reflector[symbol]

												# 2nd rotors
												SCREAMING_SNAKE_CASE_   :	Tuple													=   abc[rotora.index(lowerCAmelCase__      ) - rotorposa]
												SCREAMING_SNAKE_CASE_   :	List[str]													=   abc[rotora.index(lowerCAmelCase__      ) - rotorposa]
												SCREAMING_SNAKE_CASE_   :	Optional[int]													=   abc[rotora.index(lowerCAmelCase__      ) - rotorposa]

												# 2nd plugboard
												if symbol in plugboard:
																SCREAMING_SNAKE_CASE_   :	Dict													=   plugboard[symbol]

												# moves/resets rotor positions
												rotorposa += 1
												if rotorposa >= len(lowerCAmelCase__      ):
																SCREAMING_SNAKE_CASE_   :	Optional[Any]													=   0
																rotorposa += 1
												if rotorposa >= len(lowerCAmelCase__      ):
																SCREAMING_SNAKE_CASE_   :	Optional[Any]													=   0
																rotorposa += 1
												if rotorposa >= len(lowerCAmelCase__      ):
																SCREAMING_SNAKE_CASE_   :	List[str]													=   0

        # else:
        #    pass
        #    Error could be also raised
        #    raise ValueError(
        #       'Invalid symbol('+repr(symbol)+')')
								result.append(lowerCAmelCase__      )

				return "".join(lowerCAmelCase__      )


if __name__ == "__main__":
				A        =			'This is my Python script that emulates the Enigma machine from WWII.'
				A        =			(1, 1, 1)
				A        =			'pictures'
				A        =			(rotora, rotora, rotora)
				A        =			enigma(message, rotor_pos, rotor_sel, pb)

				print('Encrypted message:', en)
				print('Decrypted message:', enigma(en, rotor_pos, rotor_sel, pb))







def 					_lowerCamelCase(			):





				'''simple docstring'''







				return 1



def 					_lowerCamelCase(			lowerCAmelCase__				:		int      ):





				'''simple docstring'''







				return 0 if x < 0 else two_pence(x - 2      ) + one_pence()



def 					_lowerCamelCase(			lowerCAmelCase__				:		int      ):





				'''simple docstring'''







				return 0 if x < 0 else five_pence(x - 5      ) + two_pence(lowerCAmelCase__      )



def 					_lowerCamelCase(			lowerCAmelCase__				:		int      ):





				'''simple docstring'''







				return 0 if x < 0 else ten_pence(x - 10      ) + five_pence(lowerCAmelCase__      )



def 					_lowerCamelCase(			lowerCAmelCase__				:		int      ):





				'''simple docstring'''







				return 0 if x < 0 else twenty_pence(x - 20      ) + ten_pence(lowerCAmelCase__      )



def 					_lowerCamelCase(			lowerCAmelCase__				:		int      ):





				'''simple docstring'''







				return 0 if x < 0 else fifty_pence(x - 50      ) + twenty_pence(lowerCAmelCase__      )



def 					_lowerCamelCase(			lowerCAmelCase__				:		int      ):





				'''simple docstring'''







				return 0 if x < 0 else one_pound(x - 100      ) + fifty_pence(lowerCAmelCase__      )



def 					_lowerCamelCase(			lowerCAmelCase__				:		int      ):





				'''simple docstring'''







				return 0 if x < 0 else two_pound(x - 200      ) + one_pound(lowerCAmelCase__      )



def 					_lowerCamelCase(			lowerCAmelCase__				:		int = 200      ):





				'''simple docstring'''







				return two_pound(lowerCAmelCase__      )


if __name__ == "__main__":
				print(solution(int(input().strip())))