# Algoritms

### Вставка subcategories

1. Read autocomplete page
2. Read all categories to { }
3. Sort alpha-ly
4. Sum all cat-s with 30 days period
5. Sort these cat-s relatively to sums (\`priority order\`)
6. Sort all cat-s relatively to \`priority order\`
