------
## 最终结论
```python
def first(arr, target, n):
    for i in range(n):
        if arr[i] == target:
            return i
    return -1  # In case the target is not found

# Test cases
assert first([1,2,3,4,5,6,6],6,6) == 5
assert first([1,2,2,2,3,2,2,4,2],2,9) == 1
assert first([1,2,3],1,3) == 0
```