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(void){
    int a, b;
    for(int i=0; i < 55; i++){
      cin >> a >> b;
      if(a==0 && b==0){
          break;
      }
      if(a%4 == 0){
          if(a+4 <= b){
              int c;
              c = b-a;
              for(int j=0; j <= c/4; j++){
                  if(a%400 != 0 && a%100 == 0){
                      continue;
                  }
                  cout << a << endl;
                  a+=4;
              }
          }else{
              cout << "NA" << endl;
          }
      }
      
      if(a%4 == 1){
          if(a+3 <= b){
              a += 3;
              int c;
              c= b-a;
              for(int j=0; j <= c/4 ; j++){
                if(a%400 != 0 && a%100 == 0){
                      continue;
                }
                cout << a << endl;
                a+=4;
              }
          }else{
              cout << "NA" << endl;
          }
      }
      
      if(a%4 == 2){
          if(a+2 <= b){
              a += 2;
              int c;
              c = b-a;
              for(int j=0; j <= c/4; j++){
                if(a%400 != 0 && a%100 == 0){
                      continue;
                }
                cout << a << endl;
                a+=4;
              }
          }else{
              cout << "NA" << endl;
          }
      }
      
      if(a%4 == 3){
          if(a+1 <= b){
              a += 1;
              int c;
              c = b-a;
              for(int j=0; j <= c/4; j++){
                if(a%400 != 0 && a%100 == 0){
                      continue;
                }
                cout << a << endl;
                a+=4;
              }
          }else{
              cout << "NA" << endl;
          }

      }
      cout << endl;
    }
}

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

#define stirng string
#define vvi vector<vector<int>>
#define vi vector<int>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;

const int inf = 1e9 + 7;

/*int main() {
  string a;
  cin >> a;
  string s = "";
  for (int i = 0; i < 10; i++) {
    s += a[i];
  }
  for (int i = 0; i < 44; i++) {
    int t = s[0 + i] - '0';
    int u = s[1 + i] - '0';
    s += (t + u) % 10 + '0';
  }
  cout << s[54] << endl;
  return 0;
}*/
int main() {
  int a, b;
  while (cin >> a >> b && a != 0 && b != 0) {
    int p = 1;
    if (p) {
      cout << endl;
      p = 0;
    }
    int flag = 1;
    for (int i = a; i <= b; i++) {
      if (i % 100 == 0 && i % 400 != 0) {
        // continue;
      } else if (i % 4 == 0 && i % 100 != 0) {
        cout << i << endl;
        flag = 0;
      } else if (i % 400 == 0) {
        cout << i << endl;
        flag = 0;
      } else {
        // continue;
      }
    }
    if (flag) {
      cout << "NA" << endl;
    }
  }
  return 0;
}

C++: #include <stdio.h>

void uruu(int a, int b);

int main(void)
{
    int a;
    int b;
    scanf("%d %d", &a, &b);
    while (a != 0 || b != 0) {
        uruu(a, b);
        printf("\n");
        scanf("%d %d", &a, &b);
    }
    if (a == 0 && b == 0) {
        printf("\n");
    }
    return 0;
}


void uruu(int a, int b)
{
    int count = 0;
    for (int year = a; year <= b; ++year) {
        if (year % 4 == 0) {
            if (year % 100 != 0) {
                printf("%d\n", year);
                ++count;
            } else {
                if (year % 400 == 0) {
                    printf("%d\n", year);
                    ++count;
                }
            }
        }   
    }
    if (count == 0) {
        printf("NA\n");
    }
}

C++: #include <iostream>

using namespace std;

int main(int argc, char **argv)
{
	int a, b, f, l = 0;
	
	while(1){
		cin >> a >> b;
		if(a == 0 && b == 0){
			break;
		} else if(l == 1){
			cout << endl << 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;
				if(a+4 < b){
					cout << endl;
				}
			}
		}
		
		if(f == 0){
			cout << "NA";
		}
		
		l = 1;
	}
	
	return 0;
}

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

int main() {
	int a, b;
	bool flug = false;
	while (cin >> a >> b , a || b) {
		if (flug) cout << "\n";
		int count = 0;
		for (int i = a; i <= b; i++) {
			if ((i % 4 == 0 && i % 100 != 0) || i % 400 == 0) {
				cout << i << "\n";
				count++;
			}
		}
		if (count == 0) cout << "NA\n";
		flug = true;
	}
	return 0;
}

C++: #include <stdio.h>
int main(void)
{
    int start, finish;
    int exist;
    while(1){
        exist = 0;
        scanf("%d %d", &start, &finish);
        if (start == 0 && finish == 0) {
            break;
        }
        for(; start <= finish; start++) {
            if((start % 4 == 0 && start % 100 != 0) || start % 400 == 0) {
            printf("%d\n", start);
            exist = 1;
            }
        }
        if (exist == 0) {
            printf("NA\n");
        }
    }
    return 0;
}

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

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

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

bool judge(int year)
{
    bool flag = false;
    if (year % 400 == 0) {
        flag = true;                
    } else if (year % 100 == 0) {
        flag = false;
    } else if (year % 4 == 0) {
        flag = true;
    }
    return flag;
}

int main(void)
{ 
    int number = 0;
    while (true) {
        int x, y;
        bool exist = false;
        scanf("%d%d", &x, &y);
        if (x == 0 && y == 0) {
            break;
        }
        for (int i = x;i <= y; ++i) {
            if (number != 0) {
                   printf("\n");
            }
            bool flag = judge(i);
	    if (flag == true) {
                printf("%d\n", i);
                exist = true;
            }
        }
        if (exist == false) {
            printf("NA\n");
        }  
        number++;     
    }
    return 0;        
}

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

//0093
int main(){
	int y1, y2, n=0;
	while(cin >> y1 >> y2, y1||y2){
		int count = 0;
		if(n){
			cout << endl;
		}
		++n;
		for(int i=y1; i<y2+1; ++i){
			if( (i%4)==0 && (i%100)!=0 || i%400==0 ){
				cout << i << endl;
				++count;
			}
		}

		if(!count){
			cout << "NA" << endl;
		}
		
	}
}

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

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