#!/usr/bin/env python
from __future__ import print_function
import json


with open('entities.json', 'r') as file:
#   x = file.read()
    x = json.load(file)

# y = json.loads(x)

# print(y["&AElig"])
# print(x)
# print(json.dumps(x, indent = 4, sort_keys=True))
# print(y['codepoints'])

#nums = [0, 1]
for e in x:
#    for d in nums:
    #pairs = e.items()
    #for key in pairs:
    #    print(key, end=" ")
    string = "{\"" + e + "\","
    #stringb = """
    print(string, end=" ")
    if len(x[e]["codepoints"]) > 1:
        #print(x[e][], end=" ")
        string = str(x[e]["codepoints"][0]) + ", " + str(x[e]["codepoints"][1]) + "},"
        #print(x[e]["codepoints"][0], end=" ")
        #print(x[e]["codepoints"][1], end="\n")
    else:
        string = str(x[e]["codepoints"][0]) + ", 0},"
        #print(x[e][], end=" ")
        #print(x[e]["codepoints"][0], end="\n")

    print(string, end="\n")


#        try:
#            print(x[e]["codepoints"][0], end=" ")
#            print(x[e]["codepoints"][1], end="\n")
#        except IndexError:
#            print(x[e]["codepoints"][0], end="\n")
#    print()
