{"trustable":true,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\n\u003cp\u003e最近Duff一直在军队中当兵。Malek是她的指挥官。\u003c/p\u003e\n\u003cp\u003e他们的国家Andarz Gu有n个城市(编号从1到n)和n-1条双向道路。每条道路连接两个不同的城市。任意两个城市之间存在唯一的路径。\u003c/p\u003e\n\u003cp\u003eAndarz Gu还有m个居民(编号从1到m)。每个人都有一个ID号码。第i个人的ID号码是i,他/她住在城市编号为ci的城市。请注意,一个城市中可能有多个人,也可能没有人居住。\u003c/p\u003e\n\u003ccenter\u003e\n \u003cimg class\u003d\"tex-graphics\" src\u003d\"CDN_BASE_URL/38953db03ce0ea99ffb94b16cdda860b?v\u003d1696857175\" style\u003d\"max-width: 100.0%;max-height: 100.0%;\"\u003e\n\u003c/center\u003e\n\u003cp\u003eMalek喜欢命令。这就是为什么他要求Duff回答q个查询。在每个查询中,他给她一些数字v,u和a。\u003c/p\u003e\n\u003cp\u003e为了回答一个查询:\u003c/p\u003e\n\u003cp\u003e假设有x个人住在从城市v到城市u的路径上的城市中。假设这些人的ID按照递增顺序是p1,p2,...,px。\u003c/p\u003e\n\u003cp\u003e如果k\u003dmin(x,a),那么Duff应该按照这个顺序告诉Malek数字k,p1,p2,...,pk。换句话说,Malek想知道该路径上的a个最小值(如果人数少于a,则输出少于a个)。\u003c/p\u003e\n\u003cp\u003eDuff现在非常忙,所以她请你帮她回答这些查询。\u003c/p\u003e\n"}},{"title":"输入","value":{"format":"HTML","content":"\u003cp\u003e输入的第一行包含三个整数n,m和q(1≤n,m,q≤10^5)。\u003c/p\u003e\n\u003cp\u003e接下来的n-1行包含道路。每行包含两个整数v和u,表示一条道路的端点(1≤v,u≤n,v≠u)。\u003c/p\u003e\n\u003cp\u003e下一行包含m个整数c1,c2,...,cm,用空格分隔(1≤ci≤n,对于每个1≤i≤m)。\u003c/p\u003e\n\u003cp\u003e接下来的q行包含查询。每个查询包含三个整数v,u和a(1≤v,u≤n,1≤a≤10)。\u003c/p\u003e"}},{"title":"输出","value":{"format":"HTML","content":"\u003cp\u003e对于每个查询,在一行中按顺序打印数字k,p1,p2,...,pk,用空格分隔。\u003c/p\u003e"}},{"title":"示例1","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003e输入\u003c/th\u003e\n \u003cth\u003e输出\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e5 4 5\n1 3\n1 2\n1 4\n4 5\n2 1 4 3\n4 5 6\n1 5 2\n5 5 10\n2 3 3\n5 3 1\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1 3\n2 2 3\n0\n3 1 2 4\n1 2\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}},{"title":"注意","value":{"format":"HTML","content":"\u003cp\u003e示例情况下Andarz Gu的图如下所示(每个城市中的人的ID号码都写在旁边):\u003c/p\u003e\n\u003ccenter\u003e\n \u003cimg class\u003d\"tex-graphics\" src\u003d\"CDN_BASE_URL/2cb2a208b5f94ce2199d25d3a0665770?v\u003d1696857175\" style\u003d\"max-width: 100.0%;max-height: 100.0%;\"\u003e\n\u003c/center\u003e"}}]}