#include <stdio.h>
#include <string.h>

struct Employee {
    char name[50];
    int id;
    int type; // 1 for full-time, 2 for part-time
    union {
        int full_time_salary;
        float part_time_rate;
    } pay;
};

int main() {
    int n;
    scanf("%d", &n);

    if (n < 0) {
        printf("-1\n");
        return 0;
    }

    struct Employee emp[10]; // max 10 as per constraints
    float total_salary = 0;

    for (int i = 0; i < n; i++) {
        scanf("%s %d %d", emp[i].name, &emp[i].id, &emp[i].type);
        if (emp[i].