{% for account_name, account_results in results.items() %}
<h3>{{ account_name }} Reserved Instances Report</h3>
  <hr>
  {% for result in account_results %}
    {% for service, results_list in result.items() %}
      <p><strong>Below is the report on {{ service }} reserved instances:</strong></p>
      {% if results_list[0] %}
        <table>
          <thead>
            <th>Used/Unused</th>
            <th>Count</th>
            <th>Type</th>
            <th>AZ</th>
            <th>Details</th>
          </thead>
          {% for type, count in results_list[0].items() %}
            <tr>
              <td>UNUSED RESERVATION!</td>
              <td>{{ count }}</td>
              <td>{{ type[0] }}</td>
              <td>{{ type[1] }}</td>
              <td>
                {% if reserve_expiry %}
                  Expires in {{ reserve_expiry[type]|string }} days.
                {% endif %}
              </td>
            </tr>
          {% endfor %}
        </table>
      {% else %}
        <p>You have no unused {{ service }} reservations.</p>
      {% endif %}
      {% if results_list[1] %}
        <table>
          <thead>
            <th>Used/Unused</th>
            <th>Count</th>
            <th>Type</th>
            <th>AZ</th>
            <th>Details</th>
          </thead>
          {% for type, count in results_list[1].items() %}
            <tr>
              <td>NOT RESERVED!</td>
              <td>{{ count }}</td>
              <td>{{ type[0] }}</td>
              <td>{{ type[1] }}</td>
              <td>
                {% if instance_ids %}
                  {{ ", ".join(instance_ids[type]) }}
                {% endif %}
              </td>
            </tr>
          {% endfor %}
        </table>
      {% else %}
        <p>You have no unreserved {{ service }} instances.</p>
      {% endif %}
      <p>({{ results_list[2] }}) running on-demand {{ service }} instances</p>
      <p>({{ results_list[3] }}) {{ service }} reservations</p>
    {% endfor %}
  {% endfor %}
  <hr>
{% endfor %}
