406468: GYM102419 A Two Strings

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

Description

A. Two Stringstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

Ayoub has two strings $$$a$$$ and $$$b$$$ and he should do this operation exactly once with these strings.

He should pick two integers $$$x$$$ and $$$y$$$ $$$(x \neq y)$$$, such that after swapping $$$a_x$$$ with $$$a_y$$$ and $$$b_x$$$ with $$$b_y$$$, string $$$a$$$ becomes lexicographically greater than string $$$b$$$.

Is there there any possible way to do it?

Input

The first line contains one integer $$$n$$$ $$$(2 \leq n \leq 10^{5})$$$.

The second line contains the string $$$a$$$ of size $$$n$$$.

The third line contains the string $$$b$$$ of size $$$n$$$.

All characters in both strings are lowercase English letters.

Output

If there is no way to do the swap so that string $$$a$$$ is lexicographically greater than string $$$b$$$ print NO on a line.

Otherwise, print YES on a line. On a new line print two integers $$$x$$$ and $$$y$$$ $$$(1 \leq x , y \leq n)$$$ $$$(x \neq y)$$$.

ExamplesInput
3
abc
abc
Output
NO
Input
3
zzz
aaa
Output
YES
2 3

Source/Category

加入题单

算法标签: