#include <stdio.h>

struct employees
{
	int i;
	int q;
	int p;
};

int main(void)
{
	int n,m;
	struct employees number[4000];
	
	for (n = 0, m = 0; n < 4000; n++)
	{
		if (number[n].i == 0)
			break;
		if (number[n].q * number[n].p >= 1000000)
		{
			printf("%d\n", number[n].i);
			m++;
		}
		if (m == 0)
			printf("NA\n");
	}

	return 0;
}