PROGRAMMING:Statistical problems of academic conference venue hebust
Statistical problems of academic conference places
The Secretary counted the attendance of Professor Zhang [hereinafter referred to as Z] and Professor Wang [hereinafter referred to as w] at the academic conference last year. The detailed itinerary list of professors is as follows:
z:bj 3,hz 2,qd 4,nj 5,wh 3,bj 3
w:hn 7,xm 6,bj 4,gz 6,wh 4
Now the secretary needs to complete the following statistical work.
Find out the cities that the two professors have visited together, and find out the professors who have stayed for a long time, and output them in the following format:
z:bj 6,w:wh 4
Please write code to help.
###Input format:
Fixed to 2 lines
[data description] before the colon is the abbreviation of the professor, after the colon is the details of the meeting, the group is separated by spaces, the left is the abbreviation of the city location, the right is the days of stay, and multiple groups are separated by commas [the above characters are all in western language] (the test data has been specially processed, and there is no case that the cities they have been to have the same days together)
###Output format:
Fixed to 1 line
It consists of 0 or more records in the following format:
Professor abbreviation colon City abbreviation space days
Multiple records are separated by commas, and there is no comma at the end of the last record
If there are 0 records, output none
[output order description] the output is sorted in ascending order according to the abbreviation of city location
[description of output content] if there are no cities we have visited together, the output is none, with no spaces on both sides
###Input example:
Here is a set of inputs. For example:
```in
z:bj 3,hz 2,qd 4,nj 5,wh 3,bj 3
w:hn 7,xm 6,bj 4,gz 6,wh 4
```
###Output example:
The corresponding output is given here. For example:
```out
z:bj 6,w:wh 4
```
answer:If there is no answer, please comment
The Secretary counted the attendance of Professor Zhang [hereinafter referred to as Z] and Professor Wang [hereinafter referred to as w] at the academic conference last year. The detailed itinerary list of professors is as follows:
z:bj 3,hz 2,qd 4,nj 5,wh 3,bj 3
w:hn 7,xm 6,bj 4,gz 6,wh 4
Now the secretary needs to complete the following statistical work.
Find out the cities that the two professors have visited together, and find out the professors who have stayed for a long time, and output them in the following format:
z:bj 6,w:wh 4
Please write code to help.
###Input format:
Fixed to 2 lines
[data description] before the colon is the abbreviation of the professor, after the colon is the details of the meeting, the group is separated by spaces, the left is the abbreviation of the city location, the right is the days of stay, and multiple groups are separated by commas [the above characters are all in western language] (the test data has been specially processed, and there is no case that the cities they have been to have the same days together)
###Output format:
Fixed to 1 line
It consists of 0 or more records in the following format:
Professor abbreviation colon City abbreviation space days
Multiple records are separated by commas, and there is no comma at the end of the last record
If there are 0 records, output none
[output order description] the output is sorted in ascending order according to the abbreviation of city location
[description of output content] if there are no cities we have visited together, the output is none, with no spaces on both sides
###Input example:
Here is a set of inputs. For example:
```in
z:bj 3,hz 2,qd 4,nj 5,wh 3,bj 3
w:hn 7,xm 6,bj 4,gz 6,wh 4
```
###Output example:
The corresponding output is given here. For example:
```out
z:bj 6,w:wh 4
```
answer:If there is no answer, please comment