function setName(record){
var nameDict ={};
for(var i=0;i<record.length;i++){
if(record[i][0]!=='L'){
var temp = record[i].split(' ');
nameDict[temp[1]] = temp[2];
}
}
return nameDict;
}
function makeLog(record, nameDict){
var log = [];
for(var i=0;i<record.length;i++){
if(record[i][0]==='E'){
log.push(nameDict[record[i].split(' ')[1]]+"님이 들어왔습니다.") // temp[1] : ID
}else if(record[i][0]==='L'){
log.push(nameDict[record[i].split(' ')[1]]+"님이 나갔습니다.")
}
}
return log;
}
function solution(record) {
return makeLog(record, setName(record));
}