import json
V = [
("c0008","PART_OF",0,"medium","Kelana Puteri condo lies within SS7 Kelana Jaya; C is the section-level area row.",False),
("c0016","SAME",0,"high","Exact name, 61 m, psf 576 vs 577.",False),
("c0024","SAME",0,"medium","Exact name in Semenyih, 2 km, price 340k vs 315k.",False),
("c0032","SAME",0,"medium","Township name exact, also listed as Desa Aman Puri Apartment; C median mixes terraces.",False),
("c0040","SAME",0,"high","Seri Residensi in Sungai Kapar Indah = Taman Seri Residensi Kapar, 597 m, similar prices.",False),
("c0048","PART_OF",0,"high","C is phase 2 of Taman Nilam Sari, Seremban, 637 m away.",False),
("c0056","SAME",0,"high","Villa Sentosa Klang; psf 202 vs 186, price 170k vs 163k.",False),
("c0064","DIFFERENT",None,"medium","Taman Tanjung Minyak differs from Tanjong Minyak Jaya/Perdana; Bukit Rambai is only the locality.",False),
("c0072","SAME",0,"medium","Exact name in Kluang district, consistent prices; 30 km offset likely geocoding.",False),
("c0080","SAME",0,"high","C also listed as Taman Samudra, Batu Caves; price 832.5k vs 852.5k.",False),
("c0088","SAME",0,"high","Taman Juta Kuala Kubu Baru at 193 m; Juta Permai is another estate.",False),
("c0096","SAME",0,"high","Same name, 100 m, identical psf 437.",False),
("c0104","DIFFERENT",None,"medium","R is shops; C is detached houses 6 km away.",False),
("c0112","PART_OF",0,"low","Taman Sri Gadong sits within the Teluk Gadong locality row; no estate-level candidate.",False),
("c0120","SAME",0,"high","Exact name, psf 341 vs 347, price 1.45M vs 1.3M.",False),
("c0128","DIFFERENT",None,"high","R is shop lots (2.65M) in Taman Miharja; candidates are residential.",False),
("c0136","DIFFERENT",None,"high","R lies in East Malaysia; every candidate is over 1,600 km away.",False),
("c0144","DIFFERENT",None,"medium","Web: Taman Kenyalang 2 and Taman Kenyalang Indah are separate Kulim projects.",True),
("c0152","SAME",0,"low","Only Johor Taman Emas Permai; 9.8 km apart, no C price to confirm.",False),
("c0160","SAME",0,"high","Same name, 99 m, psf 617 vs 624.",False),
("c0168","DIFFERENT",None,"high","Oval Damansara offices vs The Oval KLCC condo; different place and type.",False),
("c0176","SAME",0,"high","Exact name, 139 m, price 400k vs 415k.",False),
("c0184","PART_OF",0,"high","Phase 6 of Taman Sialang, Tangkak; prices consistent.",False),
("c0192","DIFFERENT",None,"medium","C Petaling Garden is in PJ with 5.6M median; others differently named.",False),
("c0200","SAME",0,"low","Same township name, 889 m; C's flat/land mix gives very different prices.",False),
("c0208","DIFFERENT",None,"low","Same name but 19 km apart and price 670k vs 251k.",False),
("c0216","SAME",0,"medium","Township name exact; C1/C2 are blocks within it; township median mixes types.",False),
("c0224","PART_OF",0,"medium","Taman Jati / TR 56 section of Taman Sri Temiang (54 m); prices above whole estate.",False),
("c0232","SAME",0,"medium","Exact distinctive name in Klang; 9 km offset, no C price.",False),
("c0240","SAME",0,"medium","Kampung Dato Onn exact, JB, 1.6 km; C price is land-heavy.",False),
("c0248","SAME",0,"high","N-Park in Taman Utara, 157 m, distinctive name.",False),
("c0256","SAME",1,"medium","Name and mukim match Kota Damansara Section 9; R point misplaced near PJ Section 9.",False),
("c0264","SAME",0,"high","Same name Bukit Gedong, Bayan Lepas, 236 m.",False),
("c0272","DIFFERENT",None,"high","R is in Muar; candidates are in Sepang, Penang and Ayer Hitam.",False),
("c0280","SAME",0,"medium","Exact name in Banting; all Banting candidates ~11 km, so R point is offset.",False),
("c0288","SAME",1,"medium","Township name exact; price 465k matches terraces (480k), not the old flats.",False),
("c0296","DIFFERENT",None,"medium","Taman Meru low-cost phase III vs Meru Impian/Indah/Permai, separate estates.",False),
("c0304","DIFFERENT",None,"high","All Taman Wangi candidates are over 150 km away.",False),
("c0312","SAME",0,"high","Same name including its flat listing, psf 173 vs 178.",False),
("c0320","SAME",0,"high","Exact name, 76 m, price 430k vs 355k.",False),
("c0328","SAME",2,"high","Web: Pangsapuri Indah is Taman Air Tawar Indah's flat; 126 m, price 200k vs 205k.",True),
("c0336","SAME",0,"high","Azure Residences Kelana Jaya, 36 m, psf 741 vs 761.",False),
("c0344","DIFFERENT",None,"medium","Web: Sri Lalang and Sri Lalang Indah are distinct Kluang estates; Kota Tinggi one 76 km.",True),
("c0352","SAME",0,"high","Township exact, 125 m; C median includes apartments.",False),
("c0360","DIFFERENT",None,"low","Taman Senggarang Mewah differs from Taman Senggarang and Taman Sri Mewah.",False),
("c0368","DIFFERENT",None,"medium","Bayu Kemuning vs Kemuning Bayu/Utama Bayu; 4.8 km, prices 1.7-2.8x higher.",False),
("c0376","SAME",0,"high","Taman Emas, Mersing; low-cost, identical price 50k.",False),
("c0384","SAME",0,"high","One Medini, psf 365 vs 343.",False),
("c0392","SAME",0,"high","C also listed as Taman Semenyih Jaya; price 325k vs 315k.",False),
("c0400","PART_OF",0,"high","Phase 2 of Taman Meru Mulia, 641 m.",False),
("c0408","SAME",0,"high","Distinctive exact name, Kuchai Lama.",False),
("c0416","SAME",0,"high","Exact name, identical median 347,500; offset explained by scheme-wide point.",False),
("c0424","SAME",0,"medium","Taman Perdana, Pogoh exact; 1.5 km; price 270k vs 180k.",False),
("c0432","DIFFERENT",None,"high","R is in Alor Setar; candidates are in Kajang and Segamat.",False),
("c0440","SAME",0,"medium","Kampung Baru Kelapa Sawit exact, Kulai; 8.7 km offset.",False),
("c0448","PART_OF",0,"medium","Tropika is a development within the Puncak Alam township (R).",False),
("c0456","DIFFERENT",None,"high","R is in Kedah; the Taman Cempedak candidate is in Penang, 42 km away.",False),
("c0464","SAME",0,"medium","Suria Residences are Suria Jelutong's serviced apartments, 163 m.",False),
("c0472","DIFFERENT",None,"high","Serai Indah vs Serai Villa new launch; different estates.",False),
("c0480","SAME",0,"low","Taman Seri, Sungai Besar exact; 3.4 km, price 258k vs 550k.",False),
("c0488","DIFFERENT",None,"high","R office 'The Plaza' vs Plaza Condominium TTDI 5.4 km away; type differs.",False),
("c0496","SAME",0,"high","Identical psf 240 and price 200k.",False),
("c0504","SAME",1,"high","Web: Arked Esplanad is Taman Esplanad's 4,500 sf shop-offices; R shops ~4,490 sf.",True),
("c0512","SAME",0,"medium","Name including Pekan Kapar exact; point offset 16.7 km.",False),
("c0520","SAME",0,"high","Seksyen 1 Bandar Baru Bangi section row includes flats; price 380k vs 420k.",False),
("c0528","SAME",0,"high","Same name, 90 m, identical psf 650.",False),
("c0536","SAME",0,"high","Caledonia township Ijok, 504 m, price 538k vs 516k.",False),
("c0544","DIFFERENT",None,"high","Klebang Jaya vs Klebang Perdana/Putra/Utama; distinct estates.",False),
("c0552","SAME",0,"medium","Kampung Baru Juru exact; 4 km with road-level point.",False),
("c0560","SAME",0,"medium","Taman Damai, Muar; 5.5 km, price 415k vs 440k.",False),
("c0568","SAME",0,"high","Exact name, identical median 450k.",False),
("c0576","SAME",0,"high","Li Villas, 92 m, identical median 980k.",False),
("c0584","SAME",0,"medium","Exact name, Kepong; 5 km offset; price 408k vs 460k.",False),
("c0592","SAME",0,"high","Same name, 8 m, psf 618 vs 600.",False),
("c0600","DIFFERENT",None,"high","R is in Sarawak; the candidate is in Selangor.",False),
("c0608","SAME",0,"high","Taman Muhibbah, Simpang Renggam, 78 m.",False),
("c0616","SAME",0,"high","Taman Akasia Kluang, 503 m, detached houses.",False),
("c0624","DIFFERENT",None,"high","R is in Lumut, Perak; candidates are in Johor/Selangor with other names.",False),
("c0632","SAME",1,"medium","R says Puchong Hartamas = Pangsapuri Seri Jati Puchong; R point misgeocoded to Ara Damansara.",False),
("c0640","SAME",0,"high","Pantai Indah flats; psf 393 vs 388, price 300k vs 290k.",False),
("c0648","PART_OF",2,"low","Web: Kelisa Residensi is one apartment block within Taman Kelisa Emas; psf 303 vs 324.",True),
("c0656","SAME",0,"medium","Taman Sri Mewah, Jementah exact; 17 km offset.",False),
("c0664","SAME",0,"medium","Taman Bakariah exact, 493 m; Bakariah Indah/Baru are separate estates.",False),
("c0672","SAME",0,"high","Exact name, 558 m.",False),
("c0680","SAME",0,"high","Exact name, 72 m.",False),
("c0688","DIFFERENT",None,"low","Keroma Jaya vs Taman Keroma; web shows several distinct Keroma estates in Muar.",True),
("c0696","SAME",0,"high","Sphere Damansara, 70 m, psf 429 vs 421.",False),
("c0704","SAME",0,"medium","Township name exact; C1 is a later phase.",False),
("c0712","SAME",0,"medium","Township-level 16 Sierra match; R is its serviced-apartment transactions.",False),
("c0720","DIFFERENT",None,"medium","Road-front houses on Jalan Telok Air Tawar, not a taman; price 900k vs 567k.",False),
("c0728","SAME",0,"high","The Grand Subang SS13, 95 m, psf 871 vs 825.",False),
("c0736","SAME",1,"high","Taman KIP (Meda Park) exact; identical price and psf.",False),
("c0744","SAME",0,"high","Iskandar Residences Medini, identical psf 600.",False),
("c0752","SAME",0,"high","Bandar Sunway Semenyih, 207 m, similar price.",False),
("c0760","SAME",0,"medium","Web: Taman Bestari Perdana is in Pasir Gudang; R point likely misplaced.",True),
("c0768","SAME",0,"high","Exact name, 49 m, identical median.",False),
("c0776","SAME",0,"high","Taman Kota Impian, 358 m; C1 is its phase 2.",False),
("c0784","SAME",2,"high","Bracket names Marina Tower; psf 450 vs 436, price 320k vs 310k.",False),
("c0792","SAME",0,"medium","Ampang Jaya estate row includes flats; 1.2 km.",False),
("c0800","SAME",0,"high","Verdana North Kiara, identical psf 576.",False),
("c0808","SAME",0,"medium","Taman Kempas JB, 3.5 km; Kempas Baru is separate.",False),
("c0816","SAME",0,"medium","Exact name, Kulai, price 355k vs 370k; 10 km offset.",False),
("c0824","PART_OF",0,"medium","Andira Park is a precinct of Bandar Bukit Puchong.",False),
("c0832","DIFFERENT",None,"high","R is shop lots; candidates are residential.",False),
("c0840","SAME",1,"high","Chandan Putri/Puteri spelling variant, Kuala Kangsar, 330 m.",False),
("c0848","SAME",0,"high","Seri Ayu apartment Klang; identical psf and price.",False),
("c0856","SAME",0,"high","Zeva Residence, 9 m, psf 411 vs 419.",False),
("c0864","SAME",0,"high","Exact name, 135 m, identical median.",False),
("c0872","SAME",0,"low","Rhu Permai exact, 2 km; price 330k vs 100k conflicts.",False),
("c0880","SAME",0,"high","Ocean View Bandar Sri Pinang, identical price and psf.",False),
("c0888","SAME",0,"medium","Low-cost houses on Jalan Padang Tembak = Taman Padang Tembak KKB, 662 m.",False),
("c0896","PART_OF",0,"high","Phase 3 of Taman Sialang, Tangkak.",False),
("c0904","PART_OF",1,"medium","R point is in Kangar; C1 is Taman Utama Jaya phase 4.",False),
("c0912","SAME",0,"medium","Name matches Taman Bukit Emas Kajang; R point misplaced at Bukit Kajang.",False),
("c0920","DIFFERENT",None,"medium","Merdeka Jaya vs Taman Merdeka new launch; separate estates.",False),
("c0928","SAME",0,"high","D'Ambience Residences, 7 m, psf 364 vs 396.",False),
("c0936","SAME",0,"medium","Oasis Residences landed, Relau; price 1.24M vs 990k.",False),
("c0944","SAME",0,"high","Taman Uda Jaya Ampang, price 905k vs 892k.",False),
("c0952","SAME",0,"medium","Taman Sri Tanjung on the Muar/Tangkak border, 2.1 km.",False),
("c0960","SAME",0,"high","Distinctive exact name, Kinta.",False),
("c0968","SAME",0,"medium","Rini Homes 8 = the phase 6L listing, within Mutiara Rini.",False),
("c0976","SAME",0,"medium","Exact name, price 635k vs 655k; point offset.",False),
("c0984","SAME",0,"high","Taman Muhibbah Rawang, 220 m, price 447.5k vs 435k.",False),
("c0992","SAME",0,"medium","Taman Intan Jaya Kuala Selangor, identical median 220k; 16 km offset.",False),
("c1000","PART_OF",0,"medium","R combines One Permai and Two Permai; C0 is one phase.",False),
("c1008","SAME",0,"low","Same Neo Damansara development, 38 m; R office/SOHO psf far below C.",False),
("c1016","SAME",0,"medium","Apartment BNM Subang, 20 m; Fasa refers to location.",False),
("c1024","SAME",0,"high","Exact name, 10 m, price 880k vs 877k.",False),
("c1032","SAME",0,"high","Bandar Baru Seri Alam township exact.",False),
("c1040","SAME",1,"medium","Bandar Puncak Utama, 99 m, price 552.5k vs 500k.",False),
("c1048","PART_OF",0,"medium","R is the affordable-housing portion of Taman Anjung Gapam.",False),
("c1056","DIFFERENT",None,"medium","R is shop units; candidates are residential.",False),
("c1064","SAME",0,"medium","Exact name, 1.8 km.",False),
("c1072","SAME",0,"medium","Distinctive exact name in Kapar; 18 km offset.",False),
("c1080","SAME",0,"high","Setia Eco Gardens, 77 m, identical psf.",False),
("c1088","SAME",0,"high","Exact name including Brooklands alias, 307 m.",False),
("c1096","SAME",1,"medium","Taman Sri Jaya Rengam exact (Rengam town); R point sits near Simpang Renggam.",False),
("c1104","SAME",0,"high","228 Selayang, psf 329 vs 325.",False),
("c1112","SAME",0,"high","Nanyang Estate alias, identical median 600k.",False),
("c1120","PART_OF",0,"low","Web: Resort Villa 2 is a small later enclave within Hijayu 2 (Resort Homes).",True),
("c1128","PART_OF",0,"low","Taman Raja Uda lies within Kampung Raja Uda; the Taman Raja Uda row is condos.",False),
("c1136","PART_OF",0,"high","Taman Rafflesia 3 is a phase, 101 m.",False),
("c1144","DIFFERENT",None,"medium","Sulir Jaya vs Taman Sulir; price 210k vs 90k.",False),
("c1152","SAME",1,"high","Taman Jenderam Mutiara exact, price 502.5k vs 515k.",False),
("c1160","PART_OF",0,"medium","R combines Kampung Sungai Udang and Kampung Delek; C0 is one.",False),
("c1168","SAME",0,"medium","Sunway Emerald Residence, 147 m; R median skewed by bigger units.",False),
("c1176","SAME",1,"medium","Bandar Selesa Jaya apartments; identical psf 306, price 290k vs 300k.",False),
("c1184","SAME",0,"medium","Exact name, 3.3 km.",False),
("c1192","SAME",0,"medium","Web: Taman Sri Mewah is in Meru near Jalan Paip; C is Klang's only one.",True),
("c1200","PART_OF",0,"low","Taman Puchong lies within the Puchong locality row.",False),
("c1208","PART_OF",0,"high","Bandar IOI Segamat phase 8.",False),
("c1216","UNSURE",0,"low","C merges Bayan Baru and Air Tawar Taman Melati; price 80k vs 740k.",False),
("c1224","SAME",0,"medium","Bandar Cassia township condos, 1.7 km.",False),
("c1232","SAME",0,"medium","Kampung Selayang Indah exact; ~9 km offset for all Selayang candidates.",False),
("c1240","SAME",0,"medium","Desa Ukay at Ukay Heights, 1 km.",False),
("c1248","SAME",0,"medium","Royce Residence, 49 m; psf 1351 vs 1980 differs.",False),
("c1256","SAME",0,"high","Taman Enggang Muar, 29 m.",False),
("c1264","DIFFERENT",None,"high","Gemilang Permai vs Gemilang/Seri Gemilang/Gemilang Jaya; price 1.3M vs at most 730k.",False),
("c1272","DIFFERENT",None,"medium","Bandar Baru Masjid Tanah vs Taman Masjid Tanah new launch 4 km away.",False),
("c1280","DIFFERENT",None,"high","R is in Kota Kinabalu; candidates are in Johor.",False),
("c1288","SAME",0,"high","DA:MEN USJ serviced apartments = Da Men Residences, 115 m.",False),
("c1296","DIFFERENT",None,"high","R is in Perak; candidates are far elsewhere.",False),
("c1304","SAME",1,"high","One Tebrau Residence, distinctive name; 1.7 km offset.",False),
("c1312","UNSURE",0,"low","Pangsapuri Seri Jasa (Seri Kembangan) fits prices and sizes but lies 32 km from R.",True),
("c1320","SAME",2,"high","Bracket names Grandeur Tower; psf 348 vs 338.",False),
("c1328","DIFFERENT",None,"high","R is in Kedah; Seri Bayu 2 is in Johor; Bayu Pelangi is another name.",False),
("c1336","UNSURE",0,"low","Generic Kampung Pasir; 5 km from Semenyih's, price 300k vs 150k.",False),
("c1344","UNSURE",0,"low","Web shows both Taman Pelangi and Taman Sri Pelangi in Segamat; 182 m, similar prices.",True),
("c1352","DIFFERENT",None,"medium","Senggarang Indah differs from Senggarang, Senggarang Jaya and Sri Senggarang.",False),
("c1360","SAME",0,"medium","Kampung Baru Machap exact; 7.6 km offset.",False),
("c1368","SAME",0,"high","KL Plaza Suites, psf 711 vs 657, price 1.05M vs 1.0M.",False),
("c1376","SAME",0,"high","Exact name, identical median 80k.",False),
("c1384","PART_OF",0,"high","Phase II of Taman Bukit Angkasa; identical psf.",False),
("c1392","SAME",0,"medium","Exact name, Ampang, 1.8 km.",False),
("c1400","SAME",0,"medium","Exact name, Batang Berjuntai, 3.3 km.",False),
("c1408","SAME",0,"medium","Taman Intan, Klang exact; 5 km offset.",False),
("c1416","SAME",0,"high","Seri Beringin, 68 m, median 7M vs 6.9M.",False),
("c1424","SAME",0,"medium","Township Taman Impian Indah Cheras, 62 m; C median mixes types.",False),
("c1432","DIFFERENT",None,"high","R is in Kulim; Allamanda candidates are in Selangor.",False),
("c1440","SAME",0,"high","Sejati Residences Cyberjaya township listing.",False),
("c1448","SAME",0,"high","Kiara Residence 2, identical price and psf.",False),
("c1456","DIFFERENT",None,"high","Salang Indah vs Salang Perdana; distinct estates.",False),
("c1464","SAME",0,"high","Distinctive exact name, Melaka.",False),
("c1472","UNSURE",0,"low","Taman Sungai Chua may be the low-cost scheme; no exact candidate.",False),
("c1480","SAME",0,"high","Lot subdivision in Kampung Maya; identical median 765k.",False),
("c1488","SAME",1,"high","Impiana Sky Residensi @ The Earth, identical price and psf.",False),
("c1496","PART_OF",0,"low","Villa Sri Manja is a development within the Taman Sri Manja area.",False),
("c1504","PART_OF",0,"medium","Taman Baiduri phase 2, 118 m; higher-value houses.",False),
("c1512","DIFFERENT",None,"medium","Persiaran Cantonment bungalows vs The Cantonment condo and Solok Cantonment.",False),
("c1520","DIFFERENT",None,"high","Taman Muhibbah Melaka vs Taman Bukit Rambai and Selangor Muhibbahs.",False),
("c1528","SAME",0,"medium","Taman Bukit Gambier exact; C median dominated by flats.",False),
("c1536","PART_OF",0,"medium","Phase 4 of Taman Kenangan, Kulim.",False),
("c1544","SAME",0,"high","Kota Puteri Batu Arang, price 470k vs 527k.",False),
("c1552","SAME",0,"high","Taman Tampoi Utama flats, 704 m.",False),
("c1560","SAME",0,"medium","Same alias pair Sri Cendekia/Connaught; price differs.",False),
("c1568","PART_OF",0,"high","Phase 5 of Taman Sialang.",False),
("c1576","SAME",0,"low","New Taman Bukit Rambai, completed 2025; 2.6 km.",False),
("c1584","SAME",0,"medium","Taman Gadong Perdana, 494 m.",False),
("c1592","DIFFERENT",None,"high","Road-front houses on Jalan Air Itam; candidates are tamans 4-6 km away.",False),
("c1600","DIFFERENT",None,"high","Fortune Court vs Fortune Perdana; Bukit Ceylon Fortune Court is 10 km away, 850k.",False),
("c1608","SAME",0,"medium","Garden Plaza Cyberjaya; same unit size, price 30% higher.",False),
("c1616","SAME",1,"medium","Plaza Kelana Jaya SOHO/office complex, 87 m.",False),
("c1624","SAME",0,"high","Exact name, price 1.5M vs 1.36M.",False),
("c1632","SAME",0,"medium","Typo for Taman Sri Mahkota, Benut; low-cost; point offset.",False),
("c1640","DIFFERENT",None,"high","R is in Gemas; candidates are in Klang, Jenjarom and JB.",False),
("c1648","SAME",0,"high","Cypress Villa Desaria, 200 m.",False),
("c1656","PART_OF",0,"medium","Phase 2 of Taman Lembah Padang, 336 m.",False),
("c1664","DIFFERENT",None,"medium","C is a lot-based new launch 35 km away.",False),
("c1672","SAME",0,"medium","Taman Mutiara Gading exact, 686 m.",False),
("c1680","SAME",0,"high","Dua Villas @ One Residence, 61 m.",False),
("c1688","DIFFERENT",None,"medium","Taman Sungai Buloh vs Kampung Sungai Buloh, Jeram; others far away.",False),
("c1696","SAME",0,"high","Identical price and psf.",False),
("c1704","SAME",0,"high","Taman Bertam Putra exact, Melaka.",False),
("c1712","DIFFERENT",None,"medium","Tangga Batu vs Tangga Batu Indah new launch.",False),
("c1720","SAME",0,"high","Residensi Embun Damai, 77 m.",False),
("c1728","DIFFERENT",None,"high","Rembia Setia vs Taman Rembia / Rembia Damai new launches.",False),
("c1736","SAME",0,"high","Bandar Baru Sungai Buloh, 475 m.",False),
("c1744","SAME",0,"medium","Web: Taman Nibong Indah is also known as Taman Sungai Daun; C price lower.",True),
("c1752","SAME",0,"high","Residensi Star 2 = Star Residences Two; R point offset.",False),
("c1760","SAME",0,"medium","Cristal Serin Residence Cyberjaya; unit-mix differences.",False),
("c1768","SAME",0,"high","Bandar Dato Onn, 532 m, similar prices.",False),
("c1776","SAME",0,"high","Halaman Seroja Batu Kawan, price 270k vs 290k.",False),
("c1784","SAME",1,"high","10 Residensi Seksyen 17, price 1.213M vs 1.2035M.",False),
("c1792","DIFFERENT",None,"high","R is in Pahang; candidates are in Penang/Selangor.",False),
("c1800","SAME",0,"low","Taman Sri Cempaka exact, 217 m; R price far above C.",False),
("c1808","SAME",0,"high","Kota Seribong exact, 274 m.",False),
("c1816","SAME",0,"high","Summer Park Townhouse, 14 m.",False),
("c1824","SAME",0,"high","Taman Pelangi Semenyih 2 exact, identical median.",False),
("c1832","SAME",0,"high","Danga Sutera exact.",False),
("c1840","SAME",0,"high","SHNG Villas, psf 622 vs 619.",False),
("c1848","SAME",0,"low","Exact name in KL but 7 km and price 950k vs 410k.",False),
("c1856","SAME",0,"high","Bestari Jaya = Batang Berjuntai; Taman Suria, 117 m.",False),
("c1864","SAME",1,"high","Green Acre Park, Bandar Sungai Long.",False),
("c1872","SAME",0,"high","Taman Bandar Batu Pahat, 684 m, price 333k vs 330k.",False),
("c1880","SAME",2,"high","Taman Nusa Perintis 1 exact.",False),
("c1888","SAME",0,"high","East Lake Residence, 36 m.",False),
("c1896","SAME",0,"high","Bandar Seri Impian Kluang.",False),
("c1904","SAME",0,"high","Menara Duta 1, identical price and psf.",False),
("c1912","DIFFERENT",None,"high","Sungai Karang Indah vs Taman Sungai Karang new semi-D launch.",False),
("c1920","PART_OF",0,"medium","Web: Taman Dato' Amar Diraja II is in Kluang, a phase of C0 (534 m).",True),
("c1928","SAME",0,"high","Mutiara Perdana apartments, Bayan Lepas.",False),
("c1936","DIFFERENT",None,"medium","Sungai Serdang Permai vs Taman Sungai Serdang / Seri Serdang.",False),
("c1944","SAME",0,"medium","Taman Sri Gading exact, 3.6 km.",False),
("c1952","DIFFERENT",None,"medium","Road-front houses on Jalan Sungai Abong, not the Sungai Abong tamans.",False),
("c1960","SAME",0,"high","8Scape Residences, 61 m.",False),
("c1968","DIFFERENT",None,"high","Bertek Indah vs Taman Sungai Bertek new launch.",False),
("c1976","DIFFERENT",None,"medium","Green Park vs New Green Park (Taman Sri Hijau); separate estates.",False),
("c1984","DIFFERENT",None,"high","Rapat Indah vs Rapat Mutiara.",False),
("c1992","SAME",0,"high","Taman Gembira, Klang (Telok Gadong); Gembira Baru is separate.",False),
("c2000","SAME",1,"medium","Unnumbered Prima Tiara = phase 1 (2001), psf 356 vs 330.",False),
("c2008","SAME",0,"high","Eclipse Residence Cyberjaya, psf 502 vs 491.",False),
("c2016","SAME",0,"high","Salak South Garden exact, 743 m.",False),
("c2024","SAME",0,"medium","Taman Manis 6 exact; 16.5 km offset for all candidates.",False),
("c2032","SAME",0,"high","Taman Ampang Mewah, price 170k vs 190k.",False),
("c2040","SAME",0,"medium","Taman Kajang Jaya exact; 6.8 km.",False),
("c2048","DIFFERENT",None,"medium","R is office/SOHO; C rows are the golf resort's houses.",False),
("c2056","SAME",1,"medium","Suria Mewah Residensi exact; R point misplaced near Suria Jaya.",False),
("c2064","DIFFERENT",None,"high","Industrial estate vs terrace houses 30 km away.",False),
("c2072","DIFFERENT",None,"medium","Taman Suria vs Taman Suria Perdana; different estate.",False),
]

