Lili has a company, so it has a lot of employees. However, many of Lili employees have changed, resigned, and retired, causing the database that Lili has not synchronized properly. For that reason,...


Lili has a company, so it has a lot of employees.
However, many of Lili employees have changed, resigned, and retired, causing the database
that Lili has not synchronized properly. For that reason, Lili asks for your help to help
her make a list of Lili employees.
Each employee has 3 attributes:
• Name (max 20 character)
• Gender (Laki-laki / Perempuan)
• Division (Management / Accounting / HRD)
There are several things you can do on the Lili database :
1. Add Employee
In the add employee feature, the new employee will be after the old employee (if
all positions are full). Because Lili does not like to have employees who have the
same name, if there are employees who have the same name, the employee will not
be accepted to work at Lili’s company. New employees will always fill the leftmost
places in the database to get a large salary.
2. Change Position
The employee’s position determines the employee’s salary, if the employee is in the
first position, then the employee’s salary is the highest among all other employees.
(The position to be exchanged cannot be empty)
3. Resign
To resign, the employee will be deleted from the database, and the position of this
employee will be left blank (Can be used again).
4. Retire
When an employee retires, the employee’s place and position will be saved and may
not be used by other employees, because it is considered that the employee has
contributed to Lili’s company.
At the end of the year, Lili wants to know the name of every employee who is still active
in her company. Help Lili manage the database.



Format Input

The first line consists of N, the number of processes to be performed. The next N lines
represent the process to be carried out.
1. For the 1st process, the input consists of 4 lines (with 4 integers) - the process
number, name, gender, and division.
2. For the 2nd process, the input consists of 3 integers - the process number, Employee
1 index, Employee 2 index.
3. For the 3rd process, the input consists of 2 integers - the process number and the
index of the employee who will resign.
4. For the 4th process, the input consists of 2 integers - the process number and the
index of the employee who will retire.





Format Output

The output consists of X lines, where X is the number of employees that still work at
Lili’s company.





Constraints

• 1 ≤ N ≤ 100
• 1 ≤ |N ame|, |Gender|, |Division| ≤ 20





Sample Input (standard input)

7


1
Jojo
Laki - laki
HRD
1
Lili
Perempuan
Management
1
Bibi
Perempuan
Accounting
2 1 2
3 2
4 1
1
Joli
Laki - laki
HRD



Sample Output (standard output)

Joli
Bibi





Note

The input is ensured to be valid with constraint so there is no need to validate it again.
If there are queries that don’t match with the condition, the queries can be ignored.

Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here