Japan agrees to provide Pakistan a grant