102861: [AtCoder]ABC286 B - Cat

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:1 Solved:0

Description

Score : $200$ points

Problem Statement

You are given a string $S$ of length $N$.

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

Constraints

  • $N$ is an integer between $1$ and $1000$, inclusive.
  • $S$ is a string of length $N$ consisting of lowercase English letters.

Input

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

$N$
$S$

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

$S$ may not contain a contiguous na.


Sample Input 3

8
national

Sample Output 3

nyationyal

Input

题意翻译

给定一个长度为 $n$ 的只包含小写字母的字符串 $s$,我们对 $s$ 进行如下操作: - 对于 $s$ 的每一个子串 `na`,将 `na` 变为 `nya`。 求操作完毕后的结果。 保证 $1 \le n \le 1000$。 翻译提供者:@\_\_Allen\_123\_\_

Output

得分:200分 部分 问题描述 你得到一个长度为N的字符串S。 找出将S中的所有连续的na替换为nya得到的字符串。 部分 约束 * N是一个介于1和1000之间的整数,包括1和1000。 * S是一个长度为N的字符串,由小写英文字母组成。 输入输出格式 输入 输入通过标准输入以以下格式给出: N S 输出 打印答案。 部分 样例输入1 4 naan 样例输出1 nyaan 将naan中的所有连续的na替换为nya得到nyaan。 部分 样例输入2 4 near 样例输出2 near S可能不包含连续的na。 部分 样例输入3 8 national 样例输出3 nyationyal

加入题单

算法标签: