Engineering
As new students begin to arrive at college, each receives a unique ID number, 1 ton. Initially, the students do not know one another, and each has a different circle of friends. As the semester progresses, other groups of friends begin to form randomly. There will be three arrays, each aligned by an index. The first array will contain a queryType which will be either Friend or Total. The next two arrays, students1 and students2, will each contain a student ID. If the query type is Friend, the two students become friends. If the query type is Total, report the sum of the sizes of each group of friends for the two students. Examplen=4queryType = ['Friend', 'Friend', 'Total'] student1=[1,2,1]student2=[2,3,4]The queries are assembled, aligned by index: Input from stdin will be processed and passed to the function as follows: The first line contains an integern, the number of students. The next line contains an integerq, the number of queries. Each of the nextqlines contains a string queryType[i] where1iq. The next line contains an integerq, the number of queries. Each of the nextqlines contains a string students1[i] where1iq. The next line contains an integerq, the number of queries. Each of the nextqlines contains a string students2[i] where1iq. Sample Case 0 Sample Input 0 STDIN 032 Friend query = [Friend, Tota Total 21222 Function 0.0n=3 queryType [ ] size q=2 students 1[] size q=2 students 1=[1,2] students 2[] size q=2 students2 =[2,3] Sample Output 0 3 Fynlanation 0