import os
import pywikibot
import requests
import sys
import time

os.environ['TZ'] = 'Europe/Berlin'
time.tzset()

system = 'wikidata'
wikidata_site = pywikibot.Site(system, 'wikidata')
repo = wikidata_site.data_repository()

#summaryString = 'remove undifferentiated GND identifier "{}" (type n)'
summaryString = 'remove redirecting GND identifier "{}"'
gndP = 'P227'
urlFormatter = 'https://d-nb.info/gnd/{}/about/lds'
headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0' }
undiff = '<http://d-nb.info/gnd/{}> a gndo:UndifferentiatedPerson'

#inputdata = { 'Q450259':'186803729','Q434365':'184520991','Q519653':'159159369','Q528159':'114313423','Q326010':'159207045','Q560079':'157379159','Q1337326':'186393865','Q1348235':'18194877X','Q1369855':'153271272','Q1278446':'105769304','Q1307310':'187776563','Q1442622':'107445880X','Q1490694':'154207470','Q1570201':'157659453','Q1585313':'151998434','Q973544':'108748693','Q1721032':'176721959','Q330110':'157376796','Q807549':'187931577','Q1938520':'151181209','Q2779173':'1065302398','Q3091817':'175530211','Q3158672':'175365911','Q3085604':'177096187','Q3311452':'186535104','Q3191177':'110335813','Q3384639':'155258095','Q4768327':'15736318X','Q4241650':'177501677','Q4726015':'175082685','Q5614685':'178237701','Q5702042':'15195660X','Q4815976':'114280029','Q5362507':'153184191','Q5248281':'151668388','Q5648848':'187494819','Q6376222':'160228506','Q6216361':'18614816X','Q6499287':'179473239','Q6819677':'105521515','Q6939420':'16004118X','Q6757075':'158946677','Q6835895':'156601788','Q14311235':'159478162','Q7648013':'153519223','Q10393098':'153182539','Q15721423':'187851530','Q16657539':'102342598','Q16727842':'153372680','Q16194771':'113713789','Q19226077':'181801949','Q25439494':'179779052','Q19698539':'186207603','Q19758008':'137562373','Q19959593':'187493278','Q27966061':'120782219','Q27825168':'103984704','Q28008175':'156479575','Q27642999':'12452253X','Q50402559':'114242992','Q30065118':'158347145','Q29650326':'106482955','Q29963569':'181219417','Q29902741':'101641427','Q28322819':'114149518','Q28911669':'177824174','Q30044509':'1127397982','Q46747609':'111132282','Q46837871':'113462492','Q44286938':'1075046572' }
inputdata = { 'Q48703':{'remove':'1089607040','add':'10247933X'}, 'Q63472':{'remove':'101053819','add':'1080678158'}, 'Q71257':{'remove':'1013427289','add':'138870691'}, 'Q74293':{'remove':'1061783111','add':'1138037524'}, 'Q159952':{'remove':'143428926','add':'126596603'}, 'Q137338':{'remove':'1128176351','add':'13833207X'}, 'Q105632':{'remove':'128702036','add':'116790113'}, 'Q121501':{'remove':'142965448','add':'1048601781'}, 'Q105153':{'remove':'1061532364','add':'1147158665'}, 'Q121451':{'remove':'1089323611','add':'1115828274'}, 'Q87347':{'remove':'13311712X','add':'136374468'}, 'Q102582':{'remove':'11676502X','add':'118696327'}, 'Q97485':{'remove':'143198289','add':'128963387'}, 'Q92606':{'remove':'172104149','add':'114572650X'}, 'Q500437':{'remove':'118129643','add':'171698010'}, 'Q503068':{'remove':'123363160','add':'118797549'}, 'Q466465':{'remove':'134789768','add':'173774423'}, 'Q265208':{'remove':'1062372840','add':'1129808971'}, 'Q456248':{'remove':'172920019','add':'1049413822'}, 'Q705128':{'remove':'1090428871','add':'117014362'}, 'Q313942':{'remove':'172707897','add':'11853999X'}, 'Q543968':{'remove':'1089516681','add':'1061847047'}, 'Q1098645':{'remove':'172234921','add':'170212874'}, 'Q1206743':{'remove':'172012546','add':'117668087'}, 'Q1140264':{'remove':'1061412563','add':'1090181914'}, 'Q1169867':{'remove':'1103520946','add':'116587792'}, 'Q1094716':{'remove':'172502055','add':'17063339X'}, 'Q715372':{'remove':'1090340680','add':'1022719513'}, 'Q563574':{'remove':'108973316X','add':'104079665'}, 'Q724576':{'remove':'105051050X','add':'1108140750'}, 'Q1425339':{'remove':'1055703276','add':'1075617782'}, 'Q1429724':{'remove':'13506208X','add':'1089832702'}, 'Q1354716':{'remove':'1089488920','add':'121849929'}, 'Q1225258':{'remove':'1043571248','add':'1043571396'}, 'Q1279029':{'remove':'140845682','add':'117343110'}, 'Q1449236':{'remove':'1051973848','add':'117201529'}, 'Q1458926':{'remove':'113912617','add':'1149525185'}, 'Q1444634':{'remove':'120634171','add':'111215230X'}, 'Q1677608':{'remove':'1067890769','add':'1147521859'}, 'Q1681499':{'remove':'174336349','add':'1124564365'}, 'Q1507208':{'remove':'1062365674','add':'1137267712'}, 'Q1555907':{'remove':'139536795','add':'1015500129'}, 'Q1561157':{'remove':'127712356','add':'117754919'}, 'Q1560075':{'remove':'126617619','add':'1033293040'}, 'Q1559715':{'remove':'1062329619','add':'1068241926'}, 'Q1568415':{'remove':'140342419','add':'133474070'}, 'Q1592878':{'remove':'141337613','add':'170098559'}, 'Q1611241':{'remove':'11683045X','add':'1012267563'}, 'Q1619431':{'remove':'174338880','add':'1147119511'}, 'Q1597615':{'remove':'139275894','add':'120049910'}, 'Q380121':{'remove':'1019453052','add':'1022027468'}, 'Q1039342':{'remove':'1017492832','add':'1038458080'}, 'Q993893':{'remove':'12689440X','add':'1139516663'}, 'Q1009756':{'remove':'1090370733','add':'1048645177'}, 'Q1699752':{'remove':'1061524418','add':'1061939898'}, 'Q1736710':{'remove':'171139046','add':'172083249'}, 'Q1691299':{'remove':'126517517','add':'133999890'}, 'Q633255':{'remove':'136708943','add':'1034943898'}, 'Q692645':{'remove':'1017705690','add':'119546418'}, 'Q809297':{'remove':'1035113597','add':'1055207589'}, 'Q359008':{'remove':'1024793249','add':'1059652269'}, 'Q657822':{'remove':'1052839657','add':'1116106671'}, 'Q761717':{'remove':'1057080837','add':'1147220751'}, 'Q2049704':{'remove':'172495547','add':'117702986'}, 'Q2022296':{'remove':'139874577','add':'1065195877'}, 'Q2005908':{'remove':'1014332877','add':'1055748393'}, 'Q1765056':{'remove':'1061915174','add':'1147152403'}, 'Q1818563':{'remove':'116411384','add':'133726622'}, 'Q1895938':{'remove':'106601784','add':'174142854'}, 'Q1918976':{'remove':'139678794','add':'1066381739'}, 'Q1743987':{'remove':'126886709','add':'1012413799'}, 'Q1786653':{'remove':'173750400','add':'174278586'}, 'Q1872749':{'remove':'1062447662','add':'1065933975'}, 'Q2198220':{'remove':'172377692','add':'1147224838'}, 'Q2149659':{'remove':'1062362969','add':'1061460126'}, 'Q2177712':{'remove':'136194036','add':'133012697'}, 'Q2561245':{'remove':'173531156','add':'1142280187'}, 'Q2501891':{'remove':'1062024060','add':'1062483847'}, 'Q2547242':{'remove':'118554557','add':'1089936184'}, 'Q2833698':{'remove':'1090361769','add':'11656203X'}, 'Q2836362':{'remove':'1062119819','add':'138229902'}, 'Q2940097':{'remove':'111294738','add':'1143737873'}, 'Q3261403':{'remove':'17201395X','add':'119247909'}, 'Q3407316':{'remove':'176970665','add':'1147253374'}, 'Q3913010':{'remove':'132999005','add':'119182181'}, 'Q3990709':{'remove':'1050303113','add':'13479432X'}, 'Q4116640':{'remove':'1089274424','add':'102836167'}, 'Q5362803':{'remove':'1089806957','add':'1139392468'}, 'Q6390348':{'remove':'172170389','add':'1090658559'}, 'Q6795714':{'remove':'138280843','add':'189562447'}, 'Q7297924':{'remove':'172300088','add':'170611906'}, 'Q15433430':{'remove':'12285313X','add':'115872051'}, 'Q15448569':{'remove':'1012401359','add':'116658088'}, 'Q15439523':{'remove':'136063780','add':'117087610'}, 'Q13407650':{'remove':'134879201','add':'1035313537'}, 'Q14565861':{'remove':'173463622','add':'1090264054'}, 'Q14545101':{'remove':'1028554443','add':'1082540072'}, 'Q9697434':{'remove':'136424279','add':'116342846'}, 'Q15994693':{'remove':'128247444','add':'1076596320'}, 'Q16065038':{'remove':'1055203877','add':'107352454X'}, 'Q15638583':{'remove':'1055742166','add':'1089223692'}, 'Q15857756':{'remove':'1012273237','add':'119710935'}, 'Q15804770':{'remove':'170877361','add':'172172853'}, 'Q16979796':{'remove':'1116552272','add':'1137587075'}, 'Q15453772':{'remove':'1012715892','add':'117394904'}, 'Q15841671':{'remove':'1155337298','add':'1142136868'}, 'Q16733642':{'remove':'1074414381','add':'1089289383'}, 'Q17576155':{'remove':'1136046402','add':'128685069'}, 'Q18021195':{'remove':'1055118454','add':'104255609'}, 'Q19283817':{'remove':'189529148','add':'134110676'}, 'Q17624731':{'remove':'1034678272','add':'120815958'}, 'Q19259763':{'remove':'189434244','add':'118879057'}, 'Q18625904':{'remove':'1062411587','add':'1129204022'}, 'Q23000600':{'remove':'143318926','add':'189546778'}, 'Q23060466':{'remove':'172329884','add':'141659920'}, 'Q26162535':{'remove':'127541829','add':'1065776608'}, 'Q24175494':{'remove':'1020442689','add':'115581308'}, 'Q19502401':{'remove':'172186803','add':'109556305X'}, 'Q20184559':{'remove':'1062926404','add':'1062313186'}, 'Q20752655':{'remove':'174216815','add':'116363436'}, 'Q21033150':{'remove':'17022841X','add':'172874718'}, 'Q19286911':{'remove':'1055599606','add':'1089726333'}, 'Q19959759':{'remove':'1012379515','add':'189475447'}, 'Q20171592':{'remove':'101420838','add':'116157356'}, 'Q20724871':{'remove':'136861385','add':'1050543165'}, 'Q19969691':{'remove':'117576026','add':'116906839'}, 'Q19897706':{'remove':'1043569162','add':'117746800'}, 'Q20243231':{'remove':'1050552822','add':'117060518'}, 'Q20752480':{'remove':'105328232X','add':'1014468817'}, 'Q19962804':{'remove':'1020681950','add':'116688602'}, 'Q20184766':{'remove':'1060151901','add':'1035014882'}, 'Q19287093':{'remove':'122533801','add':'174072023'}, 'Q19904603':{'remove':'1127195573','add':'1136676783'}, 'Q27074653':{'remove':'1055226818','add':'114716908X'}, 'Q26834243':{'remove':'141778040','add':'100492622'}, 'Q26196926':{'remove':'17205172X','add':'12502682X'}, 'Q28003002':{'remove':'1077407130','add':'108277670X'}, 'Q27824197':{'remove':'1057263486','add':'172493781'}, 'Q53079205':{'remove':'17002427X','add':'172046491'}, 'Q28949150':{'remove':'136863922','add':'189407492'}, 'Q34294818':{'remove':'184599555','add':'134124758'}, 'Q28973575':{'remove':'1090339844','add':'123712769'}, 'Q29293095':{'remove':'1130198340','add':'1129545377'}, 'Q41497257':{'remove':'102230464X','add':'142393657'}, 'Q43090799':{'remove':'106601539','add':'142490695'}, 'Q47463507':{'remove':'107656663','add':'1052838588'} }

