import json, sys
seen = set()
for event in json.load(open(sys.argv[1], encoding='utf-8')):
    identity = ':'.join((event['accountId'], event['region'], event['instanceId']))
    event_key = (identity, event['eventId'])
    if event_key in seen:
        continue
    seen.add(event_key)
    print(json.dumps({'externalIdentity': identity, 'sourceEvent': event['eventId'],
        'action': 'reconcile-existing-host', 'destructiveCleanupApproved': False}))
