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 <stdio.h>

void print_na(int a, int b);
void leap_year(int a, int b);

int main(void)
{
    int a, b;
    scanf("%d %d", &a, &b);
    while ( a != 0 || b != 0) {
        print_na(a, b);
        leap_year(a, b);
        scanf("%d %d", &a, &b);
    }
    return 0;
}

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

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

C++: #include <iostream>
#include <cstdio>
using namespace std;
int a, b;
bool isUruu(int year) {
    return((year % 4 == 0 && year % 100 != 0) || year % 400 == 0);
}

void solve() {
    bool update = false;
    for(int r = a; r <= b; r++) {
        if(isUruu(r)){ cout << r << endl; update = true; }
    }
    if(!update) cout << "NA" << endl;
    cout << endl;
}

int main(void) {
    while(cin >> a >> b, a|b) {
        solve();
    }
    return(0);
}

C++: #include <bits/stdc++.h>
using namespace std;
const double eps=1e-9;
typedef vector<int> vi;
typedef long long ll;
int a,b;
int main(void)
{
  int tim=0;
  while(cin >> a >> b && a)
    {
      if(a==0 && b==0) break;
      if(tim!=0)
	{
	  cout << endl;
	}
      tim++;
      vector<int> ans;
  for(int i=a;i<=b;i++)
    {
      if(i%4==0 && i%100!=0) 
	{
	  ans.push_back(i);
	  continue;
	}
      if(i%400==0) ans.push_back(i);
      
    }
  if(ans.size()==0)
    {
      cout << "NA" << endl;
    }
  else
    {
      for(int i=0;i<int(ans.size());i++)
	{
	  cout << ans[i] << endl;
	}
    }
    }
  return 0;
}

C++: #include <stdio.h>

void print_na(int a, int b);
void leap_year(int a, int b);

int main(void)
{
    int a, b;
    scanf("%d %d", &a, &b);
    print_na(a, b);
    leap_year(a, b);
    return 0;
}

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

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

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");
    }
}

C++: #include <iostream>
using namespace std;
int main(){
	int a,b;
	while(cin>>a>>b){
		int c=0;
		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){
						cout<<i<<endl;
						c++;
					}else{
						continue;
					}
				}else{
					cout<<i<<endl;
					c++;
				}	
			}
		}
		if(c==0) cout<<"NA"<<endl;
		//cout<<endl;
	}
	return 0;
}

C++: #include<stdio.h>

void leap_year(int = x)


int main(void)
{
    int start_year, end_year, check;
    scanf(%d %d,&start_year, &end_year);
    for(int i = start_year; i =<end_year; i++){
        leap_year(i);
        check += leap_year(i);
    } 
    if(check = 0){
        printf("NA");
    }
    return 0;
}


int leap_year(int = x)
{
    if(x % 4 = 0){
        printf("%d\n", x);
        return 1;
    }
    return 0;
}

C++: 
#include<bits/stdc++.h>

using namespace std;

int main(){
  bool hoge = false;
  while(1)
    {
  int a,b;
  cin>>a>>b;
    if(a==0)break;
    if(hoge)puts("");
    hoge = true;
  vector<int> ans;

  for(int i=min(a,b);i<=max(a,b);i++){
    if(i%400 == 0 || (i%100!=0 && i%4==0)){
      ans.push_back(i);
    }
  }


  if(ans.size()!=0)
    {
      for(auto i:ans){
	cout<<i<<endl;
      }
    }
  else{
    puts("NA");
  }
    }
}

C++: #include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<vector>
#define INF 999999
using namespace std;
int main(){
    int ends=0;
    int A,B;
    while(cin>>A>>B,A){
        if(ends==1)puts("");
        ends=1;
        int FLG=0;
        for(int i=A;i<=B;i++){
            int FLGS=0;
            if(i%4==0)FLGS=1;
            if(i%100==0)FLGS=0;
            if(i%400==0)FLGS=1;
            if(FLGS==1){cout<<i<<endl;FLG=1;}
        }
        if(FLG==0)cout<<"NA"<<endl;
    }
    return 0;
}

C++: #include <iostream>

using namespace std;

int main(int argc, char **argv)
{
	int a, b, f = 0;
	
	while(1){
		cin >> a >> b;
		if(a == 0 && b == 0){
			break;
		}
		if(f == 1)cout << endl;
		
		for(f = 0; a <= b; a++){
			if(a%400 == 0 || (a%4 == 0 && a%100 != 0)){
				cout << a << endl;
				f = 1;
				a += 4;
				break;
			}
		}

		for(; a <= b; a += 4){
			if(a%400 == 0 || a % 100 != 0){
				cout << a << endl;
			}
		}
		
		if(f == 0){
			cout << "NA" << endl;
		}
		f = 1;
	}
	
	return 0;
}

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

int main(void)
{
  int a, b;
  int flag;
  
  while(1)
    {
      cin >> a >> b;
      if(a == 0 && b == 0) break;
      flag = 0;
      cout << endl;

      for(int i = a ; i <= b ; i++)
	{
	  if(i % 4 == 0 && i % 400 != 0 || i % 100 == 0) 
	    {
	      cout << i << endl;
	      flag = 1;
	    }
	}
      if(flag == 0) cout << "NA" << endl;
      cout << endl;
    }
  return 0;
}

C++: #include<iostream>

using namespace std;


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

}

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

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

int main(){
  int a, b;
  bool first = false;
  while(std::cin >> a >> b, a){
    if(first)std::cout << std::endl;
    first = true;
    bool flag = false;
    for (int i = a; i <= b; i++) {
      if(isUruu(i)){
        std::cout << i << std::endl;
        flag = true;
      }
    }
    if(flag == false)std::cout << "NA" << std::endl;
  }
  return 0;
}

C++: #include <cstdio>

int main(void)
{
    int a, b;
    bool flag, first = false;
    
    while (1){
        scanf("%d %d", &a, &b);
        if (a == 0 && b == 0) break;
        
        if (first) printf("\n");
        else first = true;
        
        flag = false;
        
        while (a <= b){
            if (a % 4 == 0 && (a % 100 != 0 || a % 400 == 0)){
                printf("%d\n", a);
                flag = true;
            }
            a++;
        }
        if (!flag) printf("NA\n");
    }
    
    return (0);
}