Under construction

Still being built. Things may change

IGRUS and the Restroom

Time limit1sMemory limit1024 MB

Summary
Given the floor K and the mascot's body size, find the nearest floor with a restroom that fits it: odd floors for Annyong, even floors for Induck.
Level

Easy1 of 10

Topics
Implementation
Solved
No attempts yet

Problem

IGRUS is short for Inha Group of Research for Unix Security, an academic student club under the Jeongtongcheo that started in 2000. The IGRUS clubroom is a two-story space with NN floors numbered 1 to NN. Odd-numbered floors have a restroom for large animals, and even-numbered floors have a restroom for small animals.

Inha University's mascots are Annyong, a dragon, and Induck, a duck. A dragon is a large animal, and a duck is a small animal. Write a program for Annyong and Induck when they visit the IGRUS clubroom. When either one (Annyong or Induck) is on floor KK, the program finds the floor of the nearest restroom that fits its body size.

Input

The first line contains the number of floors NN of the IGRUS clubroom.

The second line contains annyong if the mascot is Annyong, or induck if the mascot is Induck.

The third line contains the floor KK where the mascot is currently located.

Output

Print one integer that is a valid answer to the problem.

If several integers are valid, any of them is accepted.

Constraints

2≤N≤20,0002 \le N \le 20{,}000

1≤K≤N1 \le K \le N

Examples2

  1. Example 1

    Input
    5
    annyong
    4
    
    Expected output
    5
    
  2. Example 2

    Input
    20
    induck
    8
    
    Expected output
    8