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

int leap(int x) {
	int flg=0;
	if (x % 4 == 0) { flg = 1; }
	if (x % 100 == 0) { flg = 0; }
	if (x % 400 == 0) { flg = 1; }

	return flg;
}

int main() {
	int a, b;
	int q = 0;
	vector<int>va;
	while (cin >> a >> b,a,b) {
		q++;
		if (q >= 2) { cout << '\n'; }
		for (int i = a; i <=b; i++) {
			int c = leap(i);
			if (c==1) { va.push_back(i); }
		}
		if (!va.empty()) {
			for (int i = 0; i < va.size(); i++) {
				cout << va[i] << endl;
			}
		}
		else { cout << "NA" << endl; }
		va.erase(va.begin(), va.end());
	}
	return 0;
}

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

C++: #include<iostream>

using namespace std;

int a, b, c;
int main(){
    cin >> a >> b;
    while(1){
        c=1;
        for(int i=a;i<=b;i++) {
            if(i%4==0&&(i%100>0||i%400==0)) {
                cout<<i<<endl;c=0;
            }
             
        }
        if(c)
			cout << "NA" << endl;
        cin >> a >> b;
        if(a == 0 && b == 0)
			break;
        else 
			cout<<endl;
    }
    return 0;
}

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

C++: #include <stdio.h>

int main(void)
{
	while (1){
		int a, b;
		int n = 0;
		scanf("%d %d", &a, &b);

		if (a == 0 && b == 0) {
			break;
		}

		for (int i = a; i <= b; i++) {
			if (i % 4 == 0) {
				if (i % 100 == 0) {
					if (i % 400 == 0) {
						printf("%d\n", i);
						n++;
					}
				} else
				{
					printf("%d\n", i);
					n++;
				}
			}
		}

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

		printf("\n");
	}

	return 0;
}

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

int main() {
    int a, b;
    bool first = true;
    while (cin >> a >> b, a) {
        vector<int> res;
        for (int i=a; i<=b; ++i) {
            if ((i % 4 == 0 && i % 100 != 0) || i % 400 == 0) {
                res.push_back(i);
            }
        }
        if (first) {
            first = false;
        } else {
            cout << endl;
        }
        if (res.empty()) {
            cout << "NA" << endl;
        } else {
            for (int i=0; i<(int)res.size(); ++i) {
                cout << res[i] << endl;
            }
        }
    }
    return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
  int a,b;
  while(cin >> a >> b,a||b){
    bool f=false;
    for(int i=a;i<=b;i++){
      if(i%400==0) {
	cout << i << endl;
	f=true;
      }else if(i%100==0) {
      }else if(i%4==0){
	cout << i << endl;
	f=true;
      }
    }
    if(!f) cout << "NA" << endl;
    cout << endl;
  }
}

C++: #include <iostream>
#include <cstdio>
using namespace std;
int main(){
  int a,b;
  while( cin >> a >> b , a+b){
    int f = 1;
    for(int i = a ; i <= b ; i++){
      if(i%4 == 0){
	if(i%100 != 0 || i%400 == 0){
	  cout << i << endl;
	  f = 0;
	}
      }
    }
    if(f) cout << "NA" << endl;
  }
  return 0;
}

C++: #include <iostream>
bool isLeapYear(int year)
{
    return (year % 4 == 0 && year % 100 != 0) || year % 400 == 0;
}
int main()
{
    int from, to;
    bool found;//???????????´????????£???????????????
    while (true) {
        std::cin >> from >> to;
        if (from == 0 && to == 0) {
            break;
        }
        found = false;
        for (int y = from; y <= to; y++) {
            if (isLeapYear(y)) {
                std::cout << y << std::endl;
                found = true;
            }
        }
        if (!found) {
            std::cout << "NA" << std::endl;
        }
        std::cout << std::endl;
    }
}

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

C++: #include <iostream>

using namespace std;

int main(int argc, char const* argv[])
{
	int a,b;
	int c = 0;

	while( cin >> a >> b && a ){
		c++;
		int count = 0;
		if( c > 1 ) cout << endl;
		for( int i = a;i <= b;i++ ){
			if( !(i % 4) ){
				if( !(i % 400) ){count++; cout << i << endl; continue;}
				else if( !(i%100) ) continue;
				cout << i << endl;
				count++;
			}
		}
		if( count == 0 ) cout << "NA" << endl;
	}
	return 0;
}

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

int main()
{
  int y1, y2;
  bool first = true;
  while (cin >> y1 >> y2)
  {
    bool na = true;
    if (y1 == 0 && y2 == 0) return 0;
    if (first) { first = false; }
    else cout << endl;
    for (int year = y1; year <= y2; year++)
    {
      if (year % 400 == 0)
      {
        cout << year << endl;
        na = false;
      }
      else if ((year % 4 == 0) && (year % 100 != 0))
      {
        cout << year << endl;
        na = false;
      }
    }
    if (na) cout << "NA" << endl;
  }
}

C++: #include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>

static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using u64 = unsigned long long;
using namespace std;

template<class T> constexpr T INF = ::numeric_limits<T>::max()/32*15+208;

int main() {
    auto isuruu = [](int x){ return !(x%4)^!(x%100)^!(x%400);};
    int a, b, cnt = 0;
    while(cin >> a >> b, a){
        if(cnt++){
            puts("");
        }
        int ok = 0;
        for (int i = a; i <= b; ++i) {
            if(isuruu(i)) {
                ok = 1;
                cout << i << "\n";
            }
        }
        if(!ok) puts("NA");
    }
    return 0;
}

C++: #include <stdio.h>

void leap_year(int year);
int leap_year_judge(int year_a, int year_b);

int main(void)
{
	int year_a, year_b, exist;
	int i = 0;
	while (1) {
		scanf("%d %d", &year_a, &year_b);
		exist = leap_year_judge(year_a, year_b);
		if (year_a == 0 && year_b == 0) {
			break;
		} else if (exist == 1) {
			if (i !=0) {
			printf("\n");
			}
			for (int i = year_a; i <= year_b; i++) {
				leap_year(i);
			}
		} else {
			if (i !=0) {
			printf("\n");
			}
			printf("NA\n");
		}
		i++;
		
	}
	return 0;
}

void leap_year(int year)
{
	if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)) {
		printf("%d\n", year);
	} 
}

int leap_year_judge(int year_a, int year_b)
{
	int judge = 0;
	for (int i = year_a; i <= year_b; i++) {
		if (i % 400 == 0 || (i % 4 == 0 && i % 100 != 0)) {
			judge = 1;
		}
	}
	return judge;
}