



from collections import deque





def 						__lowerCamelCase       (      __magic_name__	:  Any						):
							return input(__magic_name__						).strip().split(" "						)





def 						__lowerCamelCase       (      __magic_name__	:  int     , __magic_name__	:  int						):
							a__:       dict[int, list[int]]											={}
							for i in range(__magic_name__						):
														a__:       Dict											=[]

							for e in range(__magic_name__						):
														a__							,			a__:       Any											=(int(__magic_name__						) for i in _input(F"Edge {e + 1}: <node1> <node2> "						))
														graph[x].append(__magic_name__						)
							return graph





def 						__lowerCamelCase       (      __magic_name__	:  int     , __magic_name__	:  int						):
							a__:       dict[int, list[int]]											={}
							for i in range(__magic_name__						):
														a__:       Union[str, Any]											=[]

							for e in range(__magic_name__						):
														a__							,			a__:       int											=(int(__magic_name__						) for i in _input(F"Edge {e + 1}: <node1> <node2> "						))
														graph[x].append(__magic_name__						)
														graph[y].append(__magic_name__						)
							return graph





def 						__lowerCamelCase       (      __magic_name__	:  int     , __magic_name__	:  int						):
							a__:       dict[int, list[tuple[int, int]]]											={}
							for i in range(__magic_name__						):
														a__:       Dict											=[]

							for e in range(__magic_name__						):
														a__							,			a__							,			a__:       str											=(int(__magic_name__						) for i in _input(F"Edge {e + 1}: <node1> <node2> <weight> "						))
														graph[x].append((y, w)						)
														graph[y].append((x, w)						)
							return graph


if __name__ == "__main__":
		__UpperCAmelCase  ,							__UpperCAmelCase						  =     (int(i) for i in _input('''Number of nodes and edges: '''))

		__UpperCAmelCase						  =     int(
		    _input(
		        '''Press 1 or 2 or 3 \n'''
		        '''1. Unweighted directed \n'''
		        '''2. Unweighted undirected \n'''
		        '''3. Weighted undirected \n'''
		    )[0]
		)

		__UpperCAmelCase						  =     {
		    1: initialize_unweighted_directed_graph,
		    2: initialize_unweighted_undirected_graph,
		    3: initialize_weighted_undirected_graph,
		}[graph_choice](n, m)





def 						__lowerCamelCase       (      __magic_name__	:  List[Any]     , __magic_name__	:  int						):
							a__							,			a__:       Optional[Any]											={s}, [s]
							print(__magic_name__						)
							while _s:
														a__:       str											=0
														for i in g[_s[-1]]:
																					if i not in vis:
																												_s.append(__magic_name__						)
																												vis.add(__magic_name__						)
																												a__:       Union[str, Any]											=1
																												print(__magic_name__						)
																												break
														if not flag:
																					_s.pop()





def 						__lowerCamelCase       (      __magic_name__	:  Tuple     , __magic_name__	:  Union[str, Any]						):
							a__							,			a__:       Any											={s}, deque([s]						)
							print(__magic_name__						)
							while q:
														a__:       str											=q.popleft()
														for v in g[u]:
																					if v not in vis:
																												vis.add(__magic_name__						)
																												q.append(__magic_name__						)
																												print(__magic_name__						)





def 						__lowerCamelCase       (      __magic_name__	:  Optional[int]     , __magic_name__	:  str						):
							a__							,			a__							,			a__:       List[str]											={s: 0}, set(), {s: 0}
							while True:
														if len(__magic_name__						) == len(__magic_name__						) - 1:
																					break
														a__:       str											=100_000
														for i in dist:
																					if i not in known and dist[i] < mini:
																												a__:       int											=dist[i]
																												a__:       str											=i
														known.add(__magic_name__						)
														for v in g[u]:
																					if v[0] not in known and dist[u] + v[1] < dist.get(v[0]     , 100_000						):
																												a__:       Dict											=dist[u] + v[1]
																												a__:       List[str]											=u
							for i in dist:
														if i != s:
																					print(dist[i]						)





def 						__lowerCamelCase       (      __magic_name__	:  Union[str, Any]     , __magic_name__	:  Optional[int]=None     , __magic_name__	:  List[str]=None						):
							if q is None:
														a__:       str											=[1]
							if ind is None:
														a__:       int											=[0] * (len(__magic_name__						) + 1)  # SInce oth Index is ignored
														for u in g:
																					for v in g[u]:
																												ind[v] += 1
														a__:       Optional[int]											=deque()
														for i in g:
																					if ind[i] == 0:
																												q.append(__magic_name__						)
							if len(__magic_name__						) == 0:
														return
							a__:       Any											=q.popleft()
							print(__magic_name__						)
							for w in g[v]:
														ind[w] -= 1
														if ind[w] == 0:
																					q.append(__magic_name__						)
							topo(__magic_name__     , __magic_name__     , __magic_name__						)





