{"trustable":false,"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":"\u003cscript type\u003d\u0027text/x-mathjax-config\u0027\u003eMathJax.Hub.Config({tex2jax: { inlineMath: [[\u0027$\u0027,\u0027$\u0027]] } }); \u003c/script\u003e\n\u003cscript type\u003d\u0027text/javascript\u0027 src\u003d\u0027https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\u0027\u003e\u003c/script\u003e\n\u003cscript type\u003d\u0027text/javascript\u0027\u003esetTimeout(function(){MathJax.Hub.Queue([\u0027Typeset\u0027, MathJax.Hub, \u0027left_view\u0027]);}, 2000);\u003c/script\u003e\n\u003cdiv class\u003d\"panel_content\"\u003e\n 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. \n\u003c/div\u003e\n每个女孩子都喜欢购物,小T也是。她发现春节临近,很多商店都在涨价。她喜欢一个叫\"memory\"的商店。她希望之后,这个商店的价格排名,在每天各个商店涨价之后。"}},{"title":"Input","value":{"format":"HTML","content":"One line contians a number n ( n\u0026lt;\u003d10000),stands for the number of shops. \n\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. \n\u003cbr\u003eThen a line contians a number m (1\u0026lt;\u003dm\u0026lt;\u003d50),stands for the days . \n\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. \n\u003cbr\u003e\n有多组数据,读入到文件结束。\u003cbr\u003e\n第一行一个整数n,表示商店的数量。\u003c/br\u003e\n接下来n行,每行一个字符串,表示商店的名称。\u003c/br\u003e\n接下来一行一个整数m,表示天数。\u003c/br\u003e\n接下来m部分,每部分有n行,包含一个整数s和一个字符串p,表示商店p的价格涨了s。\n\n"}},{"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.\n\u003cbr\u003e\n输出“memory”商店在涨价之后的排名,如果有t个商店的价格高于它,那么它的排名就是t+1\n\u003cbr\u003e\n可以认为,初始价格,每个商店都相同。"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre\u003e3\nmemory\nkfc\nwind\n2\n49 memory\n49 kfc\n48 wind\n80 kfc\n85 wind\n83 memory\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre\u003e1\n2\u003c/pre\u003e"}}]}