inp = '/var/www/html/peta/storage/app/propertylab-catalogue-match/review/batch_08_in.jsonl'
out = '/var/www/html/peta/storage/app/propertylab-catalogue-match/review/batch_08_out.jsonl'
cases = [json.loads(l) for l in open(inp)]
assert len(cases) == len(V), (len(cases), len(V))
ids = [v[0] for v in V]
assert len(set(ids)) == len(ids), "duplicate case ids"
problems = []
for c, v in zip(cases, V):
    cid, verdict, cand, conf, reason, web = v
    if c['case'] != cid:
        problems.append(f"order mismatch: input {c['case']} vs verdict {cid}")
    if verdict not in ('SAME','PART_OF','DIFFERENT','UNSURE'): problems.append(f"{cid} bad verdict")
    if conf not in ('high','medium','low'): problems.append(f"{cid} bad confidence")
    ks = [x['k'] for x in c['catalogue_candidates']]
    if cand is not None and cand not in ks: problems.append(f"{cid} cand {cand} not in {ks}")
    if verdict in ('SAME','PART_OF') and cand is None: problems.append(f"{cid} needs cand")
    if verdict == 'DIFFERENT' and cand is not None: problems.append(f"{cid} DIFFERENT with cand")
    if len(reason.split()) > 20: problems.append(f"{cid} reason {len(reason.split())} words")
print("problems:", problems if problems else "none")
if not problems:
    with open(out, 'w') as f:
        for v in V:
            cid, verdict, cand, conf, reason, web = v
            f.write(json.dumps({"case":cid,"verdict":verdict,"cand":cand,"confidence":conf,"reason":reason,"web":web}, ensure_ascii=False) + "\n")
    from collections import Counter
    print("verdicts:", Counter(v[1] for v in V))
    print("confidence:", Counter(v[3] for v in V))
    print("web cases:", sum(1 for v in V if v[5]))
