Volatile:ClassMatrix

Revision as of 14:32, 21 December 2008 by Editor (talk | contribs)





This page is a classified matrix of molecular pages based on two class categories (rows and columns). You can reach actual molecules by clicking each number with a link (except for 0).

これは二つのクラス分類(行と列方向)に基づく分子ページの集計ページです。実際の分子ページへは数字のリンクをクリックしてください。

Rows: , Columns: (counts)
{{#lua:}}! ({{{1}}} () {{{1}}} () for (id in stdin:gmatch("%S+") do) {{{1}}} () {{{1}}} () {{{1}}} () {{{1}}} () end () end () table.sort(T); () {{{1}}} () {{{1}}} () print(k (.. " " .. H[k]);) end () () ())
{{#lua:}}|- {{{1}}}
{{{1}}}
{{{1}}}
for id in string.gmatch(all,"(%S+)") do
{{{1}}}
{{{1}}}
{{{1}}}
{{{1}}}
{{{1}}}
{{{1}}}
end
end
--- {{#lua:
 local input = stdin:match(".+");
 local xaxis, yaxis, all = string.match(input, "([^&]+) || 
||
||
||
||
||
||
||
||
||

, {{{3}}});

   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 ---  );

{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---

 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub(" ([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " (" .. v .. ")&&";
   for y,v in string.gmatch(yaxis, "(%S+) (%S+)") do
     if (M[x][y] == nil)
       then str = str .. " 0 dummy";
       else if ({{{3}}} <= {{{4}}})
         then str = str .. " " .. M[x][y] .. " " .. strFst .. x .. strSnd .. y .. strTrd;
         else str = str .. " " .. M[x][y] .. " " .. strFst .. y .. strSnd .. x .. strTrd;
       end
     end
   end
   print(str);
 end

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---,", 1,  ); -1);

   strSnd = string.sub(" ([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---,", {{{3}}}+1, {{{4}}}-1);

   strTrd = string.sub(" ([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---,", {{{5}}}+1, string.len(" ([^&]+)&&(.+)");

 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---,"));

 else
   strFst = string.sub(" ([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---,", 1, {{{4}}}-1);

   strSnd = string.sub(" ([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---,", {{{5}}}+1,  ); -1);

   strTrd = string.sub(" ([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---,", {{{3}}}+1, string.len(" ([^&]+)&&(.+)");

 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---,"));

 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " {{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---,}}|| 
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
(" .. v .. ")</small>&&"; for y,v in string.gmatch(yaxis, "(%S+) (%S+)") do if (M[x][y] == nil) then str = str .. " 0 dummy"; else if ({{{3}}} <= {{{4}}}) then str = str .. " " .. M[x][y] .. " " .. strFst .. x .. strSnd .. y .. strTrd; else str = str .. " " .. M[x][y] .. " " .. strFst .. y .. strSnd .. x .. strTrd; end end end print(str); end

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 --- が{{{4}}}{{{5}}}より後ろの場合も考慮, {{{3}}});

   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- ([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{#lua:
 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 --- が{{{4}}}{{{5}}}より後ろの場合も考慮,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& ", 1, {{{2}}}-1);

   strSnd = string.sub("{{#lua:
 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 --- が{{{4}}}{{{5}}}より後ろの場合も考慮,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& ", {{{3}}}+1, {{{4}}}-1);

   strTrd = string.sub("{{#lua:
 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 --- が{{{4}}}{{{5}}}より後ろの場合も考慮,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& ", {{{5}}}+1, string.len("{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 --- が{{{4}}}{{{5}}}より後ろの場合も考慮,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& "));

 else
   strFst = string.sub("{{#lua:
 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 --- が{{{4}}}{{{5}}}より後ろの場合も考慮,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& ", 1, {{{4}}}-1);

   strSnd = string.sub("{{#lua:
 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 --- が{{{4}}}{{{5}}}より後ろの場合も考慮,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& ", {{{5}}}+1, {{{2}}}-1);

   strTrd = string.sub("{{#lua:
 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 --- が{{{4}}}{{{5}}}より後ろの場合も考慮,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& ", {{{3}}}+1, string.len("{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 --- が{{{4}}}{{{5}}}より後ろの場合も考慮,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& "));

 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 --- が{{{4}}}{{{5}}}より後ろの場合も考慮{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---

 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub(" ---", 1, ([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{#lua:
 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 --- が{{{4}}}{{{5}}}より後ろの場合も考慮,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& ", 1, {{{2}}}-1);

   strSnd = string.sub("{{#lua:
 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 --- が{{{4}}}{{{5}}}より後ろの場合も考慮,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& ", {{{3}}}+1, {{{4}}}-1);

   strTrd = string.sub("{{#lua:
 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 --- が{{{4}}}{{{5}}}より後ろの場合も考慮,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& ", {{{5}}}+1, string.len("{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 --- が{{{4}}}{{{5}}}より後ろの場合も考慮,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& "));

 else
   strFst = string.sub("{{#lua:
 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 --- が{{{4}}}{{{5}}}より後ろの場合も考慮,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& ", 1, {{{4}}}-1);

   strSnd = string.sub("{{#lua:
 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 --- が{{{4}}}{{{5}}}より後ろの場合も考慮,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& ", {{{5}}}+1, {{{2}}}-1);

   strTrd = string.sub("{{#lua:
 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 --- が{{{4}}}{{{5}}}より後ろの場合も考慮,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& ", {{{3}}}+1, string.len("{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 --- が{{{4}}}{{{5}}}より後ろの場合も考慮,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& "));

 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 --- が{{{4}}}{{{5}}}より後ろの場合も考慮-1);

   strSnd = string.sub(" ---", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub(" ---", {{{5}}}+1, string.len(" ---"));
 else
   strFst = string.sub(" ---", 1, {{{4}}}-1);
   strSnd = string.sub(" ---", {{{5}}}+1, ([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{#lua:
 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 --- が{{{4}}}{{{5}}}より後ろの場合も考慮,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& ", 1, {{{2}}}-1);

   strSnd = string.sub("{{#lua:
 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 --- が{{{4}}}{{{5}}}より後ろの場合も考慮,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& ", {{{3}}}+1, {{{4}}}-1);

   strTrd = string.sub("{{#lua:
 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 --- が{{{4}}}{{{5}}}より後ろの場合も考慮,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& ", {{{5}}}+1, string.len("{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 --- が{{{4}}}{{{5}}}より後ろの場合も考慮,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& "));

 else
   strFst = string.sub("{{#lua:
 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 --- が{{{4}}}{{{5}}}より後ろの場合も考慮,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& ", 1, {{{4}}}-1);

   strSnd = string.sub("{{#lua:
 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 --- が{{{4}}}{{{5}}}より後ろの場合も考慮,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& ", {{{5}}}+1, {{{2}}}-1);

   strTrd = string.sub("{{#lua:
 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 --- が{{{4}}}{{{5}}}より後ろの場合も考慮,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& ", {{{3}}}+1, string.len("{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 --- が{{{4}}}{{{5}}}より後ろの場合も考慮,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& "));

 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 --- が{{{4}}}{{{5}}}より後ろの場合も考慮-1);

   strTrd = string.sub(" ---", {{{3}}}+1, string.len(" ---"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " (" .. v .. ")&&";
   for y,v in string.gmatch(yaxis, "(%S+) (%S+)") do
     if (M[x][y] == nil)
       then str = str .. " 0 dummy";
       else if ({{{3}}} <= {{{4}}})
         then str = str .. " " .. M[x][y] .. " " .. strFst .. x .. strSnd .. y .. strTrd;
         else str = str .. " " .. M[x][y] .. " " .. strFst .. y .. strSnd .. x .. strTrd;
       end
     end
   end
   print(str);
 end />{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 --- が{{{4}}}{{{5}}}より後ろの場合も考慮"}}|| 
||
||
||
||
||
||
||
(" .. v .. ")</small>&&"; for y,v in string.gmatch(yaxis, "(%S+) (%S+)") do if (M[x][y] == nil) then str = str .. " 0 dummy"; else if ({{{3}}} <= {{{4}}}) then str = str .. " " .. M[x][y] .. " " .. strFst .. x .. strSnd .. y .. strTrd; else str = str .. " " .. M[x][y] .. " " .. strFst .. y .. strSnd .. x .. strTrd; end end end print(str); end

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1); , {{{3}}});

   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- ([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{#lua:
 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1); ,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& ", 1, {{{2}}}-1);

   strSnd = string.sub("{{#lua:
 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1); ,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& ", {{{3}}}+1, {{{4}}}-1);

   strTrd = string.sub("{{#lua:
 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1); ,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& ", {{{5}}}+1, string.len("{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1); ,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& "));

 else
   strFst = string.sub("{{#lua:
 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1); ,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& ", 1, {{{4}}}-1);

   strSnd = string.sub("{{#lua:
 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1); ,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& ", {{{5}}}+1, {{{2}}}-1);

   strTrd = string.sub("{{#lua:
 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1); ,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& ", {{{3}}}+1, string.len("{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1); ,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& "));

 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1); {{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---

 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub(" 1,", 1, ([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{#lua:
 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1); ,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& ", 1, {{{2}}}-1);

   strSnd = string.sub("{{#lua:
 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1); ,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& ", {{{3}}}+1, {{{4}}}-1);

   strTrd = string.sub("{{#lua:
 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1); ,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& ", {{{5}}}+1, string.len("{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1); ,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& "));

 else
   strFst = string.sub("{{#lua:
 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1); ,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& ", 1, {{{4}}}-1);

   strSnd = string.sub("{{#lua:
 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1); ,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& ", {{{5}}}+1, {{{2}}}-1);

   strTrd = string.sub("{{#lua:
 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1); ,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& ", {{{3}}}+1, string.len("{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1); ,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& "));

 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1); -1);

   strSnd = string.sub(" 1,", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub(" 1,", {{{5}}}+1, string.len(" 1,"));
 else
   strFst = string.sub(" 1,", 1, {{{4}}}-1);
   strSnd = string.sub(" 1,", {{{5}}}+1, ([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{#lua:
 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1); ,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& ", 1, {{{2}}}-1);

   strSnd = string.sub("{{#lua:
 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1); ,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& ", {{{3}}}+1, {{{4}}}-1);

   strTrd = string.sub("{{#lua:
 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1); ,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& ", {{{5}}}+1, string.len("{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1); ,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& "));

 else
   strFst = string.sub("{{#lua:
 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1); ,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& ", 1, {{{4}}}-1);

   strSnd = string.sub("{{#lua:
 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1); ,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& ", {{{5}}}+1, {{{2}}}-1);

   strTrd = string.sub("{{#lua:
 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1); ,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& ", {{{3}}}+1, string.len("{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1); ,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& "));

 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1); -1);

   strTrd = string.sub(" 1,", {{{3}}}+1, string.len(" 1,"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " (" .. v .. ")&&";
   for y,v in string.gmatch(yaxis, "(%S+) (%S+)") do
     if (M[x][y] == nil)
       then str = str .. " 0 dummy";
       else if ({{{3}}} <= {{{4}}})
         then str = str .. " " .. M[x][y] .. " " .. strFst .. x .. strSnd .. y .. strTrd;
         else str = str .. " " .. M[x][y] .. " " .. strFst .. y .. strSnd .. x .. strTrd;
       end
     end
   end
   print(str);
 end />{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1);"}}|| 
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
(" .. v .. ")</small>&&"; for y,v in string.gmatch(yaxis, "(%S+) (%S+)") do if (M[x][y] == nil) then str = str .. " 0 dummy"; else if ({{{3}}} <= {{{4}}}) then str = str .. " " .. M[x][y] .. " " .. strFst .. x .. strSnd .. y .. strTrd; else str = str .. " " .. M[x][y] .. " " .. strFst .. y .. strSnd .. x .. strTrd; end end end print(str); end

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1); , {{{3}}});

   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- ([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{#lua:
 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1); ,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& ", 1, {{{2}}}-1);

   strSnd = string.sub("{{#lua:
 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1); ,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& ", {{{3}}}+1, {{{4}}}-1);

   strTrd = string.sub("{{#lua:
 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1); ,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& ", {{{5}}}+1, string.len("{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1); ,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& "));

 else
   strFst = string.sub("{{#lua:
 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1); ,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& ", 1, {{{4}}}-1);

   strSnd = string.sub("{{#lua:
 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1); ,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& ", {{{5}}}+1, {{{2}}}-1);

   strTrd = string.sub("{{#lua:
 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1); ,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& ", {{{3}}}+1, string.len("{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1); ,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& "));

 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1); {{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---

 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub(" {{{5}}}+1,", 1, ([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{#lua:
 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1); ,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& ", 1, {{{2}}}-1);

   strSnd = string.sub("{{#lua:
 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1); ,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& ", {{{3}}}+1, {{{4}}}-1);

   strTrd = string.sub("{{#lua:
 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1); ,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& ", {{{5}}}+1, string.len("{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1); ,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& "));

 else
   strFst = string.sub("{{#lua:
 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1); ,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& ", 1, {{{4}}}-1);

   strSnd = string.sub("{{#lua:
 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1); ,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& ", {{{5}}}+1, {{{2}}}-1);

   strTrd = string.sub("{{#lua:
 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1); ,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& ", {{{3}}}+1, string.len("{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1); ,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& "));

 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1); -1);

   strSnd = string.sub(" {{{5}}}+1,", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub(" {{{5}}}+1,", {{{5}}}+1, string.len(" {{{5}}}+1,"));
 else
   strFst = string.sub(" {{{5}}}+1,", 1, {{{4}}}-1);
   strSnd = string.sub(" {{{5}}}+1,", {{{5}}}+1, ([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{#lua:
 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1); ,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& ", 1, {{{2}}}-1);

   strSnd = string.sub("{{#lua:
 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1); ,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& ", {{{3}}}+1, {{{4}}}-1);

   strTrd = string.sub("{{#lua:
 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1); ,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& ", {{{5}}}+1, string.len("{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1); ,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& "));

 else
   strFst = string.sub("{{#lua:
 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1); ,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& ", 1, {{{4}}}-1);

   strSnd = string.sub("{{#lua:
 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1); ,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& ", {{{5}}}+1, {{{2}}}-1);

   strTrd = string.sub("{{#lua:
 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1); ,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& ", {{{3}}}+1, string.len("{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,([^&]+)&&(.+)");
 local M = {};
 for id in string.gmatch(all,"(%S+)") do
   x = string.sub(id, {{{2}}}, {{{3}}});
   y = string.sub(id, {{{4}}}, {{{5}}});
   if (M[x] == nil) then M[x] = {}; end
   if (M[x][y] == nil)
     then M[x][y] = 1;
     else M[x][y] = M[x][y] + 1;
   end
 end
 --- {{{2}}}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ---
 if ({{{3}}} <= {{{4}}})
 then
   strFst = string.sub("{{{1}}}", 1, {{{2}}}-1);
   strSnd = string.sub("{{{1}}}", {{{3}}}+1, {{{4}}}-1);
   strTrd = string.sub("{{{1}}}", {{{5}}}+1, string.len("{{{1}}}"));
 else
   strFst = string.sub("{{{1}}}", 1, {{{4}}}-1);
   strSnd = string.sub("{{{1}}}", {{{5}}}+1, {{{2}}}-1);
   strTrd = string.sub("{{{1}}}", {{{3}}}+1, string.len("{{{1}}}"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1); ,{{{3}}});

   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& "));

 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " 

|{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{2}}},{{{3}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&&{{#lua:

 local H = {};
 local T = {};
 for id in stdin:gmatch("%S+") do
   str = string.sub(id,{{{4}}},{{{5}}});
   if (H[str] == nil)
     then H[str] = 1; table.insert(T, str);
     else H[str] = H[str] + 1;
   end
 end
 table.sort(T);
 for i=1,table.getn(T) do
   local k = T[i];
   print(k .. " " .. H[k]);
 end

| }}&& }}{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1); -1);

   strTrd = string.sub(" {{{5}}}+1,", {{{3}}}+1, string.len(" {{{5}}}+1,"));
 end
 for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
   str = x .. " (" .. v .. ")&&";
   for y,v in string.gmatch(yaxis, "(%S+) (%S+)") do
     if (M[x][y] == nil)
       then str = str .. " 0 dummy";
       else if ({{{3}}} <= {{{4}}})
         then str = str .. " " .. M[x][y] .. " " .. strFst .. x .. strSnd .. y .. strTrd;
         else str = str .. " " .. M[x][y] .. " " .. strFst .. y .. strSnd .. x .. strTrd;
       end
     end
   end
   print(str);
 end />{{{3}}}が{{{4}}}{{{5}}}より後ろの場合も考慮 ----1);"}}|| 
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
||
}} が{{{4}}}{{{5}}}より後ろの場合も考慮|---}}
{{{1}}}
then
{{{1}}}
{{{1}}}
{{{1}}}
else
{{{1}}}
{{{1}}}
{{{1}}}
end
for x,v in string.gmatch(xaxis, "(%S+) (%S+)") do
{{{1}}}
for y,v in string.gmatch(yaxis, "(%S+) (%S+)") do
{{{1}}}
{{{1}}}
{{{1}}}
{{{1}}}
{{{1}}}
end
end
end
print(str);
end
'
''''