def 						__lowerCamelCase       (      ):
							a__:       int											=input().strip()
							a__:       Optional[int]											=[]
							for _ in range(__magic_name__						):
														a.append(map(__magic_name__     , input().strip().split()						)						)
							return a, n





def 						__lowerCamelCase       (      __magic_name__	:  List[str]						):
							((a__)							,			(a__)):       List[Any]											=a_and_n
							a__:       Union[str, Any]											=list(__magic_name__						)
							a__:       Any											=[[0] * n for i in range(__magic_name__						)]
							for k in range(__magic_name__						):
														for i in range(__magic_name__						):
																					for j in range(__magic_name__						):
																												if dist[i][j] > dist[i][k] + dist[k][j]:
																																			a__:       List[str]											=dist[i][k] + dist[k][j]
																																			a__:       Tuple											=k
							print(__magic_name__						)





def 						__lowerCamelCase       (      __magic_name__	:  Tuple     , __magic_name__	:  Any						):
							a__							,			a__							,			a__:       Union[str, Any]											={s: 0}, set(), {s: 0}
							while True:
														if len(__magic_name__						) == len(__magic_name__						) - 1:
																					break
														a__:       Optional[int]											=100_000
														for i in dist:
																					if i not in known and dist[i] < mini:
																												a__:       Dict											=dist[i]
																												a__:       int											=i
														known.add(__magic_name__						)
														for v in g[u]:
																					if v[0] not in known and v[1] < dist.get(v[0]     , 100_000						):
																												a__:       Tuple											=v[1]
																												a__:       Dict											=u
							return dist





def 						__lowerCamelCase       (      ):
							a__							,			a__:       List[str]											=map(__magic_name__     , input().split(" "						)						)
							a__:       str											=[]
							for _ in range(__magic_name__						):
														edges.append(map(__magic_name__     , input().split(" "						)						)						)
							return edges, n





def 						__lowerCamelCase       (      __magic_name__	:  Optional[int]						):
							# Sort edges on the basis of distance
							((a__)							,			(a__)):       List[str]											=e_and_n
							e.sort(reverse=__magic_name__     , key=lambda __magic_name__						: x[2]						)
							a__:       Tuple											=[{i} for i in range(1     , n + 1						)]
							while True:
														if len(__magic_name__						) == 1:
																					break
														print(__magic_name__						)
														a__:       int											=e.pop()
														for i in range(len(__magic_name__						)						):
																					if x[0] in s[i]:
																												break
														for j in range(len(__magic_name__						)						):
																					if x[1] in s[j]:
																												if i == j:
																																			break
																												s[j].update(s[i]						)
																												s.pop(__magic_name__						)
																												break







def 						__lowerCamelCase       (      __magic_name__	:  Any						):
							a__:       Union[str, Any]											=[]
							for node in graph:
														if not graph[node]:
																					isolated.append(__magic_name__						)
							return isolated










def 						__lowerCamelCase       (      __magic_name__	:  list     , __magic_name__	:  int						):
							for index, item in enumerate(__magic_name__						):
														if item == target:
																					return index
							return -1





def 						__lowerCamelCase       (      __magic_name__	:  list     , __magic_name__	:  int     , __magic_name__	:  int     , __magic_name__	:  int						):
							if not (0 <= high < len(__magic_name__						) and 0 <= low < len(__magic_name__						)):
														raise Exception("Invalid upper or lower bound!"						)
							if high < low:
														return -1
							if sequence[low] == target:
														return low
							if sequence[high] == target:
														return high
							return rec_linear_search(__magic_name__     , low + 1     , high - 1     , __magic_name__						)


if __name__ == "__main__":
		__UpperCAmelCase						  =     input('''Enter numbers separated by comma:\n''').strip()
		__UpperCAmelCase						  =     [int(item.strip()) for item in user_input.split(''',''')]

		__UpperCAmelCase						  =     int(input('''Enter a single number to be found in the list:\n''').strip())
		__UpperCAmelCase						  =     linear_search(sequence, target)
		if result != -1:
				print(f"""linear_search({sequence}, {target}) = {result}""")
		else:
				print(f"""{target} was not found in {sequence}""")





