B - Cat
Editorial
/


Time Limit: 2 sec / Memory Limit: 1024 MB
配点 : 点
問題文
長さ の文字列 が与えられます。
に連続して含まれる na
を全て nya
に置き換えて得られる文字列を答えてください。
制約
- は 以上 以下の整数
- は英小文字からなる長さ の文字列
入力
入力は以下の形式で標準入力から与えられる。
出力
答えを出力せよ。
入力例 1Copy
Copy
4 naan
出力例 1Copy
Copy
nyaan
naan
に連続して含まれる na
を全て nya
に置き換えて得られる文字列は nyaan
です。
入力例 2Copy
Copy
4 near
出力例 2Copy
Copy
near
に na
が連続して含まれないこともあります。
入力例 3Copy
Copy
8 national
出力例 3Copy
Copy
nyationyal
Score : points
Problem Statement
You are given a string of length .
Find the string obtained by replacing all contiguous occurrences of na
in with nya
.
Constraints
- is an integer between and , inclusive.
- is a string of length consisting of lowercase English letters.
Input
The input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1Copy
Copy
4 naan
Sample Output 1Copy
Copy
nyaan
Replacing all contiguous occurrences of na
in naan
with nya
results in the string nyaan
.
Sample Input 2Copy
Copy
4 near
Sample Output 2Copy
Copy
near
may not contain a contiguous na
.
Sample Input 3Copy
Copy
8 national
Sample Output 3Copy
Copy
nyationyal