Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

var sc = bufio.NewScanner(os.Stdin)

//Sliceconvtoi ...
func Sliceconvtoi() []int {
	strs := strings.Split(sc.Text(), " ")

	var ints []int
	var x int

	for _, s := range strs {
		x, _ = strconv.Atoi(s)
		ints = append(ints, x)
	}

	return ints
}

func isLeapYear(y int) bool {
	return (y%4 == 0 && y%100 > 0) || (y%4 == 0 && y%400 == 0)
}

func cntLeap(y []int) {
	cnt := 0

	for i := y[0]; i <= y[1]; i++ {
		if isLeapYear(i) {
			cnt++
			fmt.Println(i)
		}
	}

	if cnt == 0 {
		fmt.Println("NA")
	}
}

func main() {
	num := 0

	for sc.Scan() {
		y := Sliceconvtoi()

		if y[0] == 0 && y[1] == 0 {
			break
		}

		if num > 0 {
			fmt.Println()
		}

		cntLeap(y)
		num++
	}

}

Python: cnt = 0
while True:
  a, b = map(int, input().split())
  if a + b == 0:
    break
  flag = True
  if cnt != 0:
    print()
  for i in range(a, b + 1):
    if i % 4 == 0:
      if i % 100 == 0:
        if i % 400 == 0:
          flag = False
          print(i)
      else:
        flag = False
        print(i)
  if flag == True:
    print("NA")
  cnt += 1

Python: def f(a, b):
    flg = False
    for x in range(a, b + 1):
        if x % 4 == 0 or x % 400 == 0:
            if not flg:
                flg = True
            print(x)
    if not flg:
        print('NA')


while True:
    _a, _b = map(int, input().split())
    if _a == _b == 0:
        break
    f(_a, _b)

Python: def get_data():
    while True:
        a, b = map(int, input().split())
        if a == b == 0:
            break
        yield a, b


input_data = list(get_data())
for i, data in enumerate(input_data):
    a, b = data
    flg = False
    for x in range(a, b + 1):
        if (x % 4 == 0 and x % 100 != 0) or x % 400 == 0:
            if not flg:
                flg = True
            print(x)
    if not flg:
        print('NA')
    if i != len(input_data) - 1:
        print()

Python: from calendar import isleap
f = lambda x: map(str, x) if x else ["NA"]
ans = []
while True:
    a, b = map(int, input().split())
    if b == 0:
        break
    ans += f(filter(isleap, range(a, b+1))) + [""]
print("\n".join(ans).strip())

Python: a, b = map(int, input().split())
while True:
    uru = [str(i) for i in range(a, b+1) if i % 400 == 0 or (i % 4 == 0 and i % 100 != 0)]
    result = '\n'.join(uru)

    if not result:
        result = 'NA'
    print(result)

    a, b = map(int, input().split())
    if a + b == 0: break
    print()

Python: year = input()
bb = year.split(' ')
a = bb[0]
b = bb[1]
ans = 0
for i in range(a,b+1):
    if i%4==0:
        ans += 1
    if 1%100==0:
        ans -= 1
    if 1%400==0:
        ans += 1
if ans == 0:
    print('NA')
else:
    print(ans)

Python: def isleap(a):return a%4==0 and a%100 or a%400==0
f=0
while 1:
    a,b=map(int,input().split())
    if not a: break
    if f:print()
    f,c=1,1
    for i in range(a,b+1):
        if isleap(i):
            print(i)
            c=0
    if c:print('NA')

Python: import calendar
flag=False
while 1:
    a,b=map(int,input().split(" "))
    if a==b==0:break
    if flag:print()
    leaps=list(filter(calendar.isleap,range(a,b+1)))
    if not leaps:
        print("NA")
    else:
        for i in leaps:
            print(i)
    flag=True

Python: first = True

while 1:
    a, b = map(int, input().split())
    if a == 0 and b == 0:
        break

    if first:
        first = False
    else:
        print()

    anslist = []
    for i in range(a, b+1):
        if i % 400 == 0:
            anslist.append(i)
        elif i % 100 == 0:
            pass
        elif i % 4 == 0:
            anslist.append(i)

    if anslist == []:
        print("NA")
    else:
        for ans in anslist:
            print(ans)

