import json, sys
with open('/tmp/w6_d1_routine.json') as f:
    data = json.load(f)
exs = data.get('exercises', [])
print('TOTAL EXERCISES:', len(exs))
for ex in exs:
    print(f"  [{ex.get('index')}] {ex.get('title')} rest={ex.get('rest_seconds')}")
    for s in ex.get('sets', []):
        wt = s.get('weight_kg')
        rr = s.get('rep_range')
        dur = s.get('duration_seconds')
        if dur:
            print(f"     [{s.get('type')}] duration={dur}s")
        else:
            print(f"     [{s.get('type')}] wt={wt} rr={rr}")
