Help me in solving HOOPS problem

My issue

It s not passing subtask

My code

t=int(input())
for i in range(t):
    p=int(input())
    if  p==1:
        print(p)
    elif p%3==0:
        print(p-1)
        

Problem Link: CodeChef: Practical coding for everyone