#!/usr/bin/python3

def sequence_processing(seq):
	if len(seq) != 18:
		print("H akolouthia {seq} prepei na exei akribws 18 xarakthres!")
		return

	print(f"h akolouthia xarakthrwn: {seq}")
	print(f"(a) oi prwtoi 6 xarakthres: {seq[:6]}")
	print(f"(b) oi teleutaioi 5 xarakthres: {seq[-5:]}")
	print(f"(c) kathe deuteros xarakthras apo th thesh 3: {seq[2::2]}")
	print(f"(d) apo ton 2o apo to telos pros thn arxh: {seq[-2::-1]}")

	even = seq[::2]
	odd = seq[1::2]

	print(f"(e) arties + perittes theseis: {even + odd}")

def main():
	sequence = "AppliedMathematics"
	sequence_processing(sequence)
	print("\n ---------------------------------")
	general_seq = input("\n Dwse alfarhthmitiko 18 xarakthrwn: ")
	sequence_processing(general_seq)
if __name__ == "__main__":
	main()
