from collections import defaultdict


input = [
  {
    "nm": "Edmund lronside",
    "cty": "United Kingdom",
    "hse": "House of Wessex",
    "yrs": "1016"
  },
  {
    "nm": "Cnut",
    "cty": "United Kingdom",
    "hse": "House of Denmark",
    "yrs": "1016-1035"
  },
  {
    "nm": "Harold I Harefoot",
    "cty": "United Kingdom",
    "hse": "House of Denmark",
    "yrs": "1035-1040"
  }
  ]