for i, item in enumerate(inputdata):
    Qitem = pywikibot.ItemPage(repo, item)
    Qitem.get()
    if not Qitem.claims:
        print('Item {} does not have any claims'.format(item))
        continue
    
    if gndP not in Qitem.claims:
        print('Item {} does not have a claim {}'.format(prop, gndP))
        continue
   
    for claim in Qitem.claims[gndP]:
        value = claim.getTarget().title()
#        if value != inputdata[item]:
#            print('{}/{}: {} --> P227 --> {} not to be removed'.format(i+1, len(inputdata), item, value))
#            continue
        
#        url = urlFormatter.format(inputdata[item])
#        request = requests.get(url, headers=headers)
#        print('requested {} with status {}'.format(url, request.status_code))
#        if request.status_code!=200:
#            print('HTTP status {}'.format(request.status_code))
#            continue
#        if request.text.find(undiff.format(inputdata[item]))==-1:
#            print('Not an undifferentiated identifier')
#            continue
        
#        print('{}/{}: {} --> P227 --> {} to be removed'.format(i+1, len(inputdata), item, value))
#        Qitem.removeClaims(claim, summary=summaryString.format(inputdata[item]))
#        time.sleep(4)
        
        if value != inputdata[item]['remove']:
            print('{}/{}: {} --> P227 --> {} not to be removed'.format(i+1, len(inputdata), item, value))
            continue
        
        #url = urlFormatter.format(inputdata[item]['remove'])
        #request = requests.get(url, headers=headers)
        #print('requested {} with status {}'.format(url, request.status_code))
        #if request.status_code!=200:
        #    print('HTTP status {}'.format(request.status_code))
        #    continue
        #if request.text.find(undiff.format(inputdata[item]['remove']))==-1:
        #    print('Not an undifferentiated identifier')
        #    continue
        
        print('{}/{}: {} --> P227 --> {} to be replaced by {}'.format(i+1, len(inputdata), item, value, inputdata[item]['add']))
        Qitem.removeClaims(claim, summary=summaryString.format(inputdata[item]['remove']))
        
        newClaim = pywikibot.Claim(repo, 'P227')
        newClaim.setTarget(value=inputdata[item]['add'])
        Qitem.addClaim(newClaim)
        
        #time.sleep(4)
