#!/usr/bin/env python3

import sys
import json
import re
def main():
    if len(sys.argv) < 2:
        # print('usage: [script] [json file]')
        sys.exit(1)
        return
    
    with open(sys.argv[1], 'r') as f:
        d = json.load(f)
    
    # print(d,type(d))

    pat = re.compile('http://[^/:]+:(\d+)')
    for k, v in d.items():
        if 'HRIComponent' in k:
            # print(k,'###',v['url'])
            m = pat.search(v['url'])
            if m is not None:
                print(m.group(1))

if __name__ == '__main__':
    main()