Under construction

Still being built. Things may change

Palindromic FizzBuzz

Interview

Time limit1sMemory limit512 MB

Summary
Print every integer from S to E, replacing any palindromic number with the string Palindrome!.
Level

Easy3 of 10

Topics
Implementation, Math, String, Brute force
Solved
No attempts yet

Problem

Gug finds the classic FizzBuzz problem too boring, so he decided to add a twist to it. Print a list of consecutive integers, one per line, starting with S on the first line and ending with E on the last line. Since Gug likes palindromes, print the string Palindrome! in place of an integer if that integer is palindromic, that is, if it reads the same forwards and backwards.

Input

Your program reads from standard input. The input is a single line containing two integers, S and E.

Output

Your program writes to standard output. Print E − S + 1 lines, each containing either an integer or the string Palindrome! if that integer is palindromic.

Constraints

  • 1 ≤ S ≤ E ≤ 10^18
  • E − S + 1 ≤ 10^5

Examples3

  1. Example 1

    Input
    8 13
    
    Expected output
    Palindrome!
    Palindrome!
    10
    Palindrome!
    12
    13
    
  2. Example 2

    Input
    3 3
    
    Expected output
    Palindrome!
    
  3. Example 3

    Input
    999999997 1000000000
    
    Expected output
    999999997
    999999998
    Palindrome!
    1000000000