Python: # -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0093
???????????´
"""
import sys
from calendar import isleap

def is_leap(year):
    ''' ?????????????????´??? ???????????´ ???????????????True/False??§?????? (callendar.isleap(year) ??¨??????) '''
    if year % 400 == 0:
        return True
    elif year % 100 == 0:
        return False
    elif year % 4 == 0:
        return True
    else:
        return False


def main(args):
    is_first__dataset = True  # 2????????\?????????????????????????????´?????????????????????????????????????????\???????????????????????°
    leap_years = []  # ???????????´????????????
    # ??????????????\???
    while True:
        start_year, end_year = [int(x) for x in input().strip().split(' ')]
        if start_year == 0 and end_year == 0:
            break
        else:
            # ???????????????
            leap_years = []
            for year in range(start_year, end_year+1):
                if isleap(year):  # calendar.isleap()????????¨
                    leap_years.append(year)

        # ???????????????
        if is_first__dataset == True:
            is_first__dataset = False
        else:
            print('')  # 2????????\????????????????????????????????§??????????????????????????\??????

        if len(leap_years) == 0:
            print('NA')
        else:
            print('{0}'.format('\n'.join(map(str, leap_years))))

if __name__ == '__main__':
    main(sys.argv[1:])

Python: flag = 1
while True:
    a, b = map(int, input().split())
    if a == b == 0:
        quit()
    if flag == 0:
        print()
    else:
        flag = 0
    count = 0
    for i in range(a, b+1):
        if i % 400 == 0:
            print(i)
            count += 1
        elif i % 100 != 0 and i % 4 == 0:
            print(i)
            count += 1
    if count == 0:
        print('NA')

Python: import calendar as C
j=0
while 1:
    a,b=map(int, input().split())
    if a==0:break
    if j:print()
    j=1
    if sum([1 for i in range(a,b+1) if C.isleap(i)])==0:
        print("NA")
    else:
        for i in range(a,b+1):
            if C.isleap(i):print(i)

Python: # -*- coding: utf-8 -*-
i = 0
while True:
    a, b = map(int, input().split())

    if a == 0 and b == 0:
        break
    elif i != 0:
        print()

    found = False
    for y in range(a, b + 1):
        if y % 4 == 0 and (y % 100 != 0 or y % 400 == 0):
            found = True
            print(y)
    if not found:
        print('NA')
        
    i += 1

Python: while True:
    a, b = map(int, input().split())
    if a == b == 0: break

    count = 0
    for y in range(a, b + 1):
        if y % 400 == 0 or y % 4 == 0 and y % 100 != 0:
            count += 1
            print(y)
    if count == 0:
        print('NA')
    print()

C++: #include<iostream>
using namespace std;
bool leap(int Y){
  if(Y%4==0)
    return( (Y%100==0)?( (Y%400==0)?true:false ):true ); 
  else return false;
}

int main(){
  int Y,aY;
  int cont=0;
  while(cin>>Y>>aY){
    if(Y==0 && aY==0) break;
    for(int i=Y;i<=aY;i++) if(leap(i)){
	cout<<i<<endl;
	cont++;
      }
    if(cont==0) cout<<"NA"<<endl;
    cout<<endl;
    cont=0;
  }
}

C++: #include <stdio.h>

int isLeap(int y) {
  if(y%4==0) {
    if(y%400==0) return 1;
    else if(y%100==0) return 0;
    return 1;
  } else return 0;
}

main() {
  int fst=0;
  int cnt;
  int i,a,b;
  while(scanf("%d %d",&a,&b),a!=0&&b!=0) {
    if(!fst) fst++;
    else puts("");
    cnt=0;
    for(i=a;i<=b;i++) {
      if(isLeap(i)) {printf("%d\n",i);cnt++;}
    }
    if(cnt==0) puts("NA");
  }
}

C++: #include <bits/stdc++.h>
using namespace std;

int main(){
    int a,b;
    con >>a>>b;
    for(int i=a;i<b+1;i++){
        if(i%4==0){
            ans += 1
        }
        if(i%100==0){
            ans -= 1
        }
        if(i%400==0){
            ans += 1
        }
    }
    if(ans == 0){
        cout <<"NA"<<endl;
    }else{
        cout <<ans<<endl;
    }

    
    
return 0;
}