public static void main(String[] args) {
		boolean[] grid = new boolean[1000001];
		
		for(int i = 2; i <= Math.sqrt(1000000); i++)
		{
			for(int j = 2*i; j < 1000000; j=j+i)
			{
				grid[j] = true;
			}
		}
		
		int count = 0;
		
		for(int i = 2; i < 1000000; i++)
		{
			if(!grid[i])
				count++;
			if(count == 10001)
			{
				System.out.println(i+ " " + grid[i]);
				break;
			}
		}
	}