{"trustable":true,"prependHtml":"\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 async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"panel_content\"\u003e Every girl likes shopping,so does dandelion.Now she finds the shop is increasing the price every day because the Spring Festival is coming .She is fond of a shop which is called \"memory\". Now she wants to know the rank of this shop\u0027s price after the change of everyday.\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"One line contians a number n ( n\u0026lt;\u003d10000),stands for the number of shops.\u003cbr\u003eThen n lines ,each line contains a string (the length is short than 31 and only contains lowercase letters and capital letters.)stands for the name of the shop.\u003cbr\u003eThen a line contians a number m (1\u0026lt;\u003dm\u0026lt;\u003d50),stands for the days .\u003cbr\u003eThen m parts , every parts contians n lines , each line contians a number s and a string p ,stands for this day ,the shop p \u0027s price has increased s.\u003cbr\u003e"}},{"title":"Output","value":{"format":"HTML","content":"Contains m lines ,In the ith line print a number of the shop \"memory\" \u0027s rank after the ith day. We define the rank as :If there are t shops\u0027 price is higher than the \"memory\" , than its rank is t+1."}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e3\r\nmemory\r\nkfc\r\nwind\r\n2\r\n49 memory\r\n49 kfc\r\n48 wind\r\n80 kfc\r\n85 wind\r\n83 memory\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1\r\n2\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}