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++
	}

}

C++: #include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <utility>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <stack>
#include <queue>
 
using namespace std;
 
#define pb(n)	push_back(n)
#define mp(n,m) make_pair(n,m)
#define fi 	first
#define se 	second
#define all(r) (r).begin(),(r).end()

#define rep(i,n) for(int i=0; i<(n); i++)
#define repc(i,a,b) for(int i=(a); i<(b); i++)

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
 
const int IMAX=((1<<30)-1)*2+1;
const double EPS=1e-10;
//int mod=1000000007



bool is_Leap(int n){
	if(n%400==0)return true;
	if(n%100==0)return false;
	if(n%4==0)return true;
	return false;
}


int main(){
	int a,b;
	bool f=false;
	while(cin>>a>>b){
		if(a==0&&b==0)break;
		if(f)cout<<endl;
		else f=true;
		vi v;
		for(int i=a; i<b; i++){
			if(is_Leap(i))v.pb(i);
		}
		if(v.empty())cout<<"NA"<<endl;
		else{
			rep(i,v.size()){
				cout<<v[i]<<endl;
			}
		}
	}
}

C++: #include <stdio.h>

int main(void)
{
    int a, b, year, answer, i;
    i = 0;
    while(1) {
	scanf("%d %d", &a, &b);
	if (a == 0 && b == 0) {
	    break;
	}
	if (i !=0) {
	    pritnf("\n");
	i++;
	answer = 0;
	for (year = a; year <= b; year++) {
	    if (year % 4 == 0) {
		if (year % 100 != 0) {
		    printf("%d\n", year);
		    answer++;
		} else if (year % 400 == 0) {
		    printf("%d\n", year);
		    answer++;
		}
	    }
	}
	if (answer == 0) {
   	    printf("NA\n");
	}
    }
    return 0;
}

C++: #include <iostream>

using namespace std;

bool isLeap(int y){
	if(y % 400 == 0) return true;
	if(y % 100 == 0) return false;
	if(y % 4 == 0) return true;
	return false;
}

int main(){
	int a, b;
	bool f = false;
	while(true){
		cin >> a >> b ;
		if(a == 0 && b == 0) return 0;

		if(f) { cout << endl; }
		f = false;
		for (int i = a; i < b + 1; i++){
			if(isLeap(i)) {
				cout << i << endl;
				f = true;
			}
		}
		if(!f) { cout << "NA" << endl; }
	}
	return 0;
}

C++: #include <stdio.h>
#include <stdbool.h>

void leapyear (int year1, int year2)
{
    int i;
    int j = 0; 
    for (i = year1; i <= year2; ++i) {
        if (i % 4 == 0) {
            if (i % 100 != 0) {
                printf("%d\n", i);
                ++j;
            } else if (i % 400 == 0) {
                printf("%d\n", i);
                ++j;
            } 
        }
    }
    if (j == 0) {
        printf("NA\n");
    }
    printf("\n");
}

int main(void)
{
    while (true) {
        int year1, year2;
        scanf("%d %d", &year1, &year2);
        if (year1 == 0 && year2 == 0) {
            break;
        }
        leapyear(year1, year2);
    }
    return 0;
}

C++: #include<stdio.h>

void leap(int x, int y)
{
    int count = 0;

    for(int i = x; i < y; i++) {
        if (((i % 4 == 0) && (i % 100 != 0)) || (i % 400 == 0)) {
            printf("%d\n", i);
            count = 1;
        }
    }

    if (count == 0) {
        printf("NA\n");
    }
}

int main(void)
{
    int num1, num2;

    scanf("%d %d", &num1, &num2);

    while ((num1 != 0) || (num2 != 0)) {
        leap(num1, num2);

        scanf("%d %d", &num1, &num2);
    }

    return 0;
}

C++: #include <iostream>
using namespace std;

int func(int a){return (!(a%4))-(!(a%100))+(!(a%400));}

int main(){
	int a, b, f = 0;
	while(cin >> a >> b, a+b){
		if(f)cout << endl;f = 1;
		int u = 1;
		for(int i = a;i <= b;i++){
			if(func(i))cout << i << endl, u = 0;
		}
		if(u)cout << "NA" << endl;
	}
	return 0;
}

C++: #include <functional>
#include <algorithm>
#include <iostream>
#include <numeric>
#include <iomanip>
#include <utility>
#include <cstdlib>
#include <sstream>
#include <bitset>
#include <vector>
#include <cstdio>
#include <ctime>
#include <queue>
#include <deque>
#include <cmath>
#include <stack>
#include <list>
#include <map>
#include <set>

using namespace std;

typedef vector<int> vi;
typedef pair<int,int> pii;
typedef long long ll;

#define dump(x)  cerr << #x << " = " << (x) << endl
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back

bool isLeep(int n){
    if((n%4==0 && n%100!=0) || n%400==0){
        return true;
    }
    else return false;
}


int main() {
    int a,b;
    bool flag=false;
    while(cin>>a>>b){
        if(a==0 && b==0)break;
        if(flag)cout<<endl;
        flag=true;
        
        int c=0;
        for(int i=a;i<=b;i++){
            if(isLeep(i)){
                c++;
                cout<<i<<endl;
            }
        }
        if(c==0)cout<<"NA"<<endl;
    }
    
    return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
	int n1,n2;
	while(cin >> n1 >> n2){
		if(!(n1&&n2)) break;
		bool f = false;
		for(int year=n1; year<=n2; year++){
			if(year%400==0 || (year%4==0&&year%100!=100) ){
				f = true;
				cout << year << endl;
			}
		}
		if(!f) cout << "NA" << endl;
		cout << endl;
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
	while(true){
		int a,b;
		cin>>a>>b;
		if(a==0 && b==0){break;}
		for(int i=a;i<=b;i++){
			if(i%400==0){cout<<i<<endl;}
			else if(i%4==0 && i%100>=1){cout<<i<<endl;}
		}
		cout<<endl;
	}
}

C++: #include <stdio.h>
void leapmaker(int start, int end);
int main(void){
    int Year1, Year2;
    while(1)
    {
        scanf("%d %d", &Year1, &Year2);
        if (Year1 == 0 && Year2 == 0)
        {
            break;
        }
        leapmaker(Year1, Year2);
        printf("\n");
    }
    return 0;
}
void leapmaker(int start, int end){
    int naflag = 1;
    for(int i = start + start % 4; i <= end; i += 4){
        if (i % 100 == 0)
        {
            if (i % 400 == 0)
            {
                printf("%d\n", i);
                naflag = 0;
            }
        } else {
            naflag = 0;
            printf("%d\n", i);
        }
    }
    if (naflag == 1)
    {
        printf("NA\n");
    }
}