• محدودیت زمان: ۱ ثانیه
  • محدودیت حافظه: ۲۵۶ مگابایت

Several balloons are arranged sequentially, each showing one of the letters from a to z. Amin wants to give a needle to Niloufar and ask her to select one or more balloons so that after popping them and joining the remaining balloons (without changing their order), he can reach a state where exactly 44 balloons remain in sequence, with the letters acpc written on them in order.

توضیح تصویر

You need to write a program that, given the initial arrangement of balloons, determines whether this is possible or not.

ورودی

The first line of input contains a positive integer tt, representing the number of test cases.

1t1041 \leq t \leq 10^4

In each test case, there is a single string ss, consisting of lowercase English letters, showing the sequence of letters written on the balloons.

1s1001 \leq |s| \leq 100

خروجی

For each test case, print YES if it is possible to form the word acpc; otherwise, print NO.

مثال‌ها

ورودی نمونه ۱

2
amirkabirprogrammingcontest
amirkabircollegiateprogramcontest
Plain text

خروجی نمونه ۱

NO
YES
Plain text

ارسال پاسخ برای این سؤال
فایلی انتخاب نشده است.