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>
using namespace std;

int main()
{
	int a,b,i,flag;
	cin>>a>>b;
	flag = 2;
	while(b!=0){
		if(flag!=2)
			cout<<"\n";
		for(i=a;i<=b;i++){
			if(i%400==0){
				cout<<i<<"\n";
				flag=1;
			}
			else if(i%4==0 && i%100!=0){
				cout<<i<<"\n";
				flag = 1;
			}
		}
	     if(flag !=1)
			 cout<<"NA\n";
		cin>>a>>b;
		flag = 0;
	}

	return 0;
}

C++: #include <iostream>
#include <string>
#include <map>
#include <vector>
#include <utility>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <cmath>

#define rep(i,j,k) for(int i=(int)j;i<(int)k;i++)
#define itrep(i,x) for(auto i=(x).begin(); i!=(x).end();i++)
#define Sort(x) sort((x).begin(),(x).end())
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define vec vector
#define INF (int)1e9
#define INFL 1e18
#define MOD 1000000007
#define pb push_back
#define MP make_pair
#define PI 3.1415926535
typedef long long int ll;
typedef std::pair<int,int> P;
int D=1;
int dx[4]={0,1,0,-1},dy[4]={-1,0,1,0};

using namespace std;

int main(){
    int a,b;
    while(cin>>a>>b&&a){
        bool f=true;
        rep(i,a,b+1){
            int n=i;
            if(n%400==0){
                cout<<i<<endl;
                f=false;
            }
            else if(n%100&&n%4==0){
                cout<<i<<endl;
                f=false;
            }
        }
        if(f)cout<<"NA"<<endl;
        cout<<endl;
    }

    return 0;
}

C++: include <stdio.h>
	
int uruu(int first, int end)
{
	int count = 0;
	for (int i = first; i < end + 1; i++) {	
		if (i % 400 == 0 && i % 100 != 0) {
			printf("%d\n", i);
			count = count + 1;
		} else if (i % 100 == 0) {
			i = i + 3;
		} else if (i % 4 == 0) {
			printf("%d\n", i);
			count = count + 1;
		}
	}
	if (count == 0) {
		printf("NA\n");
	}
}
	
int main(void)
{	
	while (1) {
		static int first, end;
		scanf("%d %d", &first, &end);
		if (first == 0 && end == 0) {
			break;
		} else {
			uruu(first, end);
			printf("\n");
		}
	}
}

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

int main(){
    int A=-1,B=-1;
    while(cin>>A>>B, A||B){
        if(~A || ~B) puts("");
        bool no = true;
        for(int i=A;i<=B;i++){
            if(i%4==0 && (i%100!=0 || i%400==0)) printf("%d\n",i), no = true;
        }
        if(no) puts("NA");
    }
    return 0;
}

C++: #include<cstdio>
main(){int a,b,c,d=0;while(scanf("%d%d",&a,&b),a){d++&&puts("");for(c=0;a<=b;a++)if(a%4<1&&a%25||a%16<1)printf("%d\n",c=a);!c&&puts("NA");}}

C++: #include <stdio.h>

int leap_year(int, int);

int main(void)
{
	int a, b;
	while (1) {
		scanf("%d %d", &a, &b);
		if (a == 0 && b == 0) 
			break;
		leap_year(a, b);
	}
	return 0;
}

