#CCBOTPBA0000049. Liệt kê các năm nhuận trong đoạn (List Leap Years in an Interval)

Liệt kê các năm nhuận trong đoạn (List Leap Years in an Interval)

List Leap Years in an Interval

Source: Phước Hưng OJ

Version: Phuoc Hung OJ Extended

Problem Statement

Given two Gregorian calendar years LL and RR with L≤RL\le R, list all leap years from LL through RR, including both endpoints. A year is a leap year if it is divisible by 400400, or if it is divisible by 44 but not by 100100. If the interval contains no leap year, print NONE.

Input

One line contains two integers LL and RR, in this order.

Output

Print all leap years in increasing order, one per line. If there are none, print a single line NONE.

Subtasks

  • Subtask 1 (20%): 1≤L≤R≤18991\le L\le R\le1899.
  • Subtask 2 (30%): 1≤L≤R≤20991\le L\le R\le2099.
  • Subtask 3 (50%): 1≤L≤R≤99991\le L\le R\le9999.

Examples

Example 1

Input:

1896 1904

Output:

1896
1904

Explanation: 1896 is divisible by 4 but not 100. 1900 is divisible by 100 but not 400, so it is excluded. 1904 is a leap year. Therefore two lines are printed.

Example 2

Input:

2000 2000

Output:

2000

Explanation: The year 2000 is divisible by 400, so it is a leap year even though it is also divisible by 100.

Example 3

Input:

1900 1903

Output:

NONE

Explanation: 1900 is not leap; 1901, 1902 and 1903 are not divisible by 4. Hence there is no leap year.