{"trustable":true,"sections":[{"title":"","value":{"format":"MD","content":"\u003ch3\u003e Read problems statements in \u003ca target\u003d\"_blank\" href\u003d\"https://www.codechef.com/download/translated/MARCH16/mandarin/STRPALIN.pdf\" rel\u003d\"nofollow noreferrer noopener\"\u003eMandarin Chinese\u003c/a\u003e, \u003ca target\u003d\"_blank\" href\u003d\"https://www.codechef.com/download/translated/MARCH16/russian/STRPALIN.pdf\" rel\u003d\"nofollow noreferrer noopener\"\u003eRussian\u003c/a\u003e and \u003ca target\u003d\"_blank\" href\u003d\"https://www.codechef.com/download/translated/MARCH16/vietnamese/STRPALIN.pdf\" rel\u003d\"nofollow noreferrer noopener\"\u003eVietnamese\u003c/a\u003e as well.\u003c/h3\u003e\n\n\n\u003cp\u003eChef likes strings a lot but he likes palindromic strings more. Today, Chef has two strings \u003cb\u003eA\u003c/b\u003e and \u003cb\u003eB\u003c/b\u003e, each consisting of lower case alphabets.\n\u003c/p\u003e\n\n\u003cp\u003e\nChef is eager to know whether it is possible to choose some \u003cb\u003enon empty\u003c/b\u003e strings \u003cb\u003es1\u003c/b\u003e and \u003cb\u003es2\u003c/b\u003e where \u003cb\u003es1\u003c/b\u003e is a substring of \u003cb\u003eA\u003c/b\u003e, \u003cb\u003es2\u003c/b\u003e is a substring of \u003cb\u003eB\u003c/b\u003e such that \u003cb\u003es1 + s2\u003c/b\u003e is a palindromic string. Here \u003cb\u003e\u0027+\u0027\u003c/b\u003e denotes the concatenation between the strings.\u003c/p\u003e\n\n\u003cp\u003e\u003cb\u003eNote:\u003c/b\u003e\u003c/p\u003e\n\u003cp\u003eA string is a palindromic string if it can be read same both forward as well as backward. To know more about palindromes click \u003ca href\u003d\"https://en.wikipedia.org/wiki/Palindrome\" rel\u003d\"nofollow\"\u003ehere\u003c/a\u003e.\u003c/p\u003e\n\n\u003ch3\u003eInput\u003c/h3\u003e\n\u003cul\u003e\u003cli\u003eFirst line of input contains a single integer \u003cb\u003eT\u003c/b\u003e denoting the number of test cases.\u003c/li\u003e\n\u003cli\u003eFor each test case:\n\t\u003cul\u003e\u003cli\u003eFirst line contains the string \u003cb\u003eA\u003c/b\u003e\u003c/li\u003e\n\t\t\u003cli\u003eSecond line contains the string \u003cb\u003eB\u003c/b\u003e.\u003c/li\u003e\n\t\u003c/ul\u003e\u003c/li\u003e\n\u003c/ul\u003e\u003ch3\u003eOutput\u003c/h3\u003e\n\u003cp\u003eFor each test case, Print \u003cb\u003e\"Yes\"\u003c/b\u003e (without quotes) if it possible to choose such strings \u003cb\u003es1 \u0026 s2\u003c/b\u003e. Print \u003cb\u003e\"No\"\u003c/b\u003e (without quotes) otherwise.\n\n\n\u003c/p\u003e\u003ch3\u003eConstraints\u003c/h3\u003e\n\u003cul\u003e\u003cli\u003e\u003cb\u003e1 ≤ T ≤ 10 \u003c/b\u003e\u003c/li\u003e\n\u003cli\u003e\u003cb\u003e1 ≤ |A|, |B| ≤ 1000 \u003c/b\u003e\u003c/li\u003e\n\u003c/ul\u003e\u003ch3\u003eSubtasks\n\u003c/h3\u003e\u003cul\u003e\u003cli\u003e \u003cb\u003eSubtask 1:\u003c/b\u003e \u003cb\u003e1 ≤ |A|, |B| ≤ 10\u003c/b\u003e : ( 40 pts )\u003c/li\u003e\n\u003cli\u003e \u003cb\u003eSubtask 2:\u003c/b\u003e \u003cb\u003e1 ≤ |A|, |B| ≤ 1000\u003c/b\u003e : ( 60 pts )\u003c/li\u003e\n\u003c/ul\u003e"}},{"title":"Sample 1","value":{"format":"MD","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e3\nabc\nabc\na\nb\nabba\nbaab\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eYes\nNo\nYes\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003cul\u003e\u003cli\u003e\u003cb\u003eTest 1:\u003c/b\u003e One possible way of choosing \u003cb\u003es1 \u0026 s2\u003c/b\u003e is \u003cb\u003es1 \u003d \"ab\"\u003c/b\u003e, \u003cb\u003es2 \u003d \"a\"\u003c/b\u003e such that \u003cb\u003es1 + s2\u003c/b\u003e i.e \u003cb\u003e\"aba\"\u003c/b\u003e is a palindrome.\u003c/li\u003e\n\u003cli\u003e\u003cb\u003eTest 2:\u003c/b\u003e There is no possible way to choose \u003cb\u003es1 \u0026 s2\u003c/b\u003e such that \u003cb\u003es1 + s2\u003c/b\u003e is a palindrome.\u003c/li\u003e\n\u003cli\u003e\u003cb\u003eTest 3:\u003c/b\u003e You can figure it out yourself.\u003c/li\u003e\n\u003c/ul\u003e"}}]}