int leap_year(int a, int b)
{
	int leap_year_number = 0;
	for (int i = a; i <= b; i++) {
		if ((i % 4 == 0 && i % 100 != 0) || i % 400 == 0) {
			printf("%d\n", i);
			leap_year_number += 1;
		}
	}
	if (leap_year_number == 0) {
		printf("NA\n");
	}
	printf("\n");
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(void){
    int a,b,us,ue;
    while(cin>>a>>b&&a!=0&&b!=0){
        for(int i=0;i<8;i++){
            if(((a+i)%4==0&&(a+i)%100!=0)||(a+i)%400==0){
                us=a+i;
                break;
            }
        }
        for(int j=0;j<8;j++){
            if(((b-j)%4==0&&(b-j)%100!=0)||(b-j)%400==0){
                ue=b-j;
                break;
            }
        }
        if(us>=ue) cout<<"NA"<<endl;
        else{
            for(int k=us;k<=ue;k+=4){
                if((k%4==0&&k%100!=0)||k%400==0){
                    cout<<k<<endl;
                } 
            }
        }
    cout<<endl<<endl;    
    }
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cmath>
#include <functional>
#include <numeric>
#include <iomanip>
#define fi first
#define se second
#define fcout(n) cout<<fixed<<setprecision((n))
#define cinl(str) getline(cin,(str))
using namespace std;
bool value(int y,int x,int R,int C){return 0<=y&&y<R&&0<=x&&x<C;}
typedef pair<int,int> pii;
typedef long long ll;
typedef vector<int> vi;
typedef vector<long long > vll;
typedef vector< vi > vvi;
double pie=acos(-1);
int INF=10000009;
int dx[4] = { 0,-1,0,1 };
int dy[4] = { -1,0,1,0 };
int main() {
	int a,b;
	int x=0;
	while(true){
		cin>>a>>b;
		if(a+b==0) break;
		for(int i=a;i<=b;i++){
			if((i%4==0&&i%100!=0)||i%400==0){
				cout<<i<<endl;
				x++;
			}
			if(i==b&&x==0){
				cout<<"NA"<<endl;
			}
		}
		x=0;
		cout<<endl;
	}
}

C++: #include<stdio.h>
int main(void)
{
	int y,y2;
	int i;
	int flg,flg2;
	flg=0;

	scanf("%d %d",&y,&y2);
	while(y!=0 && y2!=0){
		if(flg==0){
			flg=1;
		}
		else{
			printf("\n");
		}
		flg2=0;
		for(i=y;i<=y2;i++){
			if(y%400==0){
				printf("%d\n",y);
				flg2=1;
			}
			 if(y%4==0){
				if(y%100!=0){
					printf("%d\n",y);
				flg2=1;
				}
			}
			y++;
		}
		if(flg2==0){
			printf("NA\n");
		}
		scanf("%d %d",&y,&y2);
	}
	return 0;
}

C++: #include <iostream>

using namespace std;

void solve()
{
	int a, b;
	bool firstFlag = true;
	while(cin >> a >> b)
	{
		if(a == 0 && b == 0)
		{
			break;
		}
		if(!firstFlag)
		{
			cout << endl;
		}
		bool existFlag = false;
		for(int i = a; i < b; ++i)
		{
			if(i % 4 == 0 && i % 100 != 0 || i % 400 == 0)
			{
				cout << i << endl;
				existFlag = true;
			}
		}
		if(!existFlag)
		{
			cout << "NA" << endl;
		}
		firstFlag = false;
	}
}

int main()
{
	solve();
	return(0);
}

C++: #include<stdio.h>
int main(void)
{
	int i,a,b,w,x,flg,cnt;
	cnt=0;
	scanf("%d %d",&a,&b);
	while(a!=0 && b!=0){
		flg=0;
		if(cnt!=0){
			printf("\n");
		}
		for(i=a;i<=b;i++){
			if(i%4==0){
				if(i%100!=0){
					printf("%d\n",i);
					flg=1;
				}
			}
			else if(i%400==0){
				printf("%d\n",i);
				flg=1;
			}
			cnt++;
		}
		if(flg==0){
			printf("NA\n");
		}
		scanf("%d %d",&a,&b);
	}
	return 0;
}

C++: #include <stdio.h>

void uru(int year);

int main(void)
{
    int a, b;
    int year;
    int j;
    while (1) {
        scanf("%d %d", &a, &b);
        if (a == 0 && b == 0) {
            break;
        } else  {
            for (year = a; year < b; ++year) {
                uru(year);
            }
            if (j == 0) {
                printf("NA\n");
            }
            printf("\n");
        }
    }
    return 0;
}

void uru(int year)
{
    int j = 0;
    int R4, R100, R400;
    R4 = year % 4;
    R100 = year % 100;
    R400 = year % 400;
    if (R4 == 0 && R100 != 0) {
        printf("%d\n", year);
        ++j;
    } else if (R400 == 0) {
        printf("%d\n", year);
        ++j;
    }
}