1/146: Q48703 --> P227 --> 1089607040 to be replaced by 10247933X
1/146: Q48703 --> P227 --> 10247933X not to be removed
2/146: Q63472 --> P227 --> 101053819 to be replaced by 1080678158
2/146: Q63472 --> P227 --> 1080678158 not to be removed
3/146: Q71257 --> P227 --> 1013427289 to be replaced by 138870691
3/146: Q71257 --> P227 --> 138870691 not to be removed
4/146: Q74293 --> P227 --> 1061783111 to be replaced by 1138037524
4/146: Q74293 --> P227 --> 1138037524 not to be removed
5/146: Q159952 --> P227 --> 143428926 to be replaced by 126596603
5/146: Q159952 --> P227 --> 126596603 not to be removed
6/146: Q137338 --> P227 --> 1128176351 to be replaced by 13833207X
6/146: Q137338 --> P227 --> 13833207X not to be removed
7/146: Q105632 --> P227 --> 128702036 to be replaced by 116790113
7/146: Q105632 --> P227 --> 116790113 not to be removed
8/146: Q121501 --> P227 --> 142965448 to be replaced by 1048601781
8/146: Q121501 --> P227 --> 1048601781 not to be removed
9/146: Q105153 --> P227 --> 1061532364 to be replaced by 1147158665
9/146: Q105153 --> P227 --> 1147158665 not to be removed
10/146: Q121451 --> P227 --> 1089323611 to be replaced by 1115828274
10/146: Q121451 --> P227 --> 1115828274 not to be removed
11/146: Q87347 --> P227 --> 13311712X to be replaced by 136374468
11/146: Q87347 --> P227 --> 136374468 not to be removed
12/146: Q102582 --> P227 --> 11676502X to be replaced by 118696327
12/146: Q102582 --> P227 --> 118696327 not to be removed
13/146: Q97485 --> P227 --> 143198289 to be replaced by 128963387
13/146: Q97485 --> P227 --> 128963387 not to be removed
14/146: Q92606 --> P227 --> 172104149 to be replaced by 114572650X
14/146: Q92606 --> P227 --> 114572650X not to be removed
15/146: Q500437 --> P227 --> 118129643 to be replaced by 171698010
15/146: Q500437 --> P227 --> 171698010 not to be removed
16/146: Q503068 --> P227 --> 123363160 to be replaced by 118797549
16/146: Q503068 --> P227 --> 118797549 not to be removed
17/146: Q466465 --> P227 --> 134789768 to be replaced by 173774423
17/146: Q466465 --> P227 --> 173774423 not to be removed
18/146: Q265208 --> P227 --> 1062372840 to be replaced by 1129808971
18/146: Q265208 --> P227 --> 1129808971 not to be removed
19/146: Q456248 --> P227 --> 172920019 to be replaced by 1049413822
19/146: Q456248 --> P227 --> 1049413822 not to be removed
20/146: Q705128 --> P227 --> 1090428871 to be replaced by 117014362
20/146: Q705128 --> P227 --> 117014362 not to be removed
21/146: Q313942 --> P227 --> 172707897 to be replaced by 11853999X
21/146: Q313942 --> P227 --> 11853999X not to be removed
22/146: Q543968 --> P227 --> 1089516681 to be replaced by 1061847047
22/146: Q543968 --> P227 --> 1061847047 not to be removed
23/146: Q1098645 --> P227 --> 172234921 to be replaced by 170212874
23/146: Q1098645 --> P227 --> 170212874 not to be removed
24/146: Q1206743 --> P227 --> 172012546 to be replaced by 117668087
24/146: Q1206743 --> P227 --> 117668087 not to be removed
25/146: Q1140264 --> P227 --> 1061412563 to be replaced by 1090181914
25/146: Q1140264 --> P227 --> 1090181914 not to be removed
26/146: Q1169867 --> P227 --> 1103520946 to be replaced by 116587792
26/146: Q1169867 --> P227 --> 116587792 not to be removed
27/146: Q1094716 --> P227 --> 172502055 to be replaced by 17063339X
27/146: Q1094716 --> P227 --> 17063339X not to be removed
28/146: Q715372 --> P227 --> 1090340680 to be replaced by 1022719513
28/146: Q715372 --> P227 --> 1022719513 not to be removed
29/146: Q563574 --> P227 --> 108973316X to be replaced by 104079665
29/146: Q563574 --> P227 --> 104079665 not to be removed
30/146: Q724576 --> P227 --> 105051050X to be replaced by 1108140750
30/146: Q724576 --> P227 --> 1108140750 not to be removed
31/146: Q1425339 --> P227 --> 1055703276 to be replaced by 1075617782
31/146: Q1425339 --> P227 --> 1075617782 not to be removed
32/146: Q1429724 --> P227 --> 13506208X to be replaced by 1089832702
32/146: Q1429724 --> P227 --> 1089832702 not to be removed
33/146: Q1354716 --> P227 --> 1089488920 to be replaced by 121849929
33/146: Q1354716 --> P227 --> 121849929 not to be removed
34/146: Q1225258 --> P227 --> 1043571248 to be replaced by 1043571396
34/146: Q1225258 --> P227 --> 1043571396 not to be removed
35/146: Q1279029 --> P227 --> 140845682 to be replaced by 117343110
35/146: Q1279029 --> P227 --> 117343110 not to be removed
36/146: Q1449236 --> P227 --> 1051973848 to be replaced by 117201529
36/146: Q1449236 --> P227 --> 117201529 not to be removed
37/146: Q1458926 --> P227 --> 113912617 to be replaced by 1149525185
37/146: Q1458926 --> P227 --> 1149525185 not to be removed
38/146: Q1444634 --> P227 --> 120634171 to be replaced by 111215230X
38/146: Q1444634 --> P227 --> 111215230X not to be removed
39/146: Q1677608 --> P227 --> 1067890769 to be replaced by 1147521859
39/146: Q1677608 --> P227 --> 1147521859 not to be removed
40/146: Q1681499 --> P227 --> 174336349 to be replaced by 1124564365
40/146: Q1681499 --> P227 --> 1124564365 not to be removed
41/146: Q1507208 --> P227 --> 1062365674 to be replaced by 1137267712
41/146: Q1507208 --> P227 --> 1137267712 not to be removed
42/146: Q1555907 --> P227 --> 139536795 to be replaced by 1015500129
42/146: Q1555907 --> P227 --> 1015500129 not to be removed
43/146: Q1561157 --> P227 --> 127712356 to be replaced by 117754919
43/146: Q1561157 --> P227 --> 117754919 not to be removed
44/146: Q1560075 --> P227 --> 126617619 to be replaced by 1033293040
44/146: Q1560075 --> P227 --> 1033293040 not to be removed
45/146: Q1559715 --> P227 --> 1062329619 to be replaced by 1068241926
45/146: Q1559715 --> P227 --> 1068241926 not to be removed
46/146: Q1568415 --> P227 --> 140342419 to be replaced by 133474070
46/146: Q1568415 --> P227 --> 133474070 not to be removed
47/146: Q1592878 --> P227 --> 141337613 to be replaced by 170098559
47/146: Q1592878 --> P227 --> 170098559 not to be removed
48/146: Q1611241 --> P227 --> 11683045X to be replaced by 1012267563
48/146: Q1611241 --> P227 --> 1012267563 not to be removed
49/146: Q1619431 --> P227 --> 174338880 to be replaced by 1147119511
49/146: Q1619431 --> P227 --> 1147119511 not to be removed
50/146: Q1597615 --> P227 --> 139275894 to be replaced by 120049910
50/146: Q1597615 --> P227 --> 120049910 not to be removed
51/146: Q380121 --> P227 --> 1019453052 to be replaced by 1022027468
51/146: Q380121 --> P227 --> 1022027468 not to be removed
52/146: Q1039342 --> P227 --> 1017492832 to be replaced by 1038458080
52/146: Q1039342 --> P227 --> 1038458080 not to be removed
53/146: Q993893 --> P227 --> 12689440X to be replaced by 1139516663
53/146: Q993893 --> P227 --> 1139516663 not to be removed
54/146: Q1009756 --> P227 --> 1090370733 to be replaced by 1048645177
54/146: Q1009756 --> P227 --> 1048645177 not to be removed
55/146: Q1699752 --> P227 --> 1061524418 to be replaced by 1061939898
55/146: Q1699752 --> P227 --> 1061939898 not to be removed
56/146: Q1736710 --> P227 --> 171139046 to be replaced by 172083249
56/146: Q1736710 --> P227 --> 172083249 not to be removed
57/146: Q1691299 --> P227 --> 126517517 to be replaced by 133999890
57/146: Q1691299 --> P227 --> 133999890 not to be removed
58/146: Q633255 --> P227 --> 136708943 to be replaced by 1034943898
58/146: Q633255 --> P227 --> 1034943898 not to be removed
59/146: Q692645 --> P227 --> 1017705690 to be replaced by 119546418
59/146: Q692645 --> P227 --> 119546418 not to be removed
60/146: Q809297 --> P227 --> 1035113597 to be replaced by 1055207589
60/146: Q809297 --> P227 --> 1055207589 not to be removed
61/146: Q359008 --> P227 --> 1024793249 to be replaced by 1059652269
61/146: Q359008 --> P227 --> 1059652269 not to be removed
62/146: Q657822 --> P227 --> 1052839657 to be replaced by 1116106671
62/146: Q657822 --> P227 --> 1116106671 not to be removed
63/146: Q761717 --> P227 --> 1057080837 to be replaced by 1147220751
63/146: Q761717 --> P227 --> 1147220751 not to be removed
64/146: Q2049704 --> P227 --> 172495547 to be replaced by 117702986
64/146: Q2049704 --> P227 --> 117702986 not to be removed
65/146: Q2022296 --> P227 --> 139874577 to be replaced by 1065195877
65/146: Q2022296 --> P227 --> 1065195877 not to be removed
66/146: Q2005908 --> P227 --> 1014332877 to be replaced by 1055748393
66/146: Q2005908 --> P227 --> 1055748393 not to be removed
67/146: Q1765056 --> P227 --> 1061915174 to be replaced by 1147152403
67/146: Q1765056 --> P227 --> 1147152403 not to be removed
68/146: Q1818563 --> P227 --> 116411384 to be replaced by 133726622
68/146: Q1818563 --> P227 --> 133726622 not to be removed
69/146: Q1895938 --> P227 --> 106601784 to be replaced by 174142854
69/146: Q1895938 --> P227 --> 174142854 not to be removed
70/146: Q1918976 --> P227 --> 139678794 to be replaced by 1066381739
70/146: Q1918976 --> P227 --> 1066381739 not to be removed
71/146: Q1743987 --> P227 --> 126886709 to be replaced by 1012413799
71/146: Q1743987 --> P227 --> 1012413799 not to be removed
72/146: Q1786653 --> P227 --> 173750400 to be replaced by 174278586
72/146: Q1786653 --> P227 --> 174278586 not to be removed
73/146: Q1872749 --> P227 --> 1062447662 to be replaced by 1065933975
73/146: Q1872749 --> P227 --> 1065933975 not to be removed
74/146: Q2198220 --> P227 --> 172377692 to be replaced by 1147224838
74/146: Q2198220 --> P227 --> 1147224838 not to be removed
75/146: Q2149659 --> P227 --> 1062362969 to be replaced by 1061460126
75/146: Q2149659 --> P227 --> 1061460126 not to be removed
76/146: Q2177712 --> P227 --> 136194036 to be replaced by 133012697
76/146: Q2177712 --> P227 --> 133012697 not to be removed
77/146: Q2561245 --> P227 --> 173531156 to be replaced by 1142280187
77/146: Q2561245 --> P227 --> 1142280187 not to be removed
78/146: Q2501891 --> P227 --> 1062024060 to be replaced by 1062483847
78/146: Q2501891 --> P227 --> 1062483847 not to be removed
79/146: Q2547242 --> P227 --> 118554557 to be replaced by 1089936184
79/146: Q2547242 --> P227 --> 1089936184 not to be removed
80/146: Q2833698 --> P227 --> 1090361769 to be replaced by 11656203X
80/146: Q2833698 --> P227 --> 11656203X not to be removed
81/146: Q2836362 --> P227 --> 1062119819 to be replaced by 138229902
81/146: Q2836362 --> P227 --> 138229902 not to be removed
82/146: Q2940097 --> P227 --> 111294738 to be replaced by 1143737873
82/146: Q2940097 --> P227 --> 1143737873 not to be removed
83/146: Q3261403 --> P227 --> 17201395X to be replaced by 119247909
83/146: Q3261403 --> P227 --> 119247909 not to be removed
84/146: Q3407316 --> P227 --> 176970665 to be replaced by 1147253374
84/146: Q3407316 --> P227 --> 1147253374 not to be removed
85/146: Q3913010 --> P227 --> 132999005 to be replaced by 119182181
85/146: Q3913010 --> P227 --> 119182181 not to be removed
86/146: Q3990709 --> P227 --> 1050303113 to be replaced by 13479432X
86/146: Q3990709 --> P227 --> 13479432X not to be removed
87/146: Q4116640 --> P227 --> 1089274424 to be replaced by 102836167
87/146: Q4116640 --> P227 --> 102836167 not to be removed
88/146: Q5362803 --> P227 --> 1089806957 to be replaced by 1139392468
88/146: Q5362803 --> P227 --> 1139392468 not to be removed
89/146: Q6390348 --> P227 --> 172170389 to be replaced by 1090658559
89/146: Q6390348 --> P227 --> 1090658559 not to be removed
90/146: Q6795714 --> P227 --> 138280843 to be replaced by 189562447
90/146: Q6795714 --> P227 --> 189562447 not to be removed
91/146: Q7297924 --> P227 --> 172300088 to be replaced by 170611906
91/146: Q7297924 --> P227 --> 170611906 not to be removed
92/146: Q15433430 --> P227 --> 12285313X to be replaced by 115872051
92/146: Q15433430 --> P227 --> 115872051 not to be removed
93/146: Q15448569 --> P227 --> 1012401359 to be replaced by 116658088
93/146: Q15448569 --> P227 --> 116658088 not to be removed
94/146: Q15439523 --> P227 --> 136063780 to be replaced by 117087610
94/146: Q15439523 --> P227 --> 117087610 not to be removed
95/146: Q13407650 --> P227 --> 134879201 to be replaced by 1035313537
95/146: Q13407650 --> P227 --> 1035313537 not to be removed
96/146: Q14565861 --> P227 --> 173463622 to be replaced by 1090264054
96/146: Q14565861 --> P227 --> 1090264054 not to be removed
97/146: Q14545101 --> P227 --> 1028554443 to be replaced by 1082540072
97/146: Q14545101 --> P227 --> 1082540072 not to be removed
98/146: Q9697434 --> P227 --> 136424279 to be replaced by 116342846
98/146: Q9697434 --> P227 --> 116342846 not to be removed
99/146: Q15994693 --> P227 --> 128247444 to be replaced by 1076596320
99/146: Q15994693 --> P227 --> 1076596320 not to be removed
100/146: Q16065038 --> P227 --> 1055203877 to be replaced by 107352454X
100/146: Q16065038 --> P227 --> 107352454X not to be removed
101/146: Q15638583 --> P227 --> 1055742166 to be replaced by 1089223692
101/146: Q15638583 --> P227 --> 1089223692 not to be removed
102/146: Q15857756 --> P227 --> 1012273237 to be replaced by 119710935
102/146: Q15857756 --> P227 --> 119710935 not to be removed
103/146: Q15804770 --> P227 --> 170877361 to be replaced by 172172853
103/146: Q15804770 --> P227 --> 172172853 not to be removed
104/146: Q16979796 --> P227 --> 1116552272 to be replaced by 1137587075
104/146: Q16979796 --> P227 --> 1137587075 not to be removed
105/146: Q15453772 --> P227 --> 1012715892 to be replaced by 117394904
105/146: Q15453772 --> P227 --> 117394904 not to be removed
106/146: Q15841671 --> P227 --> 1155337298 to be replaced by 1142136868
106/146: Q15841671 --> P227 --> 1142136868 not to be removed
107/146: Q16733642 --> P227 --> 1074414381 to be replaced by 1089289383
107/146: Q16733642 --> P227 --> 1089289383 not to be removed
108/146: Q17576155 --> P227 --> 1136046402 to be replaced by 128685069
108/146: Q17576155 --> P227 --> 128685069 not to be removed
109/146: Q18021195 --> P227 --> 1055118454 to be replaced by 104255609
109/146: Q18021195 --> P227 --> 104255609 not to be removed
110/146: Q19283817 --> P227 --> 189529148 to be replaced by 134110676
110/146: Q19283817 --> P227 --> 134110676 not to be removed
111/146: Q17624731 --> P227 --> 1034678272 to be replaced by 120815958
111/146: Q17624731 --> P227 --> 120815958 not to be removed
112/146: Q19259763 --> P227 --> 189434244 to be replaced by 118879057
112/146: Q19259763 --> P227 --> 118879057 not to be removed
113/146: Q18625904 --> P227 --> 1062411587 to be replaced by 1129204022
113/146: Q18625904 --> P227 --> 1129204022 not to be removed
114/146: Q23000600 --> P227 --> 143318926 to be replaced by 189546778
114/146: Q23000600 --> P227 --> 189546778 not to be removed
115/146: Q23060466 --> P227 --> 172329884 to be replaced by 141659920
115/146: Q23060466 --> P227 --> 141659920 not to be removed
116/146: Q26162535 --> P227 --> 127541829 to be replaced by 1065776608
116/146: Q26162535 --> P227 --> 1065776608 not to be removed
117/146: Q24175494 --> P227 --> 1020442689 to be replaced by 115581308
117/146: Q24175494 --> P227 --> 115581308 not to be removed
118/146: Q19502401 --> P227 --> 172186803 to be replaced by 109556305X
118/146: Q19502401 --> P227 --> 109556305X not to be removed
119/146: Q20184559 --> P227 --> 1062926404 to be replaced by 1062313186
119/146: Q20184559 --> P227 --> 1062313186 not to be removed
120/146: Q20752655 --> P227 --> 174216815 to be replaced by 116363436
120/146: Q20752655 --> P227 --> 116363436 not to be removed
121/146: Q21033150 --> P227 --> 17022841X to be replaced by 172874718
121/146: Q21033150 --> P227 --> 172874718 not to be removed
122/146: Q19286911 --> P227 --> 1055599606 to be replaced by 1089726333
122/146: Q19286911 --> P227 --> 1089726333 not to be removed
123/146: Q19959759 --> P227 --> 1012379515 to be replaced by 189475447
123/146: Q19959759 --> P227 --> 189475447 not to be removed
124/146: Q20171592 --> P227 --> 101420838 to be replaced by 116157356
124/146: Q20171592 --> P227 --> 116157356 not to be removed
125/146: Q20724871 --> P227 --> 136861385 to be replaced by 1050543165
125/146: Q20724871 --> P227 --> 1050543165 not to be removed
126/146: Q19969691 --> P227 --> 117576026 to be replaced by 116906839
126/146: Q19969691 --> P227 --> 116906839 not to be removed
127/146: Q19897706 --> P227 --> 1043569162 to be replaced by 117746800
127/146: Q19897706 --> P227 --> 117746800 not to be removed
128/146: Q20243231 --> P227 --> 1050552822 to be replaced by 117060518
128/146: Q20243231 --> P227 --> 117060518 not to be removed
129/146: Q20752480 --> P227 --> 105328232X to be replaced by 1014468817
129/146: Q20752480 --> P227 --> 1014468817 not to be removed
130/146: Q19962804 --> P227 --> 1020681950 to be replaced by 116688602
130/146: Q19962804 --> P227 --> 116688602 not to be removed
131/146: Q20184766 --> P227 --> 1060151901 to be replaced by 1035014882
131/146: Q20184766 --> P227 --> 1035014882 not to be removed
132/146: Q19287093 --> P227 --> 122533801 to be replaced by 174072023
132/146: Q19287093 --> P227 --> 174072023 not to be removed
133/146: Q19904603 --> P227 --> 1127195573 to be replaced by 1136676783
133/146: Q19904603 --> P227 --> 1136676783 not to be removed
134/146: Q27074653 --> P227 --> 1055226818 to be replaced by 114716908X
134/146: Q27074653 --> P227 --> 114716908X not to be removed
135/146: Q26834243 --> P227 --> 141778040 to be replaced by 100492622
135/146: Q26834243 --> P227 --> 100492622 not to be removed
136/146: Q26196926 --> P227 --> 17205172X to be replaced by 12502682X
136/146: Q26196926 --> P227 --> 12502682X not to be removed
137/146: Q28003002 --> P227 --> 1077407130 to be replaced by 108277670X
137/146: Q28003002 --> P227 --> 108277670X not to be removed
138/146: Q27824197 --> P227 --> 1057263486 to be replaced by 172493781
138/146: Q27824197 --> P227 --> 172493781 not to be removed
139/146: Q53079205 --> P227 --> 17002427X to be replaced by 172046491
139/146: Q53079205 --> P227 --> 172046491 not to be removed
140/146: Q28949150 --> P227 --> 136863922 to be replaced by 189407492
140/146: Q28949150 --> P227 --> 189407492 not to be removed
141/146: Q34294818 --> P227 --> 184599555 to be replaced by 134124758
141/146: Q34294818 --> P227 --> 134124758 not to be removed
142/146: Q28973575 --> P227 --> 1090339844 to be replaced by 123712769
142/146: Q28973575 --> P227 --> 123712769 not to be removed
143/146: Q29293095 --> P227 --> 1130198340 to be replaced by 1129545377
143/146: Q29293095 --> P227 --> 1129545377 not to be removed
144/146: Q41497257 --> P227 --> 102230464X to be replaced by 142393657
144/146: Q41497257 --> P227 --> 142393657 not to be removed
145/146: Q43090799 --> P227 --> 106601539 to be replaced by 142490695
145/146: Q43090799 --> P227 --> 142490695 not to be removed
146/146: Q47463507 --> P227 --> 107656663 to be replaced by 1052838588
146/146: Q47463507 --> P227 --> 1052838588 not to be removed