



"""simple docstring"""
import os
import string
import sys


__SCREAMING_SNAKE_CASE  :						Optional[int]    							=      1 << 8

__SCREAMING_SNAKE_CASE  :						Optional[Any]    							=      {
    '''tab''': ord('''\t'''),
    '''newline''': ord('''\r'''),
    '''esc''': 2_7,
    '''up''': 6_5 + ARROW_KEY_FLAG,
    '''down''': 6_6 + ARROW_KEY_FLAG,
    '''right''': 6_7 + ARROW_KEY_FLAG,
    '''left''': 6_8 + ARROW_KEY_FLAG,
    '''mod_int''': 9_1,
    '''undefined''': sys.maxsize,
    '''interrupt''': 3,
    '''insert''': 5_0,
    '''delete''': 5_1,
    '''pg_up''': 5_3,
    '''pg_down''': 5_4,
}

__SCREAMING_SNAKE_CASE  :						List[str]    							=      KEYMAP['''up''']
__SCREAMING_SNAKE_CASE  :						str    							=      KEYMAP['''left''']

if sys.platform == "win32":
			__SCREAMING_SNAKE_CASE  :						Union[str, Any]    							=      []
			__SCREAMING_SNAKE_CASE  :						List[str]    							=      {
			    B'''\xe0H''': KEYMAP['''up'''] - ARROW_KEY_FLAG,
			    B'''\x00H''': KEYMAP['''up'''] - ARROW_KEY_FLAG,
			    B'''\xe0P''': KEYMAP['''down'''] - ARROW_KEY_FLAG,
			    B'''\x00P''': KEYMAP['''down'''] - ARROW_KEY_FLAG,
			    B'''\xe0M''': KEYMAP['''right'''] - ARROW_KEY_FLAG,
			    B'''\x00M''': KEYMAP['''right'''] - ARROW_KEY_FLAG,
			    B'''\xe0K''': KEYMAP['''left'''] - ARROW_KEY_FLAG,
			    B'''\x00K''': KEYMAP['''left'''] - ARROW_KEY_FLAG,
			}

for i in range(1_0):
			__SCREAMING_SNAKE_CASE  :						Tuple    							=      ord(str(i))



def        lowerCAmelCase_(   )	->       str:
				if os.name == "nt":
								import msvcrt

								_lowerCamelCase        =				'''mbcs'''
								# Flush the keyboard buffer
								while msvcrt.kbhit():
												msvcrt.getch()
								if len(lowercase_							) == 0:
												# Read the keystroke
												_lowerCamelCase        =				msvcrt.getch()

												# If it is a prefix char, get second part
												if ch in (b"\x00", b"\xe0"):
																_lowerCamelCase        =				ch + msvcrt.getch()
																# Translate actual Win chars to bullet char types
																try:
																				_lowerCamelCase        =				chr(WIN_KEYMAP[cha]							)
																				WIN_CH_BUFFER.append(chr(KEYMAP['''mod_int''']							)							)
																				WIN_CH_BUFFER.append(lowercase_							)
																				if ord(lowercase_							) in (
																				    KEYMAP["insert"] - 1 << 9,
																				    KEYMAP["delete"] - 1 << 9,
																				    KEYMAP["pg_up"] - 1 << 9,
																				    KEYMAP["pg_down"] - 1 << 9,
																				):
																								WIN_CH_BUFFER.append(chr(1_26							)							)
																				_lowerCamelCase        =				chr(KEYMAP['''esc''']							)
																except KeyError:
																				_lowerCamelCase        =				cha[1]
												else:
																_lowerCamelCase        =				ch.decode(lowercase_							)
								else:
												_lowerCamelCase        =				WIN_CH_BUFFER.pop(0							)
				elif os.name == "posix":
								import termios
								import tty

								_lowerCamelCase        =				sys.stdin.fileno()
								_lowerCamelCase        =				termios.tcgetattr(lowercase_							)
								try:
												tty.setraw(lowercase_							)
												_lowerCamelCase        =				sys.stdin.read(1							)
								finally:
												termios.tcsetattr(lowercase_						,   termios.TCSADRAIN						,   lowercase_							)
				return ch




def        lowerCAmelCase_(   )	->       List[str]:
				_lowerCamelCase        =				get_raw_chars()
				if ord(lowercase_							) in [KEYMAP["interrupt"], KEYMAP["newline"]]:
								return char

				elif ord(lowercase_							) == KEYMAP["esc"]:
								_lowerCamelCase        =				get_raw_chars()
								if ord(lowercase_							) == KEYMAP["mod_int"]:
												_lowerCamelCase        =				get_raw_chars()
												if ord(lowercase_							) >= KEYMAP["arrow_begin"] - ARROW_KEY_FLAG and ord(lowercase_							) <= KEYMAP["arrow_end"] - ARROW_KEY_FLAG:
																return chr(ord(lowercase_							) + ARROW_KEY_FLAG							)
												else:
																return KEYMAP["undefined"]
								else:
												return get_raw_chars()

				else:
								if char in string.printable:
												return char
								else:
												return KEYMAP["undefined"]





"""simple docstring"""
from typing import Any


class 							lowerCamelCase_:





					'''simple docstring'''



					def __init__(    self				,       lowerCamelCase__   ):
									_lowerCamelCase        =				data
									_lowerCamelCase        =				None


class 							lowerCamelCase_:





					'''simple docstring'''



					def __init__(    self   ):
									_lowerCamelCase        =				None

					def 			snake_case__      (    self   ):
									_lowerCamelCase        =				self.head
									while temp is not None:
													print(temp.data				,       end=''' '''   )
													_lowerCamelCase        =				temp.next
									print()

					def 			snake_case__      (    self				,       lowerCamelCase__   ):
									_lowerCamelCase        =				Node(lowerCamelCase__   )
									_lowerCamelCase        =				self.head
									_lowerCamelCase        =				new_node





					def 			snake_case__      (    self				,       lowerCamelCase__				,       lowerCamelCase__   ):
									if node_data_a == node_data_a:
													return
									else:
													_lowerCamelCase        =				self.head
													while node_a is not None and node_a.data != node_data_a:
																	_lowerCamelCase        =				node_a.next

													_lowerCamelCase        =				self.head
													while node_a is not None and node_a.data != node_data_a:
																	_lowerCamelCase        =				node_a.next

													if node_a is None or node_a is None:
																	return

													_lowerCamelCase  ,     _lowerCamelCase        =				node_a.data, node_a.data


if __name__ == "__main__":
			__SCREAMING_SNAKE_CASE  :						List[Any]    							=      LinkedList()
			for i in range(5, 0, -1):
						ll.push(i)

			ll.print_list()

			ll.swap_nodes(1, 4)
			print('''After swapping''')
			ll.print_list()
