#abc286b. B - Cat

B - Cat

Score : 200200 points

问题描述

你将得到一个长度为 NN 的字符串 SS

要求你在字符串 SS 中,将所有连续出现的 na 替换为 nya,并找出替换后的字符串。

以上为通义千问 qwen-max 翻译,仅供参考。

Problem Statement

You are given a string SS of length NN.

Find the string obtained by replacing all contiguous occurrences of na in SS with nya.

Constraints

  • NN is an integer between 11 and 10001000, inclusive.
  • SS is a string of length NN consisting of lowercase English letters.

Input

The input is given from Standard Input in the following format:

NN

SS

Output

Print the answer.

Sample Input 1

4
naan

Sample Output 1

nyaan

Replacing all contiguous occurrences of na in naan with nya results in the string nyaan.

Sample Input 2

4
near

Sample Output 2

near

SS may not contain a contiguous na.

Sample Input 3

8
national

Sample Output 3

nyationyal

update @ 2024/3/10 11:57:03

}