Problem Description
Alex is a big fan of basketball and he enjoys watching NBA matches. But as he always has classes in the morning when the game is on, he has to read literal living broadcast with his cellphone instead of TV live. The living broadcast gives messages about who scores or who gets the rebound, etc. After watching a few games with his cellphone, Alex finds a problem. After each game, he wants to know the status of the players (score, rebound…) but the system always fails to give. So Alex decides to calculate himself. Can you help him? If one of your teammates is a crazy basketball fan, you should make him solve this problem because he will find it interesting while working on this problem.

Input
The first line of input contains an integer t (t<=10) indicate the number of cases.

In each case, the first line contains the names of the two teams in the form of "A vs B", where A stands for the name of home team and B stands for the name of away team. The following 12 lines contain the name of the players play for the home team and another 12 lines contain the name of the players play for the away team. The first five players of each team will be the starters meaning they are on court when the game starts. All the names only contain letters from 'a' to 'z' and 'A' to 'Z' and ''' without space and the length of each name is no more than 20. All the players' names in one case will be different.

Then a line contains an integer n (2<=n<=500) indicates the number of the messages given by the broadcast.

The next n lines contain the messages, one message per line. The first line will always contain "Begin" and the last line will always contain "End". The game won't end during a shot or free throw, but may end at any other time. A message in other lines may be one of the following (x, x1 and x2 stand for players from the teams, m and M stand for numbers):

Jump Ball x1 vs x2: this message will only be given on the second line right after "Begin". This means two players from different teams are jumping for the ball. This message will always be followed by "x Hold Ball" and x could be anyone.

x Hold Ball: this message will be given if the ball is currently in no one's hand, which means: after jump ball or after a shot was made (including the last free throw) or after a shot was blocked or after timeout.

x1 Pass to x2: this means the ball is passed from x1 to x2. x1 is deferent from x2 and they are from the same team.

Layup/Slam Dunk/Hook Shot/Jump Shot/3pt Shot: the first four messages stand for an attempt for 2-point shot while the last message stand for an attempt for 3-point shot. These messages will only be given when someone is currently holding the ball. These messages may be followed by "Made"/"Missed"/"Blocked by x"/"x Foul".

Made/Missed: If a shot was made and scored, "Made" will be given, otherwise "Missed". These two messages will be given right after a shot was attempted if the shot was not fouled or blocked. If the shot was fouled, these two messages will still be given right after "x Foul" to indicate whether the shot was made even with the foul. But if a shot was blocked, these messages will not be given since the shot is definitely missed.

x Rebound: If a shot was missed, this message will be given to indicate who get the rebound (could be anyone from both teams). If someone gets the rebound, he holds the ball.

Blocked by x: If a shot is blocked, this message will be given right after the message which indicates the shot. This message will always be followed by "x Hold Ball" and x could be anyone. A shot will only be blocked by a player from the opposite team with the shooter.

x Foul: this message will be given when a player commit a foul to another player from the opposite team. There are two kind of foul. If this message is given right after the shot attempt, then this foul will lead to free throws. Otherwise this message will be followed by "x Hold Ball".

Free Throw m of M: If a shot is fouled, the shooter will make free throws. If the fouled shot is made, then the shooter will only make one free throw. If it's missed and it's a 2-point shot, the shooter will make two free throws. If it's missed and it's a 3-point shot, the shooter will make three free throws. Each made free throw earns one point. In this message, m indicates the number of this free throw (start from 1) and M indicates the number of total free throws this player is going to attempt. Both m and M will be no bigger than 3 and m is no bigger than M. After each free throw there will be a message says "Made" or "Missed" to indicate whether the free throw is made or missed. If the last free throw is missed, just like normal shot, someone will get the rebound and if it's made, a player from the opposite team will hold the ball. No block could be made during the free throws.

x Steal: If a player is now holding the ball, a player from the opposite team could steal the ball away. If someone steals the ball, he will hold it.

x1 Substitution replaced by x2: this message means x1 is off court and replaced by x2. x1 and x2 are from the same team. This could only happen during timeout or before free throw or after a foul which doesn't lead to free throw. The player who is going to make a free throw won't be replaced. Before free throw means before any "Free Throw m of M" despite of m and M.

Timeout: timeout could be called when someone is holding the ball. During timeout, substitution could be made. Timeout is ended with the message "x Hold Ball".

It is guaranteed that all the messages are valid and follow the rules. The names of the players will not be the same with words like "rebound" and "block", etc. Actually all the names will be familiar to you if you watch NBA a lot.

Output
The first output line for each case will be "x1 n1-n2 x2", where x1 and x2 stand for the name of home team and away team and n1 and n2 stand for their total points.

Then for each player from each team, calculate the number of his points, rebounds (including offensive and defensive), assists, steals, blocks and fouls. An assist is made when player x1 passes to player x2 and x2 makes a shot (2-pt or 3-pt) and then x1 gets the assist. A rebound is an offensive rebound when the shoot and the player who gets the rebound are from the same team (even the same player); otherwise it's a defensive rebound. Also you have to calculate the number of a player's made field goals (including 2-pt and 3-pt), attempted field goals (including 2-pt and 3-pt), made 3-pt shots, attempted 3-pt shots, made free throws and attempted free throws.

Notice: if a shot is fouled and it's missed, it won't be counted as an attempt, but if it's fouled and made, it will be counted as an attempt and a made.
The output form is shown in the sample output (PTS - points, OFF - offensive rebound, DEF - defensive rebound, REB - total rebound, AST - assist, STL - steal, BLK - block, PF - personal foul, FGM-A - field goal made and attempted, 3PM-A - 3-pt made and attempted, FTM-A - free throw made and attempted). There are 14 spaces before the word "PLAYER" and exact one space between each column. All the names and numbers are under their column and right alignment. The order of the players is the same with input. Home team first, then comes the away team. If a player didn't play at all (never on court), then you should print "DNP - Coach's Decision" 10 spaces after their names.

Print a single line after each case.

Sample Input
1
Lakers vs Celtics
DerekFisher
KobeBryant
RonArtest
PauGasol
AndrewBynum
LamarOdom
MattBarnes
SteveBlake
ShannonBrown
LukeWalton
DerrickCaracter
DevinEbanks
RajonRondo
RayAllen
PaulPierce
KevinGarnett
ShaquilleO'Neal
JeffGreen
VonWafer
GlenDavis
JermaineO'Neal
TroyMurphy
CarlosArroyo
17
Begin
Jump Ball KevinGarnett vs PauGasol
KobeBryant Hold Ball
KobeBryant Pass to PauGasol
Slam Dunk
RajonRondo Hold Ball
RajonRondo Pass to PaulPierce
Jump Shot
RonArtest Foul
Missed
Free Throw 1 of 2
Free Throw 2 of 2
Missed
PauGasol Rebound
End

Sample Output
Lakers 2-1 Celtics
Lakers
PLAYER PTS OFF DEF REB AST STL BLK PF FGM-A 3PM-A FTM-A
DerekFisher 0 0 0 0 0 0 0 0 0-0 0-0 0-0
KobeBryant 0 0 0 0 1 0 0 0 0-0 0-0 0-0
RonArtest 0 0 0 0 0 0 0 1 0-0 0-0 0-0
PauGasol 2 0 1 1 0 0 0 0 1-1 0-0 0-0
AndrewBynum 0 0 0 0 0 0 0 0 0-0 0-0 0-0
LamarOdom DNP - Coach's Decision
MattBarnes DNP - Coach's Decision
SteveBlake DNP - Coach's Decision
ShannonBrown DNP - Coach's Decision
LukeWalton DNP - Coach's Decision
DerrickCaracter DNP - Coach's Decision
DevinEbanks DNP - Coach's Decision
Celtics
PLAYER PTS OFF DEF REB AST STL BLK PF FGM-A 3PM-A FTM-A
RajonRondo 0 0 0 0 0 0 0 0 0-0 0-0 0-0
RayAllen 0 0 0 0 0 0 0 0 0-0 0-0 0-0
PaulPierce 1 0 0 0 0 0 0 0 0-0 0-0 1-2
KevinGarnett 0 0 0 0 0 0 0 0 0-0 0-0 0-0
ShaquilleO'Neal 0 0 0 0 0 0 0 0 0-0 0-0 0-0
JeffGreen DNP - Coach's Decision
VonWafer DNP - Coach's Decision
GlenDavis DNP - Coach's Decision
JermaineO'Neal DNP - Coach's Decision
TroyMurphy DNP - Coach's Decision
CarlosArroyo DNP - Coach's Decision

Java学习的正确打开方式

Python 植物大战僵尸代码实现(2):植物卡片选择和种植

【搞定 Java 并发面试】面试最常问的 Java 并发基础常见面试题总结！

2019年互联网寒冬，大批企业开始裁员，下图是网上流传的一张截图： 裁员不可避免，那如何才能做到不管大环境如何变化，自身不受影响呢？ 我们先来看一个有意思的故事，如果西游记取经团队需要裁员一名，会裁掉谁呢，为什么？ 西游记团队组成： 1.唐僧 作为团队teamleader，有很坚韧的品性和极高的原则性，不达目的不罢休，遇到任何问题，都没有退缩过，又很得上司支持和赏识(直接得到唐太宗的任命，既给
shell脚本：备份数据库、代码上线

iOS Bug 太多，苹果终于坐不住了！

《Neural Networks and Deep Learning》读书笔记第四篇本章其实和前面章节的关联性不大，所以大可将本章作为小短文来阅读，当然基本的深度学习基础还是要有的。主要介绍了神经⽹络拥有的⼀种普遍性，比如说不管目标函数是怎样的，神经网络总是能够对任何可能的输入，其值（或者说近似值）是网络的输出，哪怕是多输入和多输出也是如此，我们大可直接得出一个结论：不论我们想要计算什么样的函数，...

IntelliJ IDEA 简称 IDEA，被业界公认为最好的 Java 集成开发工具，尤其在智能代码助手、代码自动提示、代码重构、代码版本管理(Git、SVN、Maven)、单元测试、代码分析等方面有着亮眼的发挥。IDEA 产于捷克，开发人员以严谨著称的东欧程序员为主。IDEA 分为社区版和付费版两个版本。 我呢，一直是 Eclipse 的忠实粉丝，差不多十年的老用户了。很早就接触到了 IDEA...

Redis 面试题 1、什么是 Redis?. 2、Redis 的数据类型？ 3、使用 Redis 有哪些好处？ 4、Redis 相比 Memcached 有哪些优势？ 5、Memcache 与 Redis 的区别都有哪些？ 6、Redis 是单进程单线程的？ 7、一个字符串类型的值能存储最大容量是多少？ 8、Redis 的持久化机制是什么？各自的优缺点？ 9、Redis 常见性...

【超详细分析】关于三次握手与四次挥手面试官想考我们什么？

Vue快速实现通用表单验证

2019年Spring Boot面试都问了什么？快看看这22道面试题！
Spring Boot 面试题 1、什么是 Spring Boot？ 2、Spring Boot 有哪些优点？ 3、什么是 JavaConfig？ 4、如何重新加载 Spring Boot 上的更改，而无需重新启动服务器？ 5、Spring Boot 中的监视器是什么？ 6、如何在 Spring Boot 中禁用 Actuator 端点安全性？ 7、如何在自定义端口上运行 Sprin...
【图解】记一次手撕算法面试：字节跳动的面试官把我四连击了

【图解算法面试】记一次面试：说说游戏中的敏感词过滤是如何实现的？

GitHub 标星 1.6w+，我发现了一个宝藏项目，作为编程新手有福了！

java知识体系整理，学会了，月入过万不是梦

2020年去一线大厂面试先过SSM框架源码这一关！
SSM框架介绍 （1）持久层（Mybatis）：Dao层（mapper） DAO层：DAO层主要是做数据持久层的工作，负责与数据库进行联络的一些任务都封装在此。 DAO层的设计首先是设计DAO的接口。 然后在Spring的配置文件中定义此接口的实现类。 然后就可在模块中调用此接口来进行数据业务的处理，而不用关心此接口的具体实现类是哪个类，显得结构非常清晰。 DAO层的数据源配置，以及有...

Java程序员必备基础：内部类解析

Java9到Java13各版本新特性代码全部详解(全网独家原创)
Java现在已经发展到了Java13了（正式版本），相信很多朋友还对各个版本还不是很熟悉，这里面专门把Java9到Java13各个版本的一些新特性做了一些详细讲解。我在网上也找了很多，但基本都是官方文档的CV，没有任何代码演示，而且官方的示例代码也不是很好找得到，官方API目前还是Java10，官方文档真是坑啊。所以我在这里专门写了一篇文章，主要针对平时开发与有关的功能Java9到Java13各...

By 超神经场景描述：春节马上就要来临，在这个假期里，怎么能让自己放松，又不至于生疏了自己的老本行？不妨来玩一下编程向的小游戏吧，超神经在此整理了三款好玩有趣又有深度的游戏，快看看是不是...
2020年JVM面试题吐血整理【过年必看】
2B哥今天给大家带来点jvm相关的面试题，希望小伙伴们可以在春节这段时间好好复习下。看完这篇JVM面试基本没问题。95%内容都在在，更多的面试题可以关注公众号（微信搜：java2b） 1、内存模型以及分区，需要详细到每个区放什么。 JVM 分为堆区和栈区，还有方法区，初始化的对象放在堆里面，引用放在栈里面， class 类信息常量池（static 常量和 static 变量）等放在方法区 new...

CPU对每个程序员来说，是个既熟悉又陌生的东西？ 如果你只知道CPU是中央处理器的话，那可能对你并没有什么用，那么作为程序员的我们，必须要搞懂的就是CPU这家伙是如何运行的，尤其要搞懂它里面的寄存器是怎么一回事，因为这将让你从底层明白程序的运行机制。 随我一起，来好好认识下CPU这货吧 把CPU掰开来看 对于CPU来说，我们首先就要搞明白它是怎么回事，也就是它的内部构造，当然，CPU那么牛的一个东...
Python实战：抓肺炎疫情实时数据，画2019-nCoV疫情地图

Web前端开发高级前端技术（高级开发程序篇）
（给达达前端加星标，提升前端技能）内容有点多，也请你静下来，慢阅读，今后多多关照。说到web前端开发高级，必须要掌握的是HTML和css代码的优化，前端优化很重要，这是成功你进阶的道路上...