# Report for Jaspal
[Jaspal](http://www.jaspal.com/) is fashion group with more than 300 stores over the Thailand. They are looking for business intelligent software to generate report/dashboard which able to monitor the number of visitors by different time/date and compare with different stores. The exported excel profile need to be customized for their desired format include date/stores no/counting data so they can import to their current marketing software.
As a developer of [NUUO Inc.](http://www.nuuo.com/), your task is writting a program to fulfill custom's request. Your project manager, Jay, has updated all the details about the project on [Trello](https://trello.com/c/QH8RRQJ2), please check.
- 據相同 Server Name、相同時間,將不同 Counter 之數據加總。
- 注意:時間有兩種格式:時間區間 (起始 to 結束) 與 時間點,時間區間之數據算入結束時間。
- 輸出格式先以時間由早至晚排序,後以 Server Name 依字母順序排序。
請挑戰寫出易讀易懂好維護的程式碼。 (別因為寫不出好看的扣而放棄!! :DD
## Input
Plaintext in CSV format exported from Mainconsole Report Service.
## Output
Plaintext in CSV format follow the format asked by the customer.
## Sample Input
```
Table 1
Datetime,2017/11/30 00:00:00 - 2017/11/30 14:00:00
Server Name,Service Name,Device Name,Counter Name,2017/11/30 00:00 to 01:00,2017/11/30 01:00 to 02:00,2017/11/30 02:00 to 03:00,2017/11/30 03:00 to 04:00,2017/11/30 04:00 to 05:00,2017/11/30 05:00 to 06:00,2017/11/30 06:00 to 07:00,2017/11/30 07:00 to 08:00,2017/11/30 08:00 to 09:00,2017/11/30 09:00 to 10:00,2017/11/30 10:00 to 11:00,2017/11/30 11:00 to 12:00,2017/11/30 12:00 to 13:00,2017/11/30 13:00 to 14:00,Total
Host A,7788,CH01,Door 1,0,0,0,0,0,3,5,8,13,21,32,48,64,72,266
Host A,2266,CH02,Door 2,0,1,0,1,0,0,1,3,5,7,9,10,10,20,67
Host A,3388,CH02,Door 3,1,0,0,1,0,0,1,2,4,8,8,6,4,2,37
Host B,1122,CH01,Gate A,1,0,1,0,1,0,10,10,20,20,100,100,50,0,313
Host B,3344,CH02,Gate B,0,1,0,1,0,0,20,20,10,10,200,300,50,50,662
,,,Total,2,2,1,3,1,3,37,43,52,66,349,464,178,144,1345
Table 2
Datetime,2017/11/30 00:00:00 - 2017/11/30 14:00:00
Server Name,Service Name,Device Name,Counter Name,2017/11/30 01:00,2017/11/30 02:00,2017/11/30 03:00,2017/11/30 04:00,2017/11/30 05:00,2017/11/30 06:00,2017/11/30 07:00,2017/11/30 08:00,2017/11/30 09:00,2017/11/30 10:00,2017/11/30 11:00,2017/11/30 12:00,2017/11/30 13:00,2017/11/30 14:00,Total
Host C,1077,CH11,Door 4,0,1,0,2,0,3,0,4,0,5,0,6,0,7,28
Host C,1088,CH12,Door 5,1,0,2,0,3,0,4,0,5,0,6,0,7,0,28
Host C,1099,CH13,Door 6,1,1,0,0,2,2,0,0,3,3,0,0,4,4,20
Host B,5566,CH14,Door 7,0,0,-1,1,0,0,-2,2,0,0,3,-3,0,0,0
Host A,7788,CH15,Door 8,-1,1,-2,-3,-4,4,-5,-6,-7,7,-8,8,9,-9,-16
,,,Total,1,3,-1,0,1,9,-3,0,1,15,1,11,20,2,60
Table 3
Datetime,2017/11/30 00:00:00 - 2017/11/30 14:00:00
Server Name,Service Name,Device Name,Counter Name,2017/11/30 00:00 to 01:00,2017/11/30 01:00 to 02:00,2017/11/30 02:00 to 03:00,2017/11/30 03:00 to 04:00,2017/11/30 04:00 to 05:00,2017/11/30 05:00 to 06:00,2017/11/30 06:00 to 07:00,2017/11/30 07:00 to 08:00,2017/11/30 08:00 to 09:00,2017/11/30 09:00 to 10:00,2017/11/30 10:00 to 11:00,2017/11/30 12:00,2017/11/30 13:00,2017/11/30 13:00 to 14:00,Total
Host A,2011,CH21,Gate P,1,2,3,4,5,6,7,8,9,10,11,12,13,14,105
Host B,2022,CH22,Gate Q,2,3,4,5,6,7,8,9,10,11,12,13,14,15,119
Host C,2033,CH23,Gate R,3,4,5,6,7,8,9,10,11,12,13,14,15,16,133
Host D,2044,CH24,Gate S,4,5,6,7,8,9,10,11,12,13,14,15,16,17,147
,,,Total,10,14,18,22,26,30,34,38,42,46,50,54,58,62,504
```
## Sample Output
```
Datetime,Branch Code,In
11-30-17 01:00,Host A,1
11-30-17 01:00,Host B,3
11-30-17 01:00,Host C,5
11-30-17 01:00,Host D,4
11-30-17 02:00,Host A,4
11-30-17 02:00,Host B,4
11-30-17 02:00,Host C,6
11-30-17 02:00,Host D,5
11-30-17 03:00,Host A,1
11-30-17 03:00,Host B,4
11-30-17 03:00,Host C,7
11-30-17 03:00,Host D,6
11-30-17 04:00,Host A,3
11-30-17 04:00,Host B,7
11-30-17 04:00,Host C,8
11-30-17 04:00,Host D,7
11-30-17 05:00,Host A,1
11-30-17 05:00,Host B,7
11-30-17 05:00,Host C,12
11-30-17 05:00,Host D,8
11-30-17 06:00,Host A,13
11-30-17 06:00,Host B,7
11-30-17 06:00,Host C,13
11-30-17 06:00,Host D,9
11-30-17 07:00,Host A,9
11-30-17 07:00,Host B,36
11-30-17 07:00,Host C,13
11-30-17 07:00,Host D,10
11-30-17 08:00,Host A,15
11-30-17 08:00,Host B,41
11-30-17 08:00,Host C,14
11-30-17 08:00,Host D,11
11-30-17 09:00,Host A,24
11-30-17 09:00,Host B,40
11-30-17 09:00,Host C,19
11-30-17 09:00,Host D,12
11-30-17 10:00,Host A,53
11-30-17 10:00,Host B,41
11-30-17 10:00,Host C,20
11-30-17 10:00,Host D,13
11-30-17 11:00,Host A,52
11-30-17 11:00,Host B,315
11-30-17 11:00,Host C,19
11-30-17 11:00,Host D,14
11-30-17 12:00,Host A,84
11-30-17 12:00,Host B,410
11-30-17 12:00,Host C,20
11-30-17 12:00,Host D,15
11-30-17 13:00,Host A,100
11-30-17 13:00,Host B,114
11-30-17 13:00,Host C,26
11-30-17 13:00,Host D,16
11-30-17 14:00,Host A,99
11-30-17 14:00,Host B,65
11-30-17 14:00,Host C,27
11-30-17 14:00,Host D,17
```