You are on your way to attend Lab 5 of Introduction to Programming 2, and you saw a cat on the side of the road.

It noticed that you are late, and started singing to taunt you:
"Hachimi Chimichi, Ashiga Ga Ashi, MAMBOW! MAMBOW! MA-MAMBOOO, ting ting tung tung ting ting ting ting tung tung ting, HAAAAAAACHIMIIIIIII..."
You are furious, and decided to have a battle with the Hachimi cat. You take out your backpack, randomly pick up things and start throwing them at the cat. Each item hits differently — and some have special effects.
Each item has a use() which first calls damage(), then applies its effect. damage() checks if weight > defense — if so, it deals weight - defense damage to HP, otherwise it is blocked. The effect always applies after damage(), regardless of whether the hit was blocked. The battle ends early if Hachimi's HP reaches 0.
ID 0 — Laptop(int weight, int power) HP is lowered by power.
ID 1 — Notebook(int weight, int notes) Hachimi is scared of knowledge — defense is lowered by notes.
ID 2 — GPU(int weight) Hachimi feels heartbroken seeing an expensive GPU smashed — HP is lowered by current defense.
ID 3 — Shoe(int weight, int smell) The stench is unbearable — both HP and defense are reduced by smell.
Implement the constructor and use() for each derived class, as well as damage() on the base class Item. HP and defense cannot go below 0.
The constraints are as follows: 1 ≤ hp ≤ 1000, 1 ≤ defense ≤ 100, 1 ≤ n ≤ 50, 1 ≤ weight ≤ 50, 1 ≤ power ≤ 30, 1 ≤ notes ≤ 20, 1 ≤ smell ≤ 100.
The first line contains hp, defense, and n. The following n lines each contain an item ID followed by its arguments.
For each item, print the class name followed by hit or blocked, then on the next line print HP: <hp>, Defense: <defense>. Stop if Hachimi's HP reaches 0.
100 10 7
0 15 20 // Laptop, weight=15, power=20
1 12 4 // Notebook, weight=12, notes=4
2 20 // GPU, weight=20
1 5 3 // Notebook, weight=5 — blocked since weight < defense
3 18 5 // Shoe, weight=18, smell=5
0 20 30 // Laptop, weight=20, power=30 — Hachimi dies here
2 7 // GPU — never reached
Laptop hit
HP: 75, Defense: 10
Notebook hit
HP: 73, Defense: 6
GPU hit
HP: 53, Defense: 6
Notebook blocked
HP: 53, Defense: 3
Shoe hit
HP: 33, Defense: 0
Laptop hit
HP: 0, Defense: 0