use list comprehension!
```python
tmp = [mn[j] for j in range(n) if i & (1 << j)]
```