#include <bits/stdc++.h>

#define debug(x) cout << #x << " = " << x << endl
#define fori(i, ini, lim) for(int i = int(ini); i < int(lim); i++)
#define ford(i, ini, lim) for(int i = int(ini); i >= int(lim); i--)

using namespace std;

typedef long long ll;
typedef pair<int, int> ii;

const int MAX = 1e4 + 5;
string s;
set<string> ans;
int n;
bool visited[MAX][5], memo[MAX][5];

void roll(int idx, int size) {
	int next_idx = idx + size;
	if(next_idx == n || n - idx >= 5 || (n - idx == 4 && size == 2 && (s[idx] != s[idx + 2] || s[idx + 1] != s[idx + 3]))) {
		ans.insert(s.substr(idx, size));
	}
}

int main() {
	ios_base::sync_with_stdio(false);

	cin >> s;
	n = s.size();

	fori(i, 5, n) {
		roll(i, 2);
		roll(i, 3);
	}

	cout << ans.size() << '\n';
	for(auto &each : ans) {
		cout << each << '\n';
	}

	return 0;
}


#include <bits/stdc++.h>

#define debug(x) cout << #x << " = " << x << endl
#define fori(i, ini, lim) for(int i = int(ini); i < int(lim); i++)
#define ford(i, ini, lim) for(int i = int(ini); i >= int(lim); i--)

using namespace std;

typedef long long ll;
typedef pair<int, int> ii;

const int MAX = 1e4 + 5;
string s;
set<string> ans;
int n;
bool good[MAX][5];

void roll(int idx, int size) {
	int next_idx = idx + size;
	if(next_idx == n) {
		ans.insert(s.substr(idx, size));
		good[idx][size] = true;
	}
	else {
		if(good[next_idx][2] && s.substr(idx, size) != s.substr(next_idx, 2)) {
			ans.insert(s.substr(idx, size));
			good[idx][size] = true;
		}
		if(good[next_idx][3] && s.substr(idx, size) != s.substr(next_idx, 3)) {
			ans.insert(s.substr(idx, size));
			good[idx][size] = true;
		}
	}
}

int main() {
	ios_base::sync_with_stdio(false);

	cin >> s;
	n = s.size();

	ford(i, n - 1, 5) {
		roll(i, 2);
		roll(i, 3);
	}

	cout << ans.size() << '\n';
	for(auto &each : ans) {
		cout << each << '\n';
	}

	return 0;
}


#include <bits/stdc++.h>

#define debug(x) cout << #x << " = " << x << endl
#define fori(i, ini, lim) for(int i = int(ini); i < int(lim); i++)
#define ford(i, ini, lim) for(int i = int(ini); i >= int(lim); i--)

using namespace std;

typedef long long ll;
typedef pair<int, int> ii;

const int MAX = 1e4 + 5;
string s;
set<string> ans;
int n;
bool visited[MAX][5], memo[MAX][5], good[MAX];

void roll(int idx, int size) {
	int next_idx = idx + size;
	if(good[next_idx] && (next_idx == n || n - idx >= 5 || (n - idx == 4 && size == 2 && (s[idx] != s[idx + 2] || s[idx + 1] != s[idx + 3])))) {
		ans.insert(s.substr(idx, size));
		good[idx] = true;
	}
}

int main() {
	ios_base::sync_with_stdio(false);

	cin >> s;
	n = s.size();

	good[n] = true;
	ford(i, n - 1, 5) {
		roll(i, 2);
		roll(i, 3);
	}

	cout << ans.size() << '\n';
	for(auto &each : ans) {
		cout << each << '\n';
	}

	return 0;
}


#include <stdio.h>
#include <math.h>
#include <string.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <utility>
#include <stack>
#include <queue>
#include <set>
#include <list>
#include <bitset>
#include <array>

using namespace std;

#define fi first
#define se second
#define long long long
typedef pair<int,int> ii;

int dp[10003][4];
int n;
string s;
set<string> st;

int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	// freopen("input.in", "r", stdin);

	cin >> s;
	s.erase(0,5);
	n = s.size();
	dp[n][2] = dp[n][3] = 1;
	for(int i = n; i >= 2; i--)
	{
		if(i >= 3)
		{
			dp[i-3][3] = max(dp[i-3][3], dp[i][2]);
			if(i+2 >= n) dp[i-3][3] = max(dp[i-3][3], dp[i][3]);
			else
			{
				string s1 = ""; s1 += s[i-3]; s1 += s[i-2]; s1 += s[i-1];
				string s2 = ""; s2 += s[i]; s2 += s[i+1]; s2 += s[i+2];

				if(s1 != s2)
					dp[i-3][3] = max(dp[i-3][3], dp[i][3]);
			}

		}
		if(i >= 2)
		{
			dp[i-2][2] = max(dp[i-2][2], dp[i][3]);

			if(i+1 >= n) dp[i-2][2] = max(dp[i-2][2], dp[i][2]);
			else
			{
				string s1 = ""; s1 = s[i-2]; s1 += s[i-1];
				string s2 = ""; s2 = s[i]; s2 += s[i+1];

				if(s1 != s2)
					dp[i-2][2] = max(dp[i-2][2], dp[i][2]);
			}
		}
	}

	for(int i = 0; i < n; i++)
	{
		if(dp[i][2])
		{
			string s1 = ""; s1 = s[i]; s1 += s[i+1];
			st.insert(s1);
		}
		if(dp[i][3])
		{
			string s2 = ""; s2 = s[i]; s2 += s[i+1], s2 += s[i+2];
			st.insert(s2);
		}

	}
	cout << st.size() << "\n";
	for(auto it : st) cout << it << "\n";

	// for(int i = 0; i <= n; i++) cout << dp[i][2] << " "; cout << "\n";
	// for(int i = 0; i <= n; i++) cout << dp[i][3] << " "; cout << "\n";
}


#include <stdio.h>
#include <math.h>
#include <string.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <utility>
#include <stack>
#include <queue>
#include <set>
#include <list>
#include <bitset>
#include <array>

using namespace std;

#define fi first
#define se second
#define long long long
typedef pair<int,int> ii;

int dp[10003][4];
int n;
string s;
set<string> st;

int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	// freopen("input.in", "r", stdin);

	cin >> s;
	s.erase(0,5);
	n = s.size();
	dp[n][2] = dp[n][3] = 1;
	for(int i = n; i >= 2; i--)
	{
		if(i >= 3)
		{
			dp[i-3][3] = max(dp[i-3][3], dp[i][2]);
			if(i+2 >= n) dp[i-3][3] = max(dp[i-3][3], dp[i][3]);
			else
			{
				string s1 = ""; s1 += s[i-1]; s1 += s[i-2]; s1 += s[i-3];
				string s2 = ""; s1 += s[i]; s2 += s[i+1]; s2 += s[i+2];

				if(s1 != s2)
					dp[i-3][3] = max(dp[i-3][3], dp[i][3]);
			}

		}
		if(i >= 2)
		{
			dp[i-2][2] = max(dp[i-2][2], dp[i][3]);

			if(i+1 >= n) dp[i-2][2] = max(dp[i-2][2], dp[i][2]);
			else
			{
				string s1 = ""; s1 = s[i-1]; s1 += s[i-2];
				string s2 = ""; s2 = s[i]; s2 += s[i+1];

				if(s1 != s2)
					dp[i-2][2] = max(dp[i-2][2], dp[i][2]);
			}
		}
	}

	for(int i = 0; i < n; i++)
	{
		if(dp[i][2])
		{
			string s1 = ""; s1 = s[i]; s1 += s[i+1];
			st.insert(s1);
		}
		if(dp[i][3])
		{
			string s2 = ""; s2 = s[i]; s2 += s[i+1], s2 += s[i+2];
			st.insert(s2);
		}

	}
	cout << st.size() << "\n";
	for(auto it : st) cout << it << "\n";

	// for(int i = 0; i <= n; i++) cout << dp[i][2] << " "; cout << "\n";
	// for(int i = 0; i <= n; i++) cout << dp[i][3] << " "; cout << "\n";
}


#include <stdio.h>
#include <math.h>
#include <string.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <utility>
#include <stack>
#include <queue>
#include <set>
#include <list>
#include <bitset>
#include <array>

using namespace std;

#define fi first
#define se second
#define long long long
typedef pair<int,int> ii;

int dp[10003][4];
int n;
string s;
set<string> st;

int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	// freopen("input.in", "r", stdin);

	cin >> s;
	s.erase(0,5);
	n = s.size();
	dp[n][2] = dp[n][3] = 1;
	for(int i = n; i >= 2; i--)
	{
		if(i >= 3)
		{
			dp[i-3][3] = max(dp[i-3][3], dp[i][2]);
			if(i+2 >= n) dp[i-3][3] = max(dp[i-3][3], dp[i][3]);
			else
			{
				string s1 = ""; s1 += s[i-3]; s1 += s[i-2]; s1 += s[i-1];
				string s2 = ""; s1 += s[i]; s2 += s[i+1]; s2 += s[i+2];

				if(s1 != s2)
					dp[i-3][3] = max(dp[i-3][3], dp[i][3]);
			}

		}
		if(i >= 2)
		{
			dp[i-2][2] = max(dp[i-2][2], dp[i][3]);

			if(i+1 >= n) dp[i-2][2] = max(dp[i-2][2], dp[i][2]);
			else
			{
				string s1 = ""; s1 = s[i-2]; s1 += s[i-1];
				string s2 = ""; s2 = s[i]; s2 += s[i+1];

				if(s1 != s2)
					dp[i-2][2] = max(dp[i-2][2], dp[i][2]);
			}
		}
	}

	for(int i = 0; i < n; i++)
	{
		if(dp[i][2])
		{
			string s1 = ""; s1 = s[i]; s1 += s[i+1];
			st.insert(s1);
		}
		if(dp[i][3])
		{
			string s2 = ""; s2 = s[i]; s2 += s[i+1], s2 += s[i+2];
			st.insert(s2);
		}

	}
	cout << st.size() << "\n";
	for(auto it : st) cout << it << "\n";

	// for(int i = 0; i <= n; i++) cout << dp[i][2] << " "; cout << "\n";
	// for(int i = 0; i <= n; i++) cout << dp[i][3] << " "; cout << "\n";
}


#include <stdio.h>
#include <math.h>
#include <string.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <utility>
#include <stack>
#include <queue>
#include <set>
#include <list>
#include <bitset>
#include <array>

using namespace std;

#define fi first
#define se second
#define long long long
typedef pair<int,int> ii;

int dp[10003][4];
int n;
string s;
set<string> st;

int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	freopen("input.in", "r", stdin);

	cin >> s;
	s.erase(0,5);
	n = s.size();
	dp[n][2] = dp[n][3] = 1;
	for(int i = n; i >= 2; i--)
	{
		if(i >= 3)
		{
			dp[i-3][3] = max(dp[i-3][3], dp[i][2]);
			if(i+2 >= n) dp[i-3][3] = max(dp[i-3][3], dp[i][3]);
			else
			{
				string s1 = ""; s1 += s[i-3]; s1 += s[i-2]; s1 += s[i-1];
				string s2 = ""; s2 += s[i]; s2 += s[i+1]; s2 += s[i+2];

				if(s1 != s2)
					dp[i-3][3] = max(dp[i-3][3], dp[i][3]);
			}

		}
		if(i >= 2)
		{
			dp[i-2][2] = max(dp[i-2][2], dp[i][3]);

			if(i+1 >= n) dp[i-2][2] = max(dp[i-2][2], dp[i][2]);
			else
			{
				string s1 = ""; s1 = s[i-2]; s1 += s[i-1];
				string s2 = ""; s2 = s[i]; s2 += s[i+1];

				if(s1 != s2)
					dp[i-2][2] = max(dp[i-2][2], dp[i][2]);
			}
		}
	}

	for(int i = 0; i < n; i++)
	{
		if(dp[i][2])
		{
			string s1 = ""; s1 = s[i]; s1 += s[i+1];
			st.insert(s1);
		}
		if(dp[i][3])
		{
			string s2 = ""; s2 = s[i]; s2 += s[i+1], s2 += s[i+2];
			st.insert(s2);
		}

	}
	cout << st.size() << "\n";
	for(auto it : st) cout << it << "\n";

	// for(int i = 0; i <= n; i++) cout << dp[i][2] << " "; cout << "\n";
	// for(int i = 0; i <= n; i++) cout << dp[i][3] << " "; cout << "\n";
}


#include <bits/stdc++.h>
using namespace std;
int const MAXN = 1e4+9;
int vis[MAXN];
string s;
set<string> st;
void solve (int n, bool a, bool b){
    if (vis[n]) return ;
    if (n  == 4) return ;
    vis [n] = true;
    if (n - 2 >= 4 && a){
        int nxt = n-2;
        string str = s.substr(nxt-2+1,2);
        string cur = s.substr(n-2+1,2);
        st.insert(cur);
        if (str == cur ) a = false;
        solve (n-2,a,true);
    }
    if (n -3 >= 4 && b){
        int nxt = n-3;
        string str = s.substr(nxt-3+1,3);
        string cur = s.substr(n-3+1,3);
        st.insert(cur);
        solve (n-3,true,b);
    }
}
int main (){
    int n;
    cin >> s;
    n = s.size();
    solve (n-1, true, true);
    cout << st.size() << "\n";
    for (auto cur : st)
        cout << cur << "\n";

}


#include <bits/stdc++.h>
using namespace std;
int const MAXN = 1e4+9;
int vis[MAXN];
string s;
set<string> st;
void solve (int n, bool a, bool b){
    if (vis[n]) return ;
    if (n  == 4) return ;
    vis [n] = true;
    if (n - 2 >= 4 && a){
        int nxt = n-2;
        string str = s.substr(nxt-2+1,2);
        string cur = s.substr(n-2+1,2);
        st.insert(cur);
        if (str == cur ) a = false;
        solve (n-2,a,true);
    }
    if (n -3 >= 4 && b){
        int nxt = n-3;
        string str = s.substr(nxt-3+1,3);
        string cur = s.substr(n-3+1,3);
        st.insert(cur);
        if (str == cur) b = false;
        solve (n-3,true,b);
    }
}
int main (){
    int n;
    cin >> s;
    n = s.size();
    solve (n-1, true, true);
    cout << st.size() << "\n";
    for (auto cur : st)
        cout << cur << "\n";

}


#include <bits/stdc++.h>
using namespace std;
int const MAXN = 1e4+9;
int vis[MAXN][3][3];
string s;
set<string> st;
void solve (int n, bool a, bool b){
    if (vis[n][a][b]) return ;
    vis [n][a][b]= true;
    if (n - 2 >= 4 && a){
        int nxt = n-2;
        string str = s.substr(nxt-2+1,2);
        string cur = s.substr(n-2+1,2);
        st.insert(cur);
        if (str == cur ) a = false;
        solve (n-2,a,true);
    }
    if (n - 3 >= 4 && b){
        int nxt = n-3;
        string str = s.substr(nxt-3+1,3);
        string cur = s.substr(n-3+1,3);
        st.insert(cur);
        if (str == cur) b = false;
        solve (n-3,true,b);
    }
}
int main (){
    int n;
    cin >> s;
    n = s.size();
    solve (n-1, true, true);
    cout << st.size() << "\n";
    for (auto cur : st)
        cout << cur << "\n";

}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define MAXN 1000005
#define mod 1000000007;

typedef pair<int, int> P;
// KORISTI 1LL kad je lo
#define GORE 1
#define LEVO 2
#define DOLE 3
#define DESNO 4
#define MOD 1000000007

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    string rec;
    cin >> rec;
    set<string> s;
    int L = rec.length();
    string nova="";

    if(rec.length() < 7)
    {
        cout << 0;
        return 0;
    }

    for(int i = 5;i<L;i++)
    {
        nova+=rec[i];
    }

    if(nova.length() == 2)
    {
        cout << 1 << "\n";
        cout << nova[0] << nova[1];
        return 0;
    }
    if(nova.length() == 3)
    {
        string pomm = "";
        cout << "2\n";
        pomm+=nova[0];
        pomm+=nova[1];
        pomm+=nova[2];
        s.insert(pomm);
        pomm="";
        pomm+=nova[1];
        pomm+=nova[2];
        s.insert(pomm);

        for(auto u : s)
        {
            cout << u << "\n";
        }
        return 0;

    }

    for(int i = 0;i<nova.length()-2;i++)
    {
        string pom="";
        if(i == nova.length()-4)
        {
            pom+=nova[i];
            pom+=nova[i+1];
            s.insert(pom);
            pom="";
            pom+=nova[i+1];
            pom+=nova[i+2];
            pom+=nova[i+3];
            s.insert(pom);
            pom="";
            pom+=nova[i+2];
            pom+=nova[i+3];
            s.insert(pom);
            break;
        }

        pom+=nova[i];
        pom+=nova[i+1];
        pom+=nova[i+2];

        string pom2="";
        pom2 += nova[i+3];
        pom2 += nova[i+4];
        pom2 += nova[i+5];
        string pom3="";
        pom3 += nova[i+6];
        pom3 += nova[i+7];
        pom3 += nova[i+8];

        if(pom3 != pom2)
        s.insert(pom);
        pom="";
        pom2="";
        pom3="";
        pom+=nova[i];
        pom+=nova[i+1];

        pom2+=nova[i+2];
        pom2+=nova[i+3];

        pom3+=nova[i+4];
        pom3+=nova[i+5];

        if(pom3 != pom2)
        s.insert(pom);
    }

    cout << s.size() << "\n";
    for(auto u : s)
    {
        cout << u << "\n";
    }

return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define MAXN 1000005
#define mod 1000000007;

typedef pair<int, int> P;
// KORISTI 1LL kad je lo
#define GORE 1
#define LEVO 2
#define DOLE 3
#define DESNO 4
#define MOD 1000000007

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    string s;
    cin >> s;

    bool dp[10005][2];
    memset(dp,0,sizeof(dp));
    int L = s.length();
    dp[L-2][0]=1;
    dp[L-3][1]=1;
    for(int i  = L-4;i>4;i--)
    {
        dp[i][0] = dp[i+2][1] || dp[i+2][0] && (s[i] != s[i+2] || s[i+1] != s[i+3]);
        dp[i][1] = dp[i+3][0] || dp[i+3][1] && (s[i]!=s[i+3] || s[i+1] !=s[i+4] || s[i+2] != s[i+5]);
    }

    set<string> st;
    for(int i = 5;i<L;i++)
    {
        if(dp[i][0])
        {
            string pom="";
            pom+=s[i];
            pom+=s[i+1];
            st.insert(pom);
        }
        if(dp[i][1])
        {
            string pom="";
            pom+=s[i];
            pom+=s[i+1];
            pom+=s[i+2];
            st.insert(pom);
        }
    }

    cout << st.size() << "\n";
    for(auto u : st)
    {
        cout << u << "\n";
    }

return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define MAXN 1000005
#define mod 1000000007;

typedef pair<int, int> P;
// KORISTI 1LL kad je lo
#define GORE 1
#define LEVO 2
#define DOLE 3
#define DESNO 4
#define MOD 1000000007

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    string s;
    cin >> s;

    bool dp[10005][2];

    int L = s.length();

    for(int i  = L-1;i>5;i--)
    {
        string pom,pom2;
        if(i+1 < L)
        {
            pom="";
            pom+=s[i];
            pom+=s[i+1];
            pom2="";
            pom2+=s[i+2];
            pom2+=s[i+3];
            if(!dp[i+2][0] == 1 || pom != pom2 || dp[i+3][1]==1)
            {
                dp[i][0]=1;
            }else
            dp[i][0]=0;
        }else
        dp[i][0]=0;

        if(i+2 < L)
        {
            pom2="";
            pom+=s[i+2];
            pom2+=s[i+3];
            pom2+=s[i+4];
            pom2+=s[i+5];
            if(!dp[i+3][1] == 1 || pom != pom2 || dp[i+2][0]==1)
            {
                dp[i][1]=1;
            }else
            dp[i][1]=0;
        }else
        dp[i][1]=0;
    }
    set<string> st;
    for(int i = 5;i<L;i++)
    {
        if(dp[i][0])
        {
            string pom="";
            pom+=s[i];
            pom+=s[i+1];
            st.insert(pom);
        }
        if(dp[i][1])
        {
            string pom="";
            pom+=s[i];
            pom+=s[i+1];
            pom+=s[i+2];
            st.insert(pom);
        }
    }

    cout << st.size() << "\n";
    for(auto u : st)
    {
        cout << u << "\n";
    }

return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define MAXN 1000005
#define mod 1000000007;

typedef pair<int, int> P;
// KORISTI 1LL kad je lo
#define GORE 1
#define LEVO 2
#define DOLE 3
#define DESNO 4
#define MOD 1000000007

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    string rec;
    cin >> rec;
    set<string> s;
    int L = rec.length();
    string nova="";

    if(rec.length() < 7)
    {
        cout << 0;
        return 0;
    }

    for(int i = 5;i<L;i++)
    {
        nova+=rec[i];
    }

    if(nova.length() == 2)
    {
        cout << 1 << "\n";
        cout << nova[0] << nova[1];
        return 0;
    }
    if(nova.length() == 3)
    {
        string pomm = "";
        cout << "2\n";
        pomm+=nova[0];
        pomm+=nova[1];
        pomm+=nova[2];
        s.insert(pomm);
        pomm="";
        pomm+=nova[1];
        pomm+=nova[2];
        s.insert(pomm);

        for(auto u : s)
        {
            cout << u << "\n";
        }
        return 0;

    }

    for(int i = 0;i<nova.length()-2;i++)
    {
        string pom="";
        if(i == nova.length()-4)
        {
            pom+=nova[i];
            pom+=nova[i+1];
            s.insert(pom);
            pom="";
            pom+=nova[i+1];
            pom+=nova[i+2];
            pom+=nova[i+3];
            s.insert(pom);
            pom="";
            pom+=nova[i+2];
            pom+=nova[i+3];
            s.insert(pom);
            break;
        }
        pom+=nova[i];
        pom+=nova[i+1];
        pom+=nova[i+2];
        s.insert(pom);
        pom="";
        pom+=nova[i];
        pom+=nova[i+1];
        s.insert(pom);
    }

    cout << s.size() << "\n";
    for(auto u : s)
    {
        cout << u << "\n";
    }

return 0;
}


/*input
abacabaca
*/
#include <bits/stdc++.h>
using namespace std;
int n,dp[10007][4];
set< string > S;
string str;
int rec(int pos,int prev,string back)
{
	if(pos == n && prev != n - 1) return 1;
	int &ret = dp[pos][pos - prev];
	if(ret != -1 ) return ret;
	int now1 = 0, now2 = 0, now3 = 0;
	string st;
	if(pos + 2 <=n)
	{
		st+=str[pos];
		st+=str[pos+1];
		if(st != back) now1 = now1 | rec(pos + 2,pos,st);
		if(now1) S.insert(st);
	}
	if(pos + 3<=n)
	{
	   st+=str[pos+2];
	   if(st != back) now2 = now2 | rec(pos + 3,pos,st);
	   if(now2)
	   S.insert(st);
	}

	return ret = max(now1,now2);
}
int main(int argc, char const *argv[])
{
	cin >> str;
	memset(dp,-1,sizeof dp);
	n = str.length();
	if(n < 7)
	{
		cout << 0 << endl;
		return 0;
	}
	for(int i = 5; i<n; i++)
	{
		rec(i,i,"");
	}
	cout << S.size() <<endl;
	set<string> :: iterator it;
	for(it = S.begin(); it!=S.end(); it++)
		cout << *it <<endl;
	return 0;
}


/*input
abacabaca
*/
#include <bits/stdc++.h>
using namespace std;
int n,dp[10007][4];
set< string > S;
string str;
int rec(int pos,int prev,string back)
{
	if(pos == n && prev != n - 1) return 1;
	int &ret = dp[pos][pos - prev];
	if(ret != -1 ) return ret;
	int now1 = 0, now2 = 0, now3 = 0;
	string st;
	if(pos + 2 <=n)
	{
		st+=str[pos];
		st+=str[pos+1];
		if(st != back) now1 = now1 | rec(pos + 2,pos,st);
		if(now1) S.insert(st);
	}
	if(pos + 3<=n)
	{
	   st+=str[pos+2];
	   if(st != back) now2 = now2 | rec(pos + 3,pos,st);
	   if(now2)
	   S.insert(st);
	}
	rec(pos+1,pos+1,"");

	return ret = max(now1,now2);
}
int main(int argc, char const *argv[])
{
	cin >> str;
	memset(dp,-1,sizeof dp);
	n = str.length();
	if(n < 7)
	{
		cout << 0 << endl;
		return 0;
	}
	for(int i = 5; i<6; i++)
	{
		rec(i,i,"");
	}
	cout << S.size() <<endl;
	set<string> :: iterator it;
	for(it = S.begin(); it!=S.end(); it++)
		cout << *it <<endl;
	return 0;
}


#include <bits/stdc++.h>
#define LL long long
#define forit(i, a) for( __typeof((a).begin())i=(a).begin();i!=(a).end();i++)
using namespace std;
int cnt(string s,string x,int st)
{
    int a=0;
    for(int i=st;i<s.length();i++)
        if(s.substr(i,x.size())==x)a++;
    return a;
}
string x,tw,th;
set<string>s;
void solve(int st)
{
    for(int i=st;i<x.size();i++)
    {
        tw=x.substr(i,2);
        th=x.substr(i,3);
        if(cnt(x,tw,st)==1&&tw.size()==2)if(i+2<x.size()&&x.substr(i+2).size()!=1||i+2>=x.size())s.insert(tw);
        if(cnt(x,th,st)==1&&th.size()==3)if(i+3<x.size()&&x.substr(i+3).size()!=1||i+3>=x.size())s.insert(th);
    }
}
int main()
{
    cin>>x;
    for(int i=5;i<x.size();i++)solve(i);
    cout<<s.size()<<endl;
    forit(i,s)cout<<*i<<endl;
return 0;
}


#include <bits/stdc++.h>
#define LL long long
#define forit(i, a) for( __typeof((a).begin())i=(a).begin();i!=(a).end();i++)
using namespace std;
int cnt(string s,string x,int st)
{
    int a=0;
    for(int i=st;i<s.length();i++)
        if(s.substr(i,x.size())==x)a++;
    return a;
}
string x,tw,th;
set<string>s;
void solve(int st)
{
    for(int i=st;i<x.size();i++)
    {
        tw=x.substr(i,2);
        th=x.substr(i,3);
        if(cnt(x,tw,st)==1&&tw.size()==2)if(i+2<x.size()&&x.substr(i+2).size()!=1||i+2==x.size())s.insert(tw);
        if(cnt(x,th,st)==1&&th.size()==3)if(i+3<x.size()&&x.substr(i+3).size()!=1||i+3==x.size())s.insert(th);
    }
}
int main()
{
    cin>>x;
    for(int i=5;i<x.size();i++)solve(i);
    cout<<s.size()<<endl;
    forit(i,s)cout<<*i<<endl;
return 0;
}


#include <bits/stdc++.h>
#define LL long long
#define forit(i,a) for( __typeof(a.begin())i=a.begin();i!=a.end();i++)
using namespace std;
string x;
set<string>s;
bool v[10005][6];
void solve(int len,int p)
{
    if(len-p<5)return;
    v[len][p]=1;
    string a,b;
    a=x.substr(len-p,p);
    s.insert(a);
    b=x.substr(len-2*p,p);
    if(a!=b&&!v[len-p][p])solve(len-p,p);
    if(!v[len-p][p==2?3:2])solve(len-p,p==2?3:2);
}
int main()
{
    cin>>x;
    solve(x.size(),2);
    solve(x.size(),3);
    cout<<s.size()<<endl;
    forit(i,s)cout<<*i<<endl;
return 0;
}


#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
typedef long long ll;
typedef double lf;
typedef pair<ll,ll> ii;
#define REP(i,n) for(int i=0;i<n;i++)
#define REP1(i,n) for(ll i=1;i<=n;i++)
#define RST(i,n) memset(i,n,sizeof i)
#define SZ(a) (int)a.size()
#define ALL(a) a.begin(),a.end()
#define X first
#define Y second
#define mkp make_pair
#define pb push_back
#define eb emplace_back
#define pob pop_back
#ifdef cold66
#define debug(...) do{\
    fprintf(stderr,"%s - %d (%s) = ",__PRETTY_FUNCTION__,__LINE__,#__VA_ARGS__);\
    _do(__VA_ARGS__);\
}while(0)
template<typename T>void _do(T &&_x){cerr<<_x<<endl;}
template<typename T,typename ...S> void _do(T &&_x,S &&..._t){cerr<<_x<<" ,";_do(_t...);}
template<typename _a,typename _b> ostream& operator << (ostream &_s,const pair<_a,_b> &_p){return _s<<"("<<_p.X<<","<<_p.Y<<")";}
template<typename It> ostream& _OUTC(ostream &_s,It _ita,It _itb)
{
    _s<<"{";
    for(It _it=_ita;_it!=_itb;_it++)
    {
        _s<<(_it==_ita?"":",")<<*_it;
    }
    _s<<"}";
    return _s;
}
template<typename _a> ostream &operator << (ostream &_s,vector<_a> &_c){return _OUTC(_s,ALL(_c));}
template<typename _a> ostream &operator << (ostream &_s,set<_a> &_c){return _OUTC(_s,ALL(_c));}
template<typename _a,typename _b> ostream &operator << (ostream &_s,map<_a,_b> &_c){return _OUTC(_s,ALL(_c));}
template<typename _t> void pary(_t _a,_t _b){_OUTC(cerr,_a,_b);cerr<<endl;}
#define IOS()
#else
#define debug(...)
#define pary(...)
#define endl '\n'
#define IOS() ios_base::sync_with_stdio(0);cin.tie(0);
#endif // cold66
//}

template<class T> inline bool chkmax(T &a, const T &b) { return b > a ? a = b, true : false; }
template<class T> inline bool chkmin(T &a, const T &b) { return b < a ? a = b, true : false; }
template<class T> using MaxHeap = priority_queue<T>;
template<class T> using MinHeap = priority_queue<T, vector<T>, greater<T>>;

const ll MAXn=1e4+5,MAXlg=__lg(MAXn)+2;
const ll MOD=1000000007;
const ll INF=0x3f3f3f3f3f3f3f3f;

string s;
int n;
set<string> st;
int dp[MAXn][2];
int main(){
  IOS();
  cin>>s;
  n = SZ(s);
  dp[n][0] = dp[n][1] = 1;
  for(int i=n-2;i>=5;i--){
    if(dp[i+2][1]) dp[i][0] = 1;
    if(dp[i+2][0] && (s[i+2]!=s[i] || s[i+3]!=s[i+1])) dp[i][0] = 1;
    if(dp[i+3][0]) dp[i][1] = 1;
    if(dp[i+3][1] && (s[i+3]!=s[i] || s[i+4]!=s[i+1] || s[i+5]!=s[i+2])) dp[i][1] = 1;
  }
  REP(i,n) debug(dp[i][0],dp[i][1]);
  REP(i,n){
    if(dp[i][0]) st.insert(s.substr(i,2));
    if(dp[i][1]) st.insert(s.substr(i,3));
  }
  cout<<SZ(st)<<endl;
  for(auto it:st) cout<<it<<endl;
}


#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
typedef long long ll;
typedef double lf;
typedef pair<ll,ll> ii;
#define REP(i,n) for(int i=0;i<n;i++)
#define REP1(i,n) for(ll i=1;i<=n;i++)
#define RST(i,n) memset(i,n,sizeof i)
#define SZ(a) (int)a.size()
#define ALL(a) a.begin(),a.end()
#define X first
#define Y second
#define mkp make_pair
#define pb push_back
#define eb emplace_back
#define pob pop_back
#ifdef cold66
#define debug(...) do{\
    fprintf(stderr,"%s - %d (%s) = ",__PRETTY_FUNCTION__,__LINE__,#__VA_ARGS__);\
    _do(__VA_ARGS__);\
}while(0)
template<typename T>void _do(T &&_x){cerr<<_x<<endl;}
template<typename T,typename ...S> void _do(T &&_x,S &&..._t){cerr<<_x<<" ,";_do(_t...);}
template<typename _a,typename _b> ostream& operator << (ostream &_s,const pair<_a,_b> &_p){return _s<<"("<<_p.X<<","<<_p.Y<<")";}
template<typename It> ostream& _OUTC(ostream &_s,It _ita,It _itb)
{
    _s<<"{";
    for(It _it=_ita;_it!=_itb;_it++)
    {
        _s<<(_it==_ita?"":",")<<*_it;
    }
    _s<<"}";
    return _s;
}
template<typename _a> ostream &operator << (ostream &_s,vector<_a> &_c){return _OUTC(_s,ALL(_c));}
template<typename _a> ostream &operator << (ostream &_s,set<_a> &_c){return _OUTC(_s,ALL(_c));}
template<typename _a,typename _b> ostream &operator << (ostream &_s,map<_a,_b> &_c){return _OUTC(_s,ALL(_c));}
template<typename _t> void pary(_t _a,_t _b){_OUTC(cerr,_a,_b);cerr<<endl;}
#define IOS()
#else
#define debug(...)
#define pary(...)
#define endl '\n'
#define IOS() ios_base::sync_with_stdio(0);cin.tie(0);
#endif // cold66
//}

template<class T> inline bool chkmax(T &a, const T &b) { return b > a ? a = b, true : false; }
template<class T> inline bool chkmin(T &a, const T &b) { return b < a ? a = b, true : false; }
template<class T> using MaxHeap = priority_queue<T>;
template<class T> using MinHeap = priority_queue<T, vector<T>, greater<T>>;

const ll MAXn=1e5+5,MAXlg=__lg(MAXn)+2;
const ll MOD=1000000007;
const ll INF=0x3f3f3f3f3f3f3f3f;

string s;
int n;
set<string> st;

int main(){
  IOS();
  cin>>s;
  n = SZ(s);
  if(n<=5) return cout<<0<<endl,0;
  for(int i=5;i<n-1;i++){
    if(i==n-3) continue;
    string tmp = s.substr(i,2);
    st.insert(tmp);
  }
  for(int i=5;i<n-2;i++){
    if(i==n-4) continue;
    string tmp = s.substr(i,3);
    st.insert(tmp);
  }
  cout<<SZ(st)<<endl;
  for(auto it:st) cout<<it<<endl;
}


#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define read(type) readInt<type>()
#define gc getchar
template <typename T> inline void write(T x)
{
	int i = 20;
	char buf[21];
	// buf[10] = 0;
	buf[20] = '\n';

	do
	{
		buf[--i] = x % 10 + '0';
		x/= 10;
	}while(x);
	do
	{
		putchar(buf[i]);
	} while (buf[i++] != '\n');
}

template <typename T> inline T readInt()
{
	T n=0,s=1;
	char p=gc();
	if(p=='-')
		s=-1;
	while((p<'0'||p>'9')&&p!=EOF&&p!='-')
		p=gc();
	if(p=='-')
		s=-1,p=gc();
	while(p>='0'&&p<='9') {
		n = (n<< 3) + (n<< 1) + (p - '0');
		p=gc();
	}

	return n*s;
}
string s;
long long dp[20000][3],len;
set<string> st;
long long rec(long long pos , long long prev){

	if(dp[pos][prev] != -1)
		return dp[pos][prev];

	if(pos == len-5 || pos == len-4)
		return 1;

	if(pos >= len-3)
		return 0;

	long long ret = 0;
	if(prev == 2){
		if(s[pos] == s[pos-2] && s[pos+1] == s[pos-1]){
			ret = rec(pos+3,3);
			if(pos +3 <= len-5)
			st.insert(s.substr(pos,3));
		}else{
			ret = rec(pos+2,2) + rec(pos+3,3);
			if(pos +2 <= len-5)
			st.insert(s.substr(pos,2));
			if(pos +3 <= len-5)
			st.insert(s.substr(pos,3));
		}
	}else if(prev == 3){
		if(s[pos] == s[pos-3] && s[pos+1] == s[pos-2] && s[pos+2] == s[pos-1]){
			ret = rec(pos+2,2);
			if(pos + 2 <= len-5)
			st.insert(s.substr(pos,2));
		}else{
			ret = rec(pos+2,2) + rec(pos+3,3);
			if(pos + 2 <= len-5)
			st.insert(s.substr(pos,2));
			if(pos + 3 <= len-5)
			st.insert(s.substr(pos,3));
		}
	}else{
		ret = rec(pos+2,2) + rec(pos+3,3);
		if(pos + 2 <= len-5)
		st.insert(s.substr(pos,2));
		if(pos + 3 <= len-5)
		st.insert(s.substr(pos,3));
	}
	dp[pos][prev] = ret;
	return ret;
}
int main()
{

	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);
	#endif
	//begin
	cin>>s;
	reverse(s.begin(),s.end());
	len = s.size();
	memset(dp,-1,sizeof(dp));
	long long temp = rec(0,0);
	cout<<st.size()<<endl;
	for(auto i:st)
		cout<<i<<endl;
}


#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define read(type) readInt<type>()
#define gc getchar
template <typename T> inline void write(T x)
{
	int i = 20;
	char buf[21];
	// buf[10] = 0;
	buf[20] = '\n';

	do
	{
		buf[--i] = x % 10 + '0';
		x/= 10;
	}while(x);
	do
	{
		putchar(buf[i]);
	} while (buf[i++] != '\n');
}

template <typename T> inline T readInt()
{
	T n=0,s=1;
	char p=gc();
	if(p=='-')
		s=-1;
	while((p<'0'||p>'9')&&p!=EOF&&p!='-')
		p=gc();
	if(p=='-')
		s=-1,p=gc();
	while(p>='0'&&p<='9') {
		n = (n<< 3) + (n<< 1) + (p - '0');
		p=gc();
	}

	return n*s;
}
string s;
long long dp[20000][3],len;
set<string> st;
long long rec(long long pos , long long prev){

	if(dp[pos][prev] != -1)
		return dp[pos][prev];

	if(pos == len-5 || pos == len-4)
		return 1;

	if(pos >= len-3)
		return 0;

	long long ret = 0;
	if(prev == 2){
		if(s[pos] == s[pos-2] && s[pos+1] == s[pos-1]){
			ret = rec(pos+3,3);
			if(pos +3 <= len-5)
				st.insert(s.substr(pos,3));
		}else{
			ret = rec(pos+2,2) + rec(pos+3,3);
			if(pos +2 <= len-5)
				st.insert(s.substr(pos,2));
			if(pos +3 <= len-5)
				st.insert(s.substr(pos,3));
		}
	}else if(prev == 3){
		if(s[pos] == s[pos-3] && s[pos+1] == s[pos-2] && s[pos+2] == s[pos-1]){
			ret = rec(pos+2,2);
			if(pos + 2 <= len-5)
				st.insert(s.substr(pos,2));
		}else{
			ret = rec(pos+2,2) + rec(pos+3,3);
			if(pos + 2 <= len-5)
				st.insert(s.substr(pos,2));
			if(pos + 3 <= len-5)
				st.insert(s.substr(pos,3));
		}
	}else{
		ret = rec(pos+2,2) + rec(pos+3,3);
		if(pos + 2 <= len-5)
			st.insert(s.substr(pos,2));
		if(pos + 3 <= len-5)
			st.insert(s.substr(pos,3));
	}
	dp[pos][prev] = ret;
	return ret;
}
int main()
{

	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);
	#endif
	//begin
	cin>>s;
	reverse(s.begin(),s.end());
	len = s.size();
	memset(dp,-1,sizeof(dp));
	long long temp = rec(0,0);
	cout<<st.size()<<endl;
	set<string> st2;
	for(auto i:st){
		string s = i;
		reverse(s.begin(),s.end());
		st2.insert(s);
	}
	for(auto i:st2)
		cout<<i<<endl;
}


#pragma GCC optimize("O3")
#include<bits/stdc++.h>
using namespace std;
#define int long long
//#define d long double
#define pii pair<int,int>
#define pb push_back
#define N 10003
#define inf 1e14
#define Arena ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
int mod=1e9+7;
set<string> v;
bool vis[N];

void rec(string s,int j,string sp)
{
    if(j<=6)
        return;

    string s1("");
    if(vis[j])
        return;

    vis[j]=1;
    if(j==7)
    {
        s1=s[j-2];
        s1+=s[j-1];
        if(s1!=sp)
            v.insert(s1);
        return;
    }

    s1=s[j-3];
    s1+=s[j-2];
    s1+=s[j-1];
    if(s1!=sp)
        v.insert(s1);
    rec(s,j-3,s1);
    s1=s[j-2];
    s1+=s[j-1];
    if(s1!=sp)
        v.insert(s1);
    rec(s,j-2,s1);
}

signed main()
{
    Arena

    string s;
    cin>>s;
    int n=s.size();
    rec(s,n,"");
    cout<<v.size()<<'\n';
    for(auto it:v)
        cout<<it<<'\n';
    cout<<'\n'<<v.size()<<'\n';

    return 0;
}


#pragma GCC optimize("O3")
#include<bits/stdc++.h>
using namespace std;
#define int long long
//#define d long double
#define pii pair<int,int>
#define pb push_back
#define N 10003
#define inf 1e14
#define Arena ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
int mod=1e9+7;
set<string> v;
bool vis[N];

void rec(string s,int j,string sp)
{
    if(j<=6)
        return;

    string s1("");
    if(vis[j])
        return;

    vis[j]=1;
    if(j==7)
    {
        s1=s[j-2];
        s1+=s[j-1];
        if(s1!=sp)
            v.insert(s1);
        return;
    }

    s1=s[j-3];
    s1+=s[j-2];
    s1+=s[j-1];
    if(s1!=sp)
    {
        v.insert(s1);
        rec(s,j-3,s1);
    }
    s1=s[j-2];
    s1+=s[j-1];
    if(s1!=sp)
    {
        v.insert(s1);
        rec(s,j-2,s1);
    }
}

signed main()
{
    Arena

    string s;
    cin>>s;
    int n=s.size();
    rec(s,n,"");
    cout<<v.size()<<'\n';
    for(auto it:v)
        cout<<it<<'\n';

    return 0;
}


#pragma GCC optimize("O3")
#include<bits/stdc++.h>
using namespace std;
#define int long long
//#define d long double
#define pii pair<int,int>
#define pb push_back
#define N 10003
#define inf 1e14
#define Arena ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
int mod=1e9+7;
set<string> v;
bool vis[N][4];

void rec(string s,int j,string sp)
{
    if(j<=6)
        return;

    string s1("");
    if(vis[j][sp.size()])
        return;

    vis[j][sp.size()]=1;
    if(j==7)
    {
        s1=s[j-2];
        s1+=s[j-1];
        if(s1!=sp)
            v.insert(s1);
        return;
    }

    s1=s[j-3];
    s1+=s[j-2];
    s1+=s[j-1];
    if(s1!=sp)
    {
        v.insert(s1);
        rec(s,j-3,s1);
    }
    s1=s[j-2];
    s1+=s[j-1];
    if(s1!=sp)
    {
        v.insert(s1);
        rec(s,j-2,s1);
    }
}

signed main()
{
    Arena

    string s;
    cin>>s;
    int n=s.size();
    rec(s,n,"");
    cout<<v.size()<<'\n';
    for(auto it:v)
        cout<<it<<'\n';

    return 0;
}


#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <set>
#include <map>

using namespace std;

int main() {
	int q;
	string s, t;
	cin >> q;
	while (q-- > 0) {
		cin >> s >> t;
		if (s == t) {
			cout << "YES\n";
			continue;
		}
		set<char> x1, x2;
		map<char, int> xxx, xxx2;
		for (int i = 'a'; i <= 'z'; ++i) {
			xxx[i] = 0;
			xxx2[i] = 0;
		}
		for (int i = 0; i < s.size(); ++i) {
			x1.insert(s[i]);
			xxx[s[i]] += 1;
		}
		for (int i = 0; i < t.size(); ++i) {
			x2.insert(t[i]);
			xxx2[t[i]] += 1;
		}
		bool res = true;
		for (set<char>::iterator i = x2.begin(); i != x2.end(); ++i) {
			if (x1.count(*i) == 0) {
				res = false;
				break;
			}
		}
		if (!res) {
			cout << "NO\n";
			continue;
		}
		res = false;
		for (auto i = xxx.begin(); i != xxx.end(); ++i) {
			if ((*i).second > 1) {
				res = true;
				break;
			}
		}

		if (res) {
			cout << "YES\n";
		}

		for (auto i = xxx2.begin(); i != xxx2.end(); ++i) {
			if ((*i).second > 1) {
				res = true;
				break;
			}
		}

		if (res) {
			cout << "YES\n";

		}
		else cout << "NO\n";
	}
}


#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <set>
#include <map>

using namespace std;

int main() {
	int q;
	string s, t;
	cin >> q;
	while (q-- > 0) {
		cin >> s >> t;
		if (s == t) {
			cout << "YES\n";
			continue;
		}
		set<char> x1, x2;
		map<char, int> xxx;
		for (int i = 'a'; i <= 'z'; ++i) xxx[i] = 0;
		for (int i = 0; i < s.size(); ++i) {
			x1.insert(s[i]);
			xxx[s[i]] += 1;
		}
		for (int i = 0; i < t.size(); ++i) {
			x2.insert(t[i]);
		}
		bool res = true;
		for (set<char>::iterator i = x2.begin(); i != x2.end(); ++i) {
			if (x1.count(*i) == 0) {
				res = false;
				break;
			}
		}
		if (!res) {
			cout << "NO\n";
			continue;
		}
		res = false;
		for (auto i = xxx.begin(); i != xxx.end(); ++i) {
			if ((*i).second > 1) {
				res = true;
				break;
			}
		}

		if (res) {
			cout << "YES\n";
		}
		else cout << "NO\n";
	}
}


#include <bits/stdc++.h>

using namespace std;

void do_it(string t, string s) {
    for (char S : s) {
            for (char T : t) {
                if (T == S) {
                    cout << "YES\n";
                    return;
                }
            }
        }
    cout << "NO\n";
}

signed main () {
    int q;
    string s, t;
    cin >> q;
    while (q-- > 0) {
        cin >> s >> t;
        do_it(t, s);
    }
}


#include<bits/stdc++.h>
using namespace std;

int main()
{
	int n,flag=0;
	string s,t;
	cin>>n;
	while(n)
	{
		cin>>s;
		cin>>t;
		for(i=0;i<strlen(s);i++)
		{
			for(j=0;j<strlen(t);j++)
			{
				if(s[i]==t[j])
				{
					flag=1;
					break;
				}
			}
			if(flag==1)
			{
				cout<<"YES";
				n--;
				break;
			}
		}
		if(flag==0)
		{
			cout<<"NO";
			n--;
		}
	}
	return 0;
}


#include<bits/stdc++.h>
#include<string.h>
using namespace std;

int main()
{
	int j,i,n,flag=0;
	string s,t;
	cin>>n;
	while(n)
	{
		flag=0;
		cin>>s;
		cin>>t;
		for(i=0;i<strlen(s);i++)
		{
			for(j=0;j<strlen(t);j++)
			{
				if(s[i]==t[j])
				{
					flag=1;
					break;
				}
			}
			if(flag==1)
			{
				cout<<"YES";
				n--;
				break;
			}
		}
		if(flag==0)
		{
			cout<<"NO";
			n--;
		}
	}
	return 0;
}


#include<bits/stdc++.h>
#include<string.h>
using namespace std;

int main()
{
	int j,i,n,flag=0;
	string s,t;
	cin>>n;

	while(n)
	{
		flag=0;
		unordered_set<string> a;
		cin>>s;
		cin>>t;
		if(s.size()!=t.size())
		{
			cout<<"NO";
			n--;
		}
		else
		{
			for(i=0;i<s.size();i++)
				a.insert(s[i]);
			for(i=0;i<t.size();i++)
			{
				if(a.find(t[i])!=a.end())
				{
					cout<<"YES";
					n--;
					flag=1;
					break;
				}
			}
			if(flag==0)
			{
				cout<<"NO";
				n--;
			}

		}
	}
	return 0;
}


#include<bits/stdc++.h>
#include<string.h>
using namespace std;

int main()
{
	int j,i,n,flag=0;
	string s,t;
	cin>>n;

	while(n)
	{
		flag=0;
		unordered_set<char> a;
		cin>>s;
		cin>>t;
		if(s.size()!=t.size())
		{
			cout<<"NO";
			n--;
		}
		else
		{
			for(i=0;i<s.size();i++)
				a.insert(s[i]);
			for(i=0;i<t.size();i++)
			{
				if(a.find(t[i])!=a.end())
				{
					cout<<"YES"<<endl;
					n--;
					flag=1;
					break;
				}
			}
			if(flag==0)
			{
				cout<<"NO"<<endl;
				n--;
			}

		}
	}
	return 0;
}


#include<bits/stdc++.h>
#include<string.h>
using namespace std;

int main()
{
	int j,i,n,flag=0;
	string s,t;
	cin>>n;
	while(n)
	{
		flag=0;
		cin>>s;
		cin>>t;
		for(i=0;i<s.size();i++)
		{
			for(j=0;j<t.size();j++)
			{
				if(s[i]==t[j])
				{
					flag=1;
					break;
				}
			}
			if(flag==1)
			{
				cout<<"YES";
				n--;
				break;
			}
		}
		if(flag==0)
		{
			cout<<"NO";
			n--;
		}
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main()
{
	int j,i,n,flag=0;
	string s,t;
	cin>>n;
	while(n)
	{
		flag=0;
		cin>>s;
		cin>>t;
		for(i=0;i<strlen(s);i++)
		{
			for(j=0;j<strlen(t);j++)
			{
				if(s[i]==t[j])
				{
					flag=1;
					break;
				}
			}
			if(flag==1)
			{
				cout<<"YES";
				n--;
				break;
			}
		}
		if(flag==0)
		{
			cout<<"NO";
			n--;
		}
	}
	return 0;
}


#include<bits/stdc++.h>
#include<string.h>
using namespace std;

int main()
{
	int j,i,n,flag=0;
	string s,t;
	cin>>n;

	while(n)
	{
		flag=0;
		set<int> a;
		cin>>s;
		cin>>t;
		if(s.size()!=t.size())
		{
			cout<<"NO";
			n--;
		}
		else
		{
			for(i=0;i<s.size();i++)
					a.insert(s[i]);
				for(i=0;i<t.size();i++)
				{
					if(a.find(t[i])!=a.end())
					{
						cout<<"YES";
						n--;
						break;
					}
					else
						{
							n--;
							cout<<"NO";
							break;
						}
				}}
	}
	return 0;
}


#include<bits/stdc++.h>
#include<string.h>
using namespace std;

int main()
{
	int j,i,n,flag=0;
	string s,t;
	cin>>n;

	while(n)
	{
		flag=0;
		unordered_set<char> a;
		cin>>s;
		cin>>t;
		if(s.size()!=t.size())
		{
			cout<<"NO";
			n--;
		}
		else
		{
			for(i=0;i<s.size();i++)
				a.insert(s[i]);
			for(i=0;i<t.size();i++)
			{
				if(a.find(t[i])!=a.end())
				{
					cout<<"YES";
					n--;
					flag=1;
					break;
				}
			}
			if(flag==0)
			{
				cout<<"NO";
				n--;
			}

		}
	}
	return 0;
}


#include <iostream>
#include <string.h>

using namespace std;
int main(int argc, char** argv) {
	char s[101],t[101];
	bool l;
	int a[123];
	int q;
	cin>>q;
	for (int j=1;j<=q;j++)
	{
	for (int i=97;i<=122;i++) a[i]=0;
	l=true;
	cin>>s;
	cin>>t;
	int x;
	x=strlen(s);
	for (int i=0;i<x;i++) a[(int)s[i]]++;
	for (int i=0;i<x;i++) if (a[(int)t[i]]==0) l=false;
	if (l) cout<<"YES"<<"\n";
	else cout<<"NO"<<"\n";
	}
	return 0;
}


#include <iostream>
#include <string>
#include <string.h>
#include <algorithm>

using namespace std;
int main(int argc, char** argv) {
	string c,s,t;
	bool l;
	int a[123];
	getline(cin,c);
	int q;
	q=atoi(c.c_str());
	for (int j=1;j<=q;j++)
	{
	for (int i=97;i<=122;i++) a[i]=0;
	l=false;
	getline(cin,s);
	getline(cin,t);
	int x;
	x=s.size();
	for (int i=0;i<x;i++) a[(int)s[i]]++;
	for (int i=0;i<x;i++) if (a[(int)t[i]]!=0) l=true;
	if (l) cout<<"YES"<<"\n";
	else cout<<"NO"<<"\n";
	s.clear();
	c.clear();
	}
	return 0;
}


#include <iostream>
#include <string.h>

using namespace std;
int main(int argc, char** argv) {
	char s[101],t[101];
	bool l;
	int a[123];
	int q;
	cin>>q;
	for (int j=1;j<=q;j++)
	{
	for (int i=97;i<=122;i++) a[i]=0;
	l=true;
	cin>>s;
	cin>>t;
	int x;
	x=strlen(s);
	for (int i=0;i<x;i++) a[(int)s[i]]++;
	for (int i=0;i<x;i++) if (a[(int)t[i]]==0) l=false;
	if (l) cout<<"YES"<<"\n";
	else cout<<"NO"<<"\n";
	s[x]={0};
	t[x]={0};
	}
	return 0;
}


// CODE by Kazhybay Askar
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <bits/stdc++.h>

using namespace std;
using namespace __gnu_pbds;

#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define iter   set<int>::iterator
#define f      first
#define s      second
#define pb     push_back
#define pf     push_front
#define mp     make_pair
#define cont   continue
#define ll     long long
#define Speed  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define sz     size()
#define all(x) x.begin(),x.end()
#define cont   continue
#define r0     return 0
#define endl   '\n'

const int MAXN = 1e5  + 7;
const int MOD  = 1e9  + 7;
const int INF  = 1e9  + 7;
const ll  MINF = 1e18 + 7;
const int EPS  = 1e-6;
const int dx[] = {0, 0, 1, -1, -1, -1, 1, 1};
const int dy[] = {1, -1, 0, 0, -1, 1, -1, 1};
const double pi = acos(-1.0);

typedef long double   ld;
typedef pair<ll,ll>   pll;
typedef pair<int,int> pii;
typedef pair<char,char> pcc;

ll a[MAXN],b[MAXN];
vector<int>g[MAXN],v;
bool used[MAXN];
ll n,m,k,cnt=0,sum=0,ans=0,mx=0,mn=INF;
bool y=0;

void freopen(){
	freopen("A.in","r",stdin);
	freopen("A.out","w",stdout);
}

void solve(){
	string s,  t;
	cin>>s>>t;
	y=0;
	for(int i=0;i<s.sz;i++){
        if(s[i]==t[i]){
            cont;
        }
        if(t[i-1]==s[i] || t[i+1]==s[i]){
            t[i]=s[i];
            cont;
        }
        if(s[i-1]==t[i] || s[i+1]==t[i]){
            s[i]=t[i];
            cont;
        }
        y=1;
        cout<<"NO"<<endl;
        break;
	}
	if(y==0){
        cout<<"YES"<<endl;
	}
}

int main(){
	Speed;
	ll T=1;
	cin>>T;
	while(T--){
		solve();
	}
	r0;
}


// CODE by Kazhybay Askar
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <bits/stdc++.h>

using namespace std;
using namespace __gnu_pbds;

#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define iter   set<int>::iterator
#define f      first
#define s      second
#define pb     push_back
#define pf     push_front
#define mp     make_pair
#define cont   continue
#define ll     long long
#define Speed  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define sz     size()
#define all(x) x.begin(),x.end()
#define cont   continue
#define r0     return 0
#define endl   '\n'

const int MAXN = 1e5  + 7;
const int MOD  = 1e9  + 7;
const int INF  = 1e9  + 7;
const ll  MINF = 1e18 + 7;
const int EPS  = 1e-6;
const int dx[] = {0, 0, 1, -1, -1, -1, 1, 1};
const int dy[] = {1, -1, 0, 0, -1, 1, -1, 1};
const double pi = acos(-1.0);

typedef long double   ld;
typedef pair<ll,ll>   pll;
typedef pair<int,int> pii;
typedef pair<char,char> pcc;

ll a[MAXN],b[MAXN];
vector<int>g[MAXN],v;
bool used[MAXN];
ll n,m,k,cnt=0,sum=0,ans=0,mx=0,mn=INF;
bool y=0;

void freopen(){
	freopen("A.in","r",stdin);
	freopen("A.out","w",stdout);
}

void solve(){
	string s,  t;
	cin>>s>>t;
	string s1=s,t1=t;
	y=0;
	int j;
	for(int i=0;i<s.sz;i++){
        j=i+1;
        while(s[i]==t[j]){
            s[j]=s[i];
            j++;
        }
        j=i-1;
        while(s[i]==t[j]){
            s[j]=s[i];
            j--;
        }

        j=i+1;
        while(t[i]==s[j]){
            t[j]=t[i];
            j++;
        }
        j=i-1;
        while(s[i]==t[j]){
            t[j]=t[i];
            j--;
        }
	}
	if(s==t){
        cout<<"YES"<<endl;
	}
	else cout<<"NO"<<endl;
}

int main(){
	Speed;
	ll T=1;
	cin>>T;
	while(T--){
		solve();
	}
	r0;
}


// CODE by Kazhybay Askar
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <bits/stdc++.h>

using namespace std;
using namespace __gnu_pbds;

#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define iter   set<int>::iterator
#define f      first
#define s      second
#define pb     push_back
#define pf     push_front
#define mp     make_pair
#define cont   continue
#define ll     long long
#define Speed  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define sz     size()
#define all(x) x.begin(),x.end()
#define cont   continue
#define r0     return 0
#define endl   '\n'

const int MAXN = 1e5  + 7;
const int MOD  = 1e9  + 7;
const int INF  = 1e9  + 7;
const ll  MINF = 1e18 + 7;
const int EPS  = 1e-6;
const int dx[] = {0, 0, 1, -1, -1, -1, 1, 1};
const int dy[] = {1, -1, 0, 0, -1, 1, -1, 1};
const double pi = acos(-1.0);

typedef long double   ld;
typedef pair<ll,ll>   pll;
typedef pair<int,int> pii;
typedef pair<char,char> pcc;

ll a[MAXN],b[MAXN];
vector<int>g[MAXN],v;
bool used[MAXN];
ll n,m,k,cnt=0,sum=0,ans=0,mx=0,mn=INF;
bool y=0;

void freopen(){
	freopen("A.in","r",stdin);
	freopen("A.out","w",stdout);
}

void solve(){
	string s,  t;
	cin>>s>>t;
	string s1=s,t1=t;
	y=0;
	for(int i=0;i<s.sz;i++){
        for(int j=0;j<t.sz;j++){
            if(s[i]==t[j]){
                y=1;
            }
        }
	}

	if(y==1){
        cout<<"YES"<<endl;
	}
	else cout<<"NO"<<endl;
}

int main(){
	Speed;
	ll T=1;
	cin>>T;
	while(T--){
		solve();
	}
	r0;
}


// CODE by Kazhybay Askar
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <bits/stdc++.h>

using namespace std;
using namespace __gnu_pbds;

#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define iter   set<int>::iterator
#define f      first
#define s      second
#define pb     push_back
#define pf     push_front
#define mp     make_pair
#define cont   continue
#define ll     long long
#define Speed  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define sz     size()
#define all(x) x.begin(),x.end()
#define cont   continue
#define r0     return 0
#define endl   '\n'

const int MAXN = 1e5  + 7;
const int MOD  = 1e9  + 7;
const int INF  = 1e9  + 7;
const ll  MINF = 1e18 + 7;
const int EPS  = 1e-6;
const int dx[] = {0, 0, 1, -1, -1, -1, 1, 1};
const int dy[] = {1, -1, 0, 0, -1, 1, -1, 1};
const double pi = acos(-1.0);

typedef long double   ld;
typedef pair<ll,ll>   pll;
typedef pair<int,int> pii;
typedef pair<char,char> pcc;

ll a[MAXN],b[MAXN];
vector<int>g[MAXN],v;
bool used[MAXN];
ll n,m,k,cnt=0,sum=0,ans=0,mx=0,mn=INF;
bool y=0;

void freopen(){
	freopen("A.in","r",stdin);
	freopen("A.out","w",stdout);
}

void solve(){
	string s,  t;
	cin>>s>>t;
	y=0;
	for(int i=0;i<s.sz;i++){
        if(s[i]==t[i]){
            cont;
        }
        if(t[i-1]==s[i] || t[i+1]==s[i]){
            cont;
        }
        if(s[i-1]==t[i] || s[i+1]==t[i]){
            cont;
        }
        y=1;
        cout<<"NO"<<endl;
        break;
	}
	if(y==0){
        cout<<"YES"<<endl;
	}
}

int main(){
	Speed;
	ll T=1;
	cin>>T;
	while(T--){
		solve();
	}
	r0;
}


// CODE by Kazhybay Askar
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <bits/stdc++.h>

using namespace std;
using namespace __gnu_pbds;

#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define iter   set<int>::iterator
#define f      first
#define s      second
#define pb     push_back
#define pf     push_front
#define mp     make_pair
#define cont   continue
#define ll     long long
#define Speed  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define sz     size()
#define all(x) x.begin(),x.end()
#define cont   continue
#define r0     return 0
#define endl   '\n'

const int MAXN = 1e5  + 7;
const int MOD  = 1e9  + 7;
const int INF  = 1e9  + 7;
const ll  MINF = 1e18 + 7;
const int EPS  = 1e-6;
const int dx[] = {0, 0, 1, -1, -1, -1, 1, 1};
const int dy[] = {1, -1, 0, 0, -1, 1, -1, 1};
const double pi = acos(-1.0);

typedef long double   ld;
typedef pair<ll,ll>   pll;
typedef pair<int,int> pii;
typedef pair<char,char> pcc;

ll a[MAXN],b[MAXN];
vector<int>g[MAXN],v;
bool used[MAXN];
ll n,m,k,cnt=0,sum=0,ans=0,mx=0,mn=INF;
bool y=0;

void freopen(){
	freopen("A.in","r",stdin);
	freopen("A.out","w",stdout);
}

void solve(){
	string s,  t;
	cin>>s>>t;
	string s1=s,t1=t;
	y=0;
	int j;
	for(int i=0;i<s.sz;i++){
        j=i+1;
        while(s[i]==t[j]){
            s[j]=s[i];
            j++;
        }
        j=i-1;
        while(s[i]==t[j]){
            s[j]=s[i];
            j--;
        }

        j=i+1;
        while(t[i]==s[j]){
            t[j]=t[i];
            j++;
        }
        j=i-1;
        while(s[j]==t[i]){
            t[j]=t[i];
            j--;
        }
	}
	if(s==t){
        cout<<"YES"<<endl;
	}
	else cout<<"NO"<<endl;
}

int main(){
	Speed;
	ll T=1;
	cin>>T;
	while(T--){
		solve();
	}
	r0;
}


// CODE by Kazhybay Askar
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <bits/stdc++.h>

using namespace std;
using namespace __gnu_pbds;

#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define iter   set<int>::iterator
#define f      first
#define s      second
#define pb     push_back
#define pf     push_front
#define mp     make_pair
#define cont   continue
#define ll     long long
#define Speed  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define sz     size()
#define all(x) x.begin(),x.end()
#define cont   continue
#define r0     return 0
#define endl   '\n'

const int MAXN = 1e5  + 7;
const int MOD  = 1e9  + 7;
const int INF  = 1e9  + 7;
const ll  MINF = 1e18 + 7;
const int EPS  = 1e-6;
const int dx[] = {0, 0, 1, -1, -1, -1, 1, 1};
const int dy[] = {1, -1, 0, 0, -1, 1, -1, 1};
const double pi = acos(-1.0);

typedef long double   ld;
typedef pair<ll,ll>   pll;
typedef pair<int,int> pii;
typedef pair<char,char> pcc;

ll a[MAXN],b[MAXN];
vector<int>g[MAXN],v;
bool used[MAXN];
ll n,m,k,cnt=0,sum=0,ans=0,mx=0,mn=INF;
bool y=0;

void freopen(){
	freopen("A.in","r",stdin);
	freopen("A.out","w",stdout);
}

void solve(){
	string s,  t;
	cin>>s>>t;
	string s1=s,t1=t;
	y=0;
	for(int i=0;i<s.sz;i++){
        if(s[i]==t[i]){
            cont;
        }
        if(t[i-1]==s[i] || t[i+1]==s[i] || t1[i-1]==s[i]){
            t1[i]=s[i];
            cont;
        }
        if(s[i-1]==t[i] || s[i+1]==t[i] || s1[i-1]==t[i]){
            s1[i]=t[i];
            cont;
        }
        y=1;
        cout<<"NO"<<endl;
        break;
	}
	if(y==0){
        cout<<"YES"<<endl;
	}
}

int main(){
	Speed;
	ll T=1;
	cin>>T;
	while(T--){
		solve();
	}
	r0;
}


#include <bits/stdc++.h>
using namespace std;

int main() {
	int n;cin>>n;
	while(n--) {
		string s,t;
		cin>>s>>t;
		int len = s.length();
		sort(s.begin(),s.end());
		sort(t.end(),t.end());
		bool flag = false;		//ÊÇ·ñ´æÔÚÏà¶ÔÎ»ÖÃÏàµÈµÄ
		for(int i = 0;i < n;i++) {		//Ö»ÒªsÖÐµÄÔªËØÔÚtÖÐ³öÏÖ¹ý¾ÍÒ»¶¨¿ÉÒÔ×ª»»
			for(int j = 0;j < n;j++) {
				if(s[i] == t[j]) {
					flag = true;
					break;
				}
			}
		}
		if(flag) cout<<"YES\n";
		else cout<<"NO\n";
	}
	return 0;
}

// abbb
// xxxb
//


#include <bits/stdc++.h>
using namespace std;

int main() {
	int n;cin>>n;
	while(n--) {
		string s,t;
		cin>>s>>t;
		int len = s.length();
		sort(s.begin(),s.end());
		sort(t.end(),t.end());
		bool flag = false;		//ÊÇ·ñ´æÔÚÏà¶ÔÎ»ÖÃÏàµÈµÄ
		for(int i = 0;i < len;i++) {
			if(s[i]==t[i]) flag = true;
		}
		if(flag) cout<<"YES\n";
		else cout<<"NO\n";
	}
	return 0;
}

// abbb
// xxxb
//


#include <bits/stdc++.h>
using namespace std;

int main() {
	int n;cin>>n;
	while(n--) {
		string s,t;
		cin>>s>>t;
		int len = s.length();
		sort(s.begin(),s.end());
		sort(t.end(),t.end());
		bool flag = false;		//ÊÇ·ñ´æÔÚÏà¶ÔÎ»ÖÃÏàµÈµÄ
		for(int i = 0;i < n;i++) {		//Ö»ÒªsÖÐµÄÔªËØÔÚtÖÐ³öÏÖ¹ý¾ÍÒ»¶¨¿ÉÒÔ×ª»»
			for(int j = 0;j < n;j++) {
				if(s[i] == s[j]) {
					flag = true;
					break;
				}
			}
		}
		if(flag) cout<<"YES\n";
		else cout<<"NO\n";
	}
	return 0;
}

// abbb
// xxxb
//


#include <bits/stdc++.h>
using namespace std;

int main() {
	int n;cin>>n;
	while(n--) {
		string s,t;
		cin>>s>>t;
		int len = s.length();
		sort(s.begin(),s.end());
		sort(t.end(),t.end());
		bool flag = false;		//ÊÇ·ñ´æÔÚÏà¶ÔÎ»ÖÃÏàµÈµÄ
		for(int i = 0;i < n;i++) {		//Ö»ÒªsÖÐµÄÔªËØÔÚtÖÐ³öÏÖ¹ý¾ÍÒ»¶¨¿ÉÒÔ×ª»»
			for(int j = 0;j < n;j++) {
				if(s[i] == t[j]) {
					flag = true;
					goto loop;
				}
			}
		}
		loop:if(flag) cout<<"YES\n";
		else cout<<"NO\n";
	}
	return 0;
}

// abbb
// xxxb
//


#include <bits/stdc++.h>
using namespace std;

int main() {
	int n;cin>>n;
	while(n--) {
		string s,t;
		cin>>s>>t;
		int len = s.length();
		sort(s.begin(),s.end());
		sort(t.end(),t.end());
		bool flag = false;		//ÊÇ·ñ´æÔÚÏà¶ÔÎ»ÖÃÏàµÈµÄ
		for(int i = 0;i < len;i++) {		//Ö»ÒªsÖÐµÄÔªËØÔÚtÖÐ³öÏÖ¹ý¾ÍÒ»¶¨¿ÉÒÔ×ª»»
			for(int j = 0;j < len;j++) {
				if(s[i] == t[j]) {
					flag = true;
					goto loop;
				}
			}
		}
		loop:if(flag) cout<<"YES\n";
		else cout<<"NO\n";
	}
	return 0;
}

// abbb
// xxxb
//


#include <iostream>
#include<string>
using namespace std;
int main()  {
    int n;
    cin>>n;
    string s2, s3;
    int res=0;
    for (int i = 0; i < n; ++i) {
        res = 0;
        cin >> s2 >> s3;

        for (int i = 0; i < s2.size(); ++i) {
            for (int j = 0; j < s2.size(); ++j) {
                if (s2[i] == s3[j]) {
                    res = 1;
                    cout << "yes" << endl;
                    break;
                }
            }
            if (res == 1) break;
        }

        if (res == 0) cout << "no" << endl;
    }

    return 0;
}


#include <iostream>
#include<string>
using namespace std;

int main() {
int n=0,k=0,sum=0;
string s1, s2;
cin>>k;
for(int i =0; i<k; i++){
    cin>>s1>>s2;
    for(int i = 0; i< s1.size(); i++){
        for(int j = 0; j< s1.size(); j++){
            if(s1[j]==s2[i]){
                sum++;
            }

        }

    }
    if(sum==0) {
        cout << "no"<<endl;

        break;
    }
    sum=0;
    cout<<"yes"<<endl;

}

    return 0;
}


#include <iostream>
#include<string>
using namespace std;

int main() {
int n=0,k=0,sum=0;
string s1, s2;
cin>>k;
for(int i =0; i<k; i++){
    cin>>s1>>s2;
    for(int i = 0; i< s1.size(); i++){
        for(int j = 0; j< s1.size(); j++){
            if(s1[j]==s2[i]){
                sum++;
            }

        }

    }
    if(sum==0) {
        cout << "no";

        break;
    }
    sum=0;
    cout<<"yes";

}

    return 0;
}


#include<iostream>
#include<string.h>
using namespace std;
int main(){
	int q;
	cin>>q;
	while(q>0){
		string a, b;
		int i, j, k=0;
		cin>>a>>b;
		for(i=0; i<a.length(); i++){
			for(j=0; j<b.length(); j++){
				if(a[i]==b[j]){
					k=1;
					break;
				}
			}
			if(k==1)
			break;
		}
		if(k==0)
		cout<<"NO"<<endl;
		else
		cout<<"YES"<<endl;
		q--;
	}
}


#include<iostream>
#include<string.h>
using namespace std;
int main(){
	int q;
	cin>>q;
	while(q>0){
		string a, b;
		int i, j, k=0;
		cin>>a>>b;
		for(i=0; i<a.length(); i++){
			for(j=0; j<b.length(); j++){
				if(a[i]==b[j]){
					k=1;
					break;
				}
			}
			if(k==1)
			break;
		}
		if(k==0)
		cout<<"NO"<<endl;
		else
		cout<<"YES"<<endl;
	}
	q--;
}


#include<iostream>
#include<string.h>
using namespace std;
int main(){
	int i, j, t;
	char a[100], b[100];
	cin>>t;
	for(int x=0; x<t; x++)
	{
		cin>>a>>b;
		int p= strlen(a);
		int k=0;
		for(i=0; i<p; i++)
		{
			for(j=0; j<p; j++)
			{
				if(a[i]==b[j])
				{
					k=1;
					break;
				}
			}
			if(k==1)
			break;
		}
		if(k==1)
		cout<<"YES"<<endl;
		else
		cout<<"NO"<<endl;
	}
}


#include <iostream>
#include <string>
using namespace std;
int main()
{
    int q;
    cin >> q;
    while (q--)
    {
        string s, t;
        cin >> s >> t;
        bool ans1[26] = {0};
        bool ans2[26] = {0};

        for (int i = 0; i < s.length(); i++)
            ans1[s[i] - 'a'] = true;
        for (int i = 0; i < t.length(); i++)
            ans2[t[i] - 'a'] = true;
        // if any of the above matches then it is okay..
        bool ans = false;
        for (int i = 0; i < 26; i++)
            if (ans1[i] && ans2[i])
                ans = true;
        (ans) ? cout << "YES" << endl : cout << "NO" << endl;
    }

    return 0;
}


#include <iostream>
#include <string>
using namespace std;
int main()
{
    int q;
    cin >> q;
    while (q--)
    {
        string s, t;
        cin >> s >> t;
        bool ans1[26] = {0};
        bool ans2[26] = {0};
        for (int i = 0; i < s.length(); i++)
            ans1[s[i] - 'a'] = true;
        for (int i = 0; i < t.length(); i++)
            ans2[t[i] - 'a'] = true;
        // if any of the above matches then it is okay..
        bool ans = false;
        for (int i = 0; i < s.length(); i++)
            if (ans1[i] && ans2[i])
                ans = true;
        (ans) ? cout << "YES" << endl : cout << "NO" << endl;
    }

    return 0;
}


#include <iostream>
#include <string>
using namespace std;
int main()
{
    int q;
    cin >> q;
    while (q--)
    {
        string s, t;
        cin >> s >> t;
        bool ans1[26] = {0};
        bool ans2[26] = {0};
        for (int i = 0; i < s.length(); i++)
            ans1[s[i] - 'a'] = true;
        for (int i = 0; i < t.length(); i++)
            ans2[t[i] - 'a'] = true;
        // if any of the above matches then it is okay..
        bool ans = false;
        for (int i = 0; i < s.length(); i++)
            if (ans1[i] == ans2[i])
                ans = true;
        (ans) ? cout << "YES" << endl : cout << "NO" << endl;
    }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main(){

    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int test;
    cin>>test;

    while(test--){
       string a,b;
       cin>>a>>b;

       int c=0;
       set<char> s;
       for(int i=0; i<a.size(); i++) s.insert(a[i]);
       c = s.size();
       for(int i=0; i<b.size(); i++) s.insert(b[i]);

        if( s.size()-c == b.size() ) cout<<"NO\n";
        else cout<<"YES\n";
    }

}


#include<bits/stdc++.h>
using namespace std;

int main()
{

    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int test;
    cin>>test;

    while(test--){
        string a,b;
        int i,ch[30]= {0};
        cin>>a>>b;

        for(i=0; i<a.size(); i++) ch[a[i]-'a']=1;
        for(i=0; i<b.size(); i++) if(ch[b[i]-'a']) break;

        if( i == b.size() ) cout<<"NO\n";
        else cout<<"YES\n";
    }

}


#include<bits/stdc++.h>
using namespace std;

int main()
{

    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int test;
    cin>>test;

    while(test--){
        string a,b;
        int i,ch[30]= {0};
        cin>>a>>b;

        for(i=0; i<a.size(); i++) ch[a[i]-97]=1;
        for(i=0; i<b.size(); i++) if(ch[b[i]-97]) break;

        if( i == b.size() ) cout<<"NO\n";
        else cout<<"YES\n";
    }

}


#include<bits/stdc++.h>
using namespace std;

int main(){

    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int test;
    cin>>test;

    while(test--){
       string a,b;
       cin>>a>>b;

       int c=0;
       for(int i=0; i<a.size(); i++)
            if(a[i]==b[i])
                c=1;

        if(c) cout<<"YES\n";
        else cout<<"NO\n";
    }

}


#include <bits/stdc++.h>
using namespace std;

const int E=1e5+5, M=1e9+5;
#define pb push_back
#define mp make_pair
#define ll long long
#define fl cout<<flush
#define intpair pair<int,int>
#define intvec vector<int>
#define prq priority_queue<int>

bool asccmp (intpair x, intpair y)
{
	 return x.second<y.second;
}

ll a, b, c, h[400], o;
string s, t;

int main ()
{
	scanf("%lld", &b);
	for (int w=1; w<=b; w++)
	{
		cin>>s>>t;
		o=0;
		for (int q=0; q<s.length(); q++)
		{
			h[s[q]]=w;
		}
		for (int q=0; q<t.length(); q++)
		{
			if (h[t[q]]==w)
			{
				o=1;
				break;
			}
		}
		if (o)
		{
			printf("YES\n");
		}
		else
		{
			printf("NO\n");
		}
	}
}


#include <bits/stdc++.h>
using namespace std;

const int E=1e5+5, M=1e9+5;
#define pb push_back
#define mp make_pair
#define ll long long
#define fl cout<<flush
#define intpair pair<int,int>
#define intvec vector<int>
#define prq priority_queue<int>

bool asccmp (intpair x, intpair y)
{
	 return x.second<y.second;
}

ll a, b, c, h[400], o;
string s, t;

int main ()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	scanf("%lld", &b);
	for (int w=1; w<=b; w++)
	{
		cin>>s>>t;
		o=0;
		for (int q=0; q<s.length(); q++)
		{
			h[s[q]]=w;
		}
		for (int q=0; q<t.length(); q++)
		{
			if (h[t[q]]==w)
			{
				o=1;
				break;
			}
		}
		if (o)
		{
			printf("YES\n");
		}
		else
		{
			printf("NO\n");
		}
	}
}


#include <bits/stdc++.h>
using namespace std;

const int E=1e5+5, M=1e9+5;
#define pb push_back
#define mp make_pair
#define ll long long
#define fl cout<<flush
#define intpair pair<int,int>
#define intvec vector<int>
#define prq priority_queue<int>

bool asccmp (intpair x, intpair y)
{
	 return x.second<y.second;
}

ll a, b, c, h[400], o;
string s, t;

int main ()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	scanf("%lld", &b);
	for (int w=1; w<=b; w++)
	{
		cin>>s>>t;
		o=0;
		for (int q=0; q<s.length(); q++)
		{
			h[s[q]]=w;
		}
		for (int q=0; q<t.length(); q++)
		{
			if (h[t[q]]!=w)
			{
				o=1;
				break;
			}
		}
		if (o)
		{
			printf("NO\n");
		}
		else
		{
			printf("YES\n");
		}
	}
}


#include<bits/stdc++.h>
using namespace std;
signed main()
 {
 	int t;
 	cin >> t;
 	while (t--)
 	 {
 	 	string s,s1;
 	 	cin >> s;
 	 	cin >> s1;
 	 	bool f = false;
 	 	bool chk = true;
        for(int i = 0; i < s.size(); ++i) {
        	for (int j = 0; j < s.size(); ++j) {
        		if (s[i]==s1[j]) f = true;
			}
		  if (!f) chk = false;
 		}
		   if(chk) cout << "YES" << endl; else cout << "NO" << endl;
	  }
 }


#include<bits/stdc++.h>
using namespace std;
signed main()
 {
 	int t;
 	cin >> t;
 	while (t--)
 	 {
 	 	string s,s1;
 	 	cin >> s;
 	 	cin >> s1;
 	 	bool chk = true;
        for(int i = 0; i < s.size(); ++i) {
        	bool f = false;
        	for (int j = 0; j < s.size(); ++j) {
        		if (s[i]==s1[j]) f = true;
			}
		  if (!f) chk = false;
 		}
 		for(int i = 0; i < s.size(); ++i) {
        	bool f = false;
        	for (int j = 0; j < s.size(); ++j) {
        		if (s1[i]==s[j]) f = true;
			}
		  if (!f) chk = false;
 		}
		   if(chk) cout << "YES" << endl; else cout << "NO" << endl;
	  }
 }


#include<bits/stdc++.h>
using namespace std;
signed main()
 {
 	int t;
 	cin >> t;
 	while (t--)
 	 {
 	 	string s,s1;
 	 	cin >> s;
 	 	cin >> s1;
 	 	bool f = false;
        for(int i = 0; i < s.size(); ++i) {
        	for (int j = 0; j < s.size(); ++j) {
        		if (s[i]==s1[j] && !f) f = true;
			}
 		}
		   if(f) cout << "YES" << endl; else cout << "NO" << endl;
	  }
 }


#include <iostream>
#include <bits/stdc++.h>
using namespace std;

int main()
{
long long q;
cin>> q;
while(q--){
string s,t;
cin>> s>> t;
if(s==t){cout<< "YES\n";continue;}
if(s.size()==1){cout<<"NO\n";continue;}
 int *a=new int [27];
 int *b=new int[27];

 for (int i = 0; i < 26; i++)
 {
   a[i]=0;
   b[i]=0;
 }

for (int i = 0; i < s.size(); i++)
{
a[s[i]-'a']++;
b[t[i]-'a']++;
}

bool f=true;
for (int i = 0; i < 26; i++)
{
  if(a[i]!=0&&b[i!=0&&a[i]>=1&&b[i]]>=1){
    cout<< "YES\n";
    f=false;
    break;
  }
}
if(f){cout<< "NO\n";}
}
  return 0;
}


#include <iostream>
#include <bits/stdc++.h>
using namespace std;

int main()
{
long long q;
cin>> q;
while(q--){
string s,t;
cin>> s>> t;
if(s==t){cout<< "YES\n";continue;}
if(s.size()==1){cout<<"NO\n";continue;}
 int *a=new int [27];
 int *b=new int[27];

 for (int i = 0; i < 26; i++)
 {
   a[i]=0;
   b[i]=0;
 }

for (int i = 0; i < s.size(); i++)
{
a[s[i]-'a']++;
b[t[i]-'a']++;
}

bool f=true;
for (int i = 0; i < 26; i++)
{
  if(a[i]!=0 && b[i]!=0 &&a[i]>=1 && b[i]>=1){
    cout<< "YES\n";
    f=false;
    break;
  }
}
if(f){cout<< "NO\n";}
}
  return 0;
}


#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main()
{
long long q;
cin>> q;
while(q--){
string s,t;
cin>> s>> t;
if(s==t){cout<< "YES\n";continue;}
if(s.size()==1){cout<<"NO\n";continue;}
int *a=new int [26];
int *b=new int[26];
for (int i = 0; i < s.size(); i++)
{
a[s[i]-'a']++;
b[t[i]-'a']++;
}
bool f=true;
for (int i = 0; i < 26; i++)
{
  if(a[i]!=0&&b[i!=0&&a[i]==b[i]]){
    cout<< "YES\n";
    f=false;
    break;
  }
}
if(f){cout<< "NO\n";}
}
  return 0;
}


#include <iostream>
#include <string.h>
using namespace std ;

int main ()
{
	char s[1000];
	char t[1000];
	int n,test ;
	cin >> n;
	for (int h=0;h<n;h++)
	{	test=0;
		cin >> s;
		cin >> t;
		for (int i=0;i<strlen(s);i++)
		{
			for (int j=0;j<strlen(t);j++)
			{
				if (s[i]==t[j])
				{
					test=1;
					cout << "YES"<< endl ;
					break;
				}
			}
			break;
		}
		if (test!=1)
			cout <<"NO" << endl ;
 	}
 	return 0;
}


#include <iostream>
#include <string.h>
using namespace std ;

int main ()
{
	char s[1000];
	char t[1000];
	int n,test ;
	cin >> t;
	for (int h=0;h<n;h++)
	{	test=0;
		cin >> s;
		cin >> t;
		for (int i=0;i<strlen(s);i++)
		{
			for (int j=0;j<strlen(t);j++)
			{
				if (s[i]==t[j])
				{
					test=1;
					cout << "YES"<< endl ;
					break;
				}
			}
			break;
		}
		if (test!=1)
			cout <<"NO" << endl ;
 	}
 	return 0;
}


#include <iostream>
#include <string.h>
using namespace std ;

int main ()
{
	char s[1000];
	char t[1000];
	int n,test ;
	cin >> n;
	for (int h=0;h<n;h++)
	{	test=0;
		cin >> s;
		cin >> t;
		for (int i=0;i<strlen(s);i++)
		{
			for (int j=0;j<strlen(t);j++)
			{
				if (s[i]==t[j])
				{
					test=1;
					cout << "YES"<< endl ;
					break;
				}
			}
			if (test==1)
				break;
		}
		if (test!=1)
			cout <<"NO" << endl ;
 	}
 	return 0;
}


#include <bits/stdc++.h>

using namespace std;
int n,i,j,ss,t;
string a,s;
int main()
{
   cin>>t;
   while(t--){
    cin>>s>>a;
    map<char,int>m;
    for(i=0;i<a.size();i++){
        if(a[i]==s[i])m[s[i]]=1;
        else if(!m[a[i]]){
            for(j=i+1;j<a.size();j++)
                if(a[i]==s[j])break;
            if(j==a.size()){ss=1;break;}
            m[s[i]]=1;
        }
    }
        if(ss==1)cout<<"NO"<<endl;
        else cout<<"YES"<<endl;
ss=0;

   }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
int n,i,j,ss,t;
string a,s;
int main()
{
   cin>>t;
   while(t--){
    cin>>s>>a;
    map<char,int>m;
    for(i=0;i<a.size();i++){
            for(j=0;j<a.size();j++)
             if(a[i]==s[j])ss=1;
        }

        if(ss==0)cout<<"NO"<<endl;
        else cout<<"YES"<<endl;
ss=0;
   }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
int n,i,j,ss,t;
string a,s;
int main()
{
   cin>>t;
   while(t--){
    cin>>s>>a;
    map<char,int>m;
    for(i=0;i<a.size();i++){
            for(j=i+1;j<a.size();j++)
             if(a[i]==s[j])ss=1;
        }

        if(ss==0)cout<<"NO"<<endl;
        else cout<<"YES"<<endl;
ss=0;
   }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    map<char,int>mp;
    string x,y;
    int n,flag,i,j;
    cin>>n;
    while(n--)
    {
        flag=0;
        cin>>x>>y;
        for(i=0;i<x.size();i++)
            mp[x[i]]++;
        for(j=0;j<y.size();j++)
        {
            if(mp[y[j]]!=0)
            {

               flag++;
                break;
            }
        }if(flag)
        cout<<"YES"<<endl;
        else cout<<"NO"<<endl;

    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    map<char,int>mp;
    string x,y;
    int n,flag,i,j;
    cin>>n;
    while(n--)
    {
        flag=1;
        cin>>x>>y;
        for(i=0;i<x.size();i++)
            mp[x[i]]++;
        for(j=0;j<y.size();j++)
        {
            if(mp[y[j]]==0)
            {
                puts("NO");
               flag=0;
                break;
            }
        }if(flag)
        cout<<"YES"<<endl;

    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    map<char,int>mp;
    string x,y;
    int n,flag,i,j;
    cin>>n;
    while(n--)
    {
        flag=0;
        cin>>x>>y;
        for(i=0;i<x.size();i++)
            mp[x[i]]++;
        for(j=0;j<y.size();j++)
        {
            if(mp[y[j]]!=0)
            {

               flag++;
                break;
            }
        }if(flag)
        cout<<"YES"<<endl;
        else if(flag==0) cout<<"NO"<<endl;

    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
   // map<char,int>mp;
    string x,y;
    int n,flag,i,j;
    cin>>n;
    while(n--)
    {
        int cnt=0;
        cin>>x>>y;
        for(i=0;i<x.size();i++)
        {
            for(j=0;j<y.size();j++)

             if(x[i]==y[j])
                cnt++;

        }
        if(cnt>0)
        cout<<"YES"<<endl;
        else if(cnt==0) cout<<"NO"<<endl;

    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

struct strings {
    string fs;
    string ss;
};

int main()
{
   int n;
   cin>>n;
   strings a[n];
   for (int i = 0; i < n; i++) {
       cin>>a[i].fs>>a[i].ss;
   }
   bool flag;
   for (int i = 0; i < n; i++) {
        flag = true;
        for (int o = 0; o < a[i].fs.size(); o++) {
            if (a[i].ss.find(a[i].fs[o]) == -1 || a[i].fs.find(a[i].ss[o]) == -1) {
                flag = false;
                break;
            }
        }
        if (flag) {
            cout<<"YES"<<endl;
        }
        else {
            cout<<"NO"<<endl;
        }
   }
}


#include <bits/stdc++.h>

using namespace std;

struct strings {
    string fs;
    string ss;
};

int main()
{
   int n;
   cin>>n;
   strings a[n];
   for (int i = 0; i < n; i++) {
       cin>>a[i].fs>>a[i].ss;
   }
   bool flag;
   for (int i = 0; i < n; i++) {
        flag = false;
        for (int o = 0; o < a[i].fs.size(); o++) {
            if (a[i].ss.find(a[i].fs[o]) != -1 || a[i].fs.find(a[i].ss[o]) != -1) {
                flag = true;
                break;
            }
        }
        if (flag) {
            cout<<"YES"<<endl;
        }
        else {
            cout<<"NO"<<endl;
        }
   }
}


#include <bits/stdc++.h>

using namespace std;

struct strings {
    string fs;
    string ss;
};

int main()
{
   int n;
   cin>>n;
   strings a[n];
   for (int i = 0; i < n; i++) {
       cin>>a[i].fs>>a[i].ss;
   }
   bool flag;
   for (int i = 0; i < n; i++) {
        flag = true;
        for (int o = 0; o < a[i].fs.size(); o++) {
            if (a[i].ss.find(a[i].fs[o]) == -1) {
                flag = false;
                break;
            }
        }
        if (flag) {
            cout<<"YES"<<endl;
        }
        else {
            cout<<"NO"<<endl;
        }
   }
}


#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
#define int long long
#define rep(i, n) for (int i = 0; i < (int)n; ++i)
#define mod 1000000007
#define MM(a, x) memset(a, x, sizeof(a))
#define all(x) (x).begin(), (x).end()
#define MX 100005

int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);

  int t;
  cin >> t;
  while (t--) {
    string s, t;
    cin >> s >> t;
    int n = s.size();
    string ans = "NO";
    int used[100] = {0};
    for (int i = 0; s[i]; i++) used[s[i] - 'a'] = 1;
    for (int i = 0; t[i]; i++) {
      if (used[t[i] - 'a']) ans = "YES";
      break;
    }
    cout << ans << '\n';
  }

  return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
#define int long long
#define rep(i, n) for (int i = 0; i < (int)n; ++i)
#define mod 1000000007
#define MM(a, x) memset(a, x, sizeof(a))
#define all(x) (x).begin(), (x).end()
#define MX 100005

int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);

  int t;
  cin >> t;
  while (t--) {
    string s, t;
    cin >> s >> t;
    string ans = "YES";
    int n = s.size();
    if (s[0] != t[0]) {
      if (s[1] == t[0] or s[0] == t[1])
        ans = "YES";
      else
        ans = "NO";
    }
    if (s[n - 1] != t[n - 1]) {
      if (s[n - 1] == t[n - 1] or s[n - 1] == t[n - 1])
        ans = "YES";
      else
        ans = "NO";
    }
    for (int i = 1; i < s.size() - 1; i++) {
      if (s[i] != t[i]) {
        if (s[i] == t[i - 1] or s[i] == t[i + 1] or t[i] == s[i - 1] or
            t[i] == s[i + 1])
          continue;
        else {
          ans = "NO";
          break;
        }
      }
    }
    cout << ans << endl;
  }

  return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
#define int long long
#define rep(i, n) for (int i = 0; i < (int)n; ++i)
#define mod 1000000007
#define MM(a, x) memset(a, x, sizeof(a))
#define all(x) (x).begin(), (x).end()
#define MX 100005

int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);

  int t;
  cin >> t;
  while (t--) {
    string s, t;
    cin >> s >> t;
    int n = s.size();
    string ans = "NO";
    int used[100] = {0};
    for (int i = 0; s[i]; i++) used[s[i] - 'a'] = 1;
    for (int i = 0; t[i]; i++) {
      if (used[t[i] - 'a']) {
        ans = "YES";
        break;
      }
    }
    cout << ans << '\n';
  }

  return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
#define int long long
#define rep(i, n) for (int i = 0; i < (int)n; ++i)
#define mod 1000000007
#define MM(a, x) memset(a, x, sizeof(a))
#define all(x) (x).begin(), (x).end()
#define MX 100005

int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);

  int t;
  cin >> t;
  while (t--) {
    string s, t;
    cin >> s >> t;
    int n = s.size();
    string ans = "YES";
    int a[n] = {}, b[n] = {};
    for (int i = 0; s[i]; i++) a[s[i] - 'a']++;
    for (int i = 0; t[i]; i++) a[t[i] - 'a']++;
    for (int i = 0; i < 26; i++) {
      if (a[i] > 0 and b[i] > 0)
        continue;
      else
        ans = "NO";
    }
    cout << ans << endl;
  }

  return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
#define int long long
#define rep(i, n) for (int i = 0; i < (int)n; ++i)
#define mod 1000000007
#define MM(a, x) memset(a, x, sizeof(a))
#define all(x) (x).begin(), (x).end()
#define MX 100005

int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);

  int t;
  cin >> t;
  while (t--) {
    string s, t;
    cin >> s >> t;
    int n = s.size();
    set<char> ss, tt;
    rep(i, n) {
      ss.insert(s[i]);
      tt.insert(t[i]);
    }
    if (ss == tt)
      cout << "YES";
    else
      cout << "NO";
    cout << '\n';
  }

  return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
#define int long long
#define rep(i, n) for (int i = 0; i < (int)n; ++i)
#define mod 1000000007
#define MM(a, x) memset(a, x, sizeof(a))
#define all(x) (x).begin(), (x).end()
#define MX 100005

int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);

  int t;
  cin >> t;
  while (t--) {
    string s, t;
    cin >> s >> t;
    string ans = "YES";
    for (int i = 0; i < s.size(); i++) {
      if (s[i] != t[i]) {
        if (s[i] == t[i - 1] or s[i] == t[i + 1] or t[i] == s[i - 1] or
            t[i] == s[i + 1])
          continue;
        else {
          ans = "NO";
          break;
        }
      }
    }
    cout << ans << endl;
  }

  return 0;
}


#include<bits/stdc++.h>
using namespace std;
main(){
int i,j,k,l,m,n;
cin>>n;
while(n--){
    char s1[10000],s2[10000];
    int x[150]={0};
    cin>>s1>>s2;
    l=strlen(s1);
    for(i=0;i<l;i++) x[s2[i]]++;
    j=0;
    for(i=0;i<l;i++) if(x[s1[i]]>0)j++;
    if(j>0) cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
} return 0;
}


#include<bits/stdc++.h>
using namespace std;
main(){
int i,j,k,l,m,n;
cin>>n;
while(n--){
    char s1[10000],s2[10000];
    int x[150]={0};
    cin>>s1>>s2;
    l=strlen(s1);
    for(i=0;i<l;i++) x[s1[i]]++;
    j=0;
    for(i=0;i<l;i++) if(x[s2[i]]==0)j++;
    if(j==0) cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
} return 0;
}


#include<bits/stdc++.h>
using namespace std;
main(){
int i,j,k,l,m,n;
cin>>n;
while(n--){
    char s1[10000],s2[10000];
    int x[150]={0};
    cin>>s1>>s2;
    l=strlen(s1);
    for(i=0;i<l;i++) x[s2[i]]++;
    j=0;
    for(i=0;i<l;i++) if(x[s1[i]]==0)j++;
    if(j==0) cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
} return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main() {
    int n;
    cin >> n;
    while (n--) {
        string s, t;
        cin >> s >> t;
        bool ans = false;
        map<char, int> ms;
        for (int i = 0; i < s.length(); i++) {
            if (ms.find(s[i]) != ms.end()) {
                ms[s[i]]++;
            }
            else {
                ms.insert(make_pair(s[i], 1));
            }
        }
        for (int i = 0; i < .length(); i++) {
            if (ms.find(t[i]) != mt.end()) {
                ans = true;
                break;
            }
        }
        if (ans) {
            cout << "YES" << endl;
        }
        else {
            cout << "NO" << endl;
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main() {
    int n;
    cin >> n;
    string s, t;
    bool ans;
    while (n--) {
        ans = false;
        cin >> s >> t;
        int as[26] = {0}, at[26] = {0};
        for (int i = 0; i < s.length(); i++) {
            as[s[i] - 97]++;
        }
        for (int i = 0; i < t.length(); i++) {
            at[t[i] - 97]++;
        }
        for (int i = 0; i < s.length(); i++) {
            if (as[i] && at[i]) {
                cout << "YES" << endl;
                ans = true;
                break;
            }
        }
        if (!ans) cout << "NO" << endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main() {
    int n;
    cin >> n;
    while (n--) {
        string s, t, ans;
        cin >> s >> t;
        int as[26] = {0}, at[26] = {0};
        for (int i = 0; i < s.length(); i++) {
            as[s[i] - 97]++;
            at[t[i] - 97]++;
        }
        for (int i = 0; i < s.length(); i++) {
            if (as[i] >= 1 && at[i] >= 1) {
                ans = "YES";
                break;
            }
        }
        if (ans == "YES") {
            cout << ans << endl;
        }
        else {
            cout << "NO";
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main() {
    int n;
    cin >> n;
    string s, t;
    int as[26] = {0}, at[26] = {0};
    while (n--) {
        cin >> s >> t;
        for (int i = 0; i < s.length(); i++) {
            as[s[i] - 97]++;
        }
        for (int i = 0; i < t.length(); i++) {
            at[t[i] - 97]++;
        }
        for (int i = 0; i < s.length(); i++) {
            if (as[i] && at[i]) {
                cout << "YES" << endl;
                break;
            }
        }
        cout << "NO" << endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main() {
    int n;
    cin >> n;
    string s, t;
    while (n--) {
        cin >> s >> t;
        int as[26] = {0}, at[26] = {0};
        for (int i = 0; i < s.length(); i++) {
            as[s[i] - 97]++;
        }
        for (int i = 0; i < t.length(); i++) {
            at[t[i] - 97]++;
        }
        for (int i = 0; i < s.length(); i++) {
            if (as[i] && at[i]) {
                cout << "YES" << endl;
                break;
            }
        }
        cout << "NO" << endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main() {
    int n;
    cin >> n;
    while (n--) {
        string s, t, ans;
        cin >> s >> t;
        int as[26] = {0}, at[26] = {0};
        for (int i = 0; i < s.length(); i++) {
            as[s[i] - 97]++;
            at[t[i] - 97]++;
        }
        for (int i = 0; i < s.length(); i++) {
            if (as[i] >= 1 && at[i] >= 1) {
                ans = "YES"
                break;
            }
        }
        if (ans == "YES") {
            cout << ans << endl;
        }
        else {
            cout << "NO";
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main() {
    int n;
    cin >> n;
    while (n--) {
        string s, t;
        cin >> s >> t;
        bool ans = false;
        map<char, int> ms;
        for (int i = 0; i < s.length(); i++) {
            if (ms.find(s[i]) != ms.end()) {
                ms[s[i]]++;
            }
            else {
                ms.insert(make_pair(s[i], 1));
            }
        }
        for (int i = 0; i < s.length(); i++) {
            if (ms.find(t[i]) != ms.end()) {
                ans = true;
                break;
            }
        }
        if (ans) {
            cout << "YES" << endl;
        }
        else {
            cout << "NO" << endl;
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main() {
    int n;
    cin >> n;
    while (n--) {
        string s, t, ans;
        cin >> s >> t;
        int as[26] = {0}, at[26] = {0};
        for (int i = 0; i < s.length(); i++) {
            as[s[i] - 97]++;
            at[t[i] - 97]++;
        }
        for (int i = 0; i < s.length(); i++) {
            if (as[i] >= 1 && at[i] >= 1) {
                ans = "YES";
                break;
            }
        }
        if (ans == "YES") {
            cout << ans << endl;
        }
        else {
            cout << "NO" << endl;
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main() {
    int n;
    cin >> n;
    string s, t;
    while (n--) {
        cin >> s >> t;
        int as[26] = {0}, at[26] = {0};
        for (int i = 0; i < s.length(); i++) {
            as[s[i] - 97]++;
            at[t[i] - 97]++;
        }
        for (int i = 0; i < s.length(); i++) {
            if (as[i] >= 1 && at[i] >= 1) {
                cout << "YES" << endl;
                break;
            }
        }
        cout << "NO" << endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main() {
    int n;
    cin >> n;
    while (n--) {
        string s, t;
        bool ans = false;
        if (s == t) ans = true;
        cin >> s >> t;
        int as[26] = {0}, at[26] = {0};
        for (int i = 0; i < s.length(); i++) {
            as[s[i] - 97]++;
            at[t[i] - 97]++;
        }
        for (int i = 0; i < s.length(); i++) {
            if (as[i] >= 1 && at[i] >= 1) {
                ans = true;
                break;
            }
        }
        if (ans) {
            cout << "YES" << endl;
        }
        else {
            cout << "NO" << endl;
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main() {
    int n;
    cin >> n;
    while (n--) {
        string s, t;
        bool ans = false;
        cin >> s >> t;
        int as[26] = {0}, at[26] = {0};
        for (int i = 0; i < s.length(); i++) {
            as[s[i] - 97]++;
            at[t[i] - 97]++;
        }
        for (int i = 0; i < s.length(); i++) {
            if (as[i] >= 1 && at[i] >= 1) {
                ans = true;
                break;
            }
        }
        if (ans) {
            cout << "YES" << endl;
        }
        else {
            cout << "NO" << endl;
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main() {
    int n;
    cin >> n;
    string s, t;
    bool ans;
    int as[26] = {0}, at[26] = {0};
    while (n--) {
        ans = false;
        cin >> s >> t;
        for (int i = 0; i < s.length(); i++) {
            as[s[i] - 97]++;
        }
        for (int i = 0; i < t.length(); i++) {
            at[t[i] - 97]++;
        }
        for (int i = 0; i < s.length(); i++) {
            if (as[i] && at[i]) {
                cout << "YES" << endl;
                ans = true;
                break;
            }
        }
        if (!ans) cout << "NO" << endl;
    }
    return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define MAXN 105
#define MOD 1000000007
#define INF 1000000000
#define Pii pair<int,int>
#define Ppi pair<Pii,int>
#define fi first
#define se second
#define pb push_back
#define mp make_pair

using namespace std;

ll n,d[105];
string s,t;

int main()
{
    ios_base::sync_with_stdio();
    cin.tie(0);
    cout.tie(0);
    ifstream cin("ProbabilityTheory.inp");
    ofstream cout("ProbabilityTheory.out");
    cin >> n;
    while(n--){
        cin >> s >> t;
        for(int i=0; i<105; i++) d[i]=0;
        int D=0;
        for(int i=0; i<t.size(); i++){
            int x=int(t[i]);
            d[x]=1;
            D++;
        }
        int C=0;
        for(int i=0; i<s.size(); i++){
            int x=int(s[i]);
            if(d[x]==1){
                C++;
            }
        }
        if(C<=D) cout << "YES"<< '\n';
        else cout << "NO" << '\n';
    }
    return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define MAXN 105
#define MOD 1000000007
#define INF 1000000000
#define Pii pair<int,int>
#define Ppi pair<Pii,int>
#define fi first
#define se second
#define pb push_back
#define mp make_pair

using namespace std;

ll n,d[105];
string s,t;

int main()
{
    ios_base::sync_with_stdio();
    cin.tie(0);
    cout.tie(0);
    ifstream cin("ProbabilityTheory.inp");
    ofstream cout("ProbabilityTheory.out");
    cin >> n;
    while(n--){
        cin >> s >> t;
        for(int i=0; i<105; i++) d[i]=0;
        int D=0;
        for(int i=0; i<t.size(); i++){
            int x=int(t[i]);
            d[x]=1;
            D++;
        }
        int C=0;
        for(int i=0; i<s.size(); i++){
            int x=int(s[i]);
            if(d[x]==1){
                C++;
            }
            else
        }
        if(C<=D) cout << "YES"<< '\n';
        else cout << "NO" << '\n';
    }
    return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define MAXN 105
#define MOD 1000000007
#define INF 1000000000
#define Pii pair<int,int>
#define Ppi pair<Pii,int>
#define fi first
#define se second
#define pb push_back
#define mp make_pair

using namespace std;

ll n,d1[1005],d2[1005];
string s,t;

int main()
{
    ios_base::sync_with_stdio();
    cin.tie(0);
    cout.tie(0);
    //ifstream cin("ProbabilityTheory.inp");
    //ofstream cout("ProbabilityTheory.out");
    cin >> n;
    while(n--){
        cin >> s >> t;
        for(int i=0; i<1005; i++) d1[i]=0,d2[i]=0;
        for(int i=0; i<t.size(); i++){
            int x=int(t[i]);
            d1[x]=1;
        }
        int k1=0;
        for(int i=0; i<s.size(); i++){
            int x=int(s[i]);
            if(d1[x]==1){
                k1=1;
                break;
            }
        }

        if(k1==1)cout << "YES" << '\n';

        else cout << "NO" << '\n';
    }
    return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define MAXN 105
#define MOD 1000000007
#define INF 1000000000
#define Pii pair<int,int>
#define Ppi pair<Pii,int>
#define fi first
#define se second
#define pb push_back
#define mp make_pair

using namespace std;

ll n,d[105];
string s,t;

int main()
{
    ios_base::sync_with_stdio();
    cin.tie(0);
    cout.tie(0);
    ifstream cin("ProbabilityTheory.inp");
    ofstream cout("ProbabilityTheory.out");
    cin >> n;
    while(n--){
        cin >> s >> t;
        for(int i=0; i<105; i++) d[i]=0;
        int D=0;
        for(int i=0; i<t.size(); i++){
            int x=int(t[i]);
            d[x]=1;
            D++;
        }
        int C=0;
        for(int i=0; i<s.size(); i++){
            int x=int(s[i]);
            if(d[x]==1){
                C++;
            }
        }
        if(C==D) cout << "YES"<< '\n';
        else cout << "NO" << '\n';
    }
    return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define MAXN 105
#define MOD 1000000007
#define INF 1000000000
#define Pii pair<int,int>
#define Ppi pair<Pii,int>
#define fi first
#define se second
#define pb push_back
#define mp make_pair

using namespace std;

ll n,d1[1005],d2[1005];
string s,t;

int main()
{
    ios_base::sync_with_stdio();
    cin.tie(0);
    cout.tie(0);
    //ifstream cin("ProbabilityTheory.inp");
    //ofstream cout("ProbabilityTheory.out");
    cin >> n;
    while(n--){
        cin >> s >> t;
        for(int i=0; i<1005; i++) d1[i]=0,d2[i]=0;
        for(int i=0; i<t.size(); i++){
            int x=int(t[i]);
            d1[x]=1;
        }
        int k1=0;
        for(int i=0; i<s.size(); i++){
            int x=int(s[i]);
            if(d1[x]==0){
                k1=1;
                break;
            }
        }
        if(k1==0){
            cout << "YES" << '\n';
            continue;
        }
        for(int i=0; i<s.size(); i++){
            int x=int(s[i]);
            d2[x]=1;
        }
        int k2=0;
        for(int i=0; i<t.size(); i++){
            int x=int(t[i]);
            if(d2[x]==0){
                k2=1;
                break;
            }
        }
        if(k1==0){
            cout << "YES" << '\n';
            continue;
        }
        cout << "NO" << '\n';
    }
    return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define MAXN 105
#define MOD 1000000007
#define INF 1000000000
#define Pii pair<int,int>
#define Ppi pair<Pii,int>
#define fi first
#define se second
#define pb push_back
#define mp make_pair

using namespace std;

ll n,d[105];
string s,t;

int main()
{
    ios_base::sync_with_stdio();
    cin.tie(0);
    cout.tie(0);
    //ifstream cin("ProbabilityTheory.inp");
    //ofstream cout("ProbabilityTheory.out");
    cin >> n;
    while(n--){
        cin >> s >> t;
        for(int i=0; i<105; i++) d[i]=0;
        int D=0;
        for(int i=0; i<s.size(); i++){
            int x=int(s[i]);
            d[x]=1;
            D++;
        }
        int C=0;
        for(int i=0; i<t.size(); i++){
            int x=int(t[i]);
            if(d[x]==1){
                C++;
            }
        }
        if(C<=D) cout << "YES"<< '\n';
        else cout << "NO" << '\n';
    }
    return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define MAXN 105
#define MOD 1000000007
#define INF 1000000000
#define Pii pair<int,int>
#define Ppi pair<Pii,int>
#define fi first
#define se second
#define pb push_back
#define mp make_pair

using namespace std;

ll n,d[105];
string s,t;

int main()
{
    ios_base::sync_with_stdio();
    cin.tie(0);
    cout.tie(0);
    ifstream cin("ProbabilityTheory.inp");
    ofstream cout("ProbabilityTheory.out");
    cin >> n;
    while(n--){
        cin >> s >> t;
        for(int i=0; i<105; i++) d[i]=0;
        int D=0;
        for(int i=0; i<s.size(); i++){
            int x=int(s[i]);
            d[x]=1;
            D++;
        }
        int C=0;
        for(int i=0; i<t.size(); i++){
            int x=int(t[i]);
            if(d[x]==1){
                C++;
            }
        }
        if(C<=D && C>=1) cout << "YES"<< '\n';
        else cout << "NO" << '\n';
    }
    return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define MAXN 105
#define MOD 1000000007
#define INF 1000000000
#define Pii pair<int,int>
#define Ppi pair<Pii,int>
#define fi first
#define se second
#define pb push_back
#define mp make_pair

using namespace std;

ll n,d[105];
string s,t;

int main()
{
    ios_base::sync_with_stdio();
    cin.tie(0);
    cout.tie(0);
    //ifstream cin("ProbabilityTheory.inp");
    //ofstream cout("ProbabilityTheory.out");
    cin >> n;
    while(n--){
        cin >> s >> t;
        for(int i=0; i<105; i++) d[i]=0;
        for(int i=0; i<s.size(); i++){
            int x=int(s[i]);
            d[x]=1;
        }
        int C=0;
        for(int i=0; i<t.size(); i++){
            int x=int(t[i]);
            if(d[x]==0){
                C=1;
                break;
            }
        }
        if(C==0) cout << "YES"<< '\n';
        else cout << "NO" << '\n';
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    int query;
    bool dec=false;
    cin>>query;
    string s,t;
    for(int i=0;i<query;i++){
        cin>>s>>t;
        if(s.length() != t.length()){
            cout<<"No"<<endl;
        }
        else{
            for(int j=0;j<s.length();j++){
                for(int k=0;k<t.length();k++){
                    if(s[j]==t[k]){
                        dec=true;
                        break;
                    }
                }
            }
        }
        if(dec==true){
            cout<<"Yes"<<endl;
        }
        else{
            cout<<"No"<<endl;
        }
        dec=false;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    int query;
    bool dec=false;
    cin>>query;
    string s,t;
    for(int i=0;i<query;i++){
        cin>>s>>t;
        if(s.length() != t.length()){
            cout<<"No"<<endl;
        }
        else{
            for(int j=0;j<s.length();j++){
                for(int k=0;k<t.length();k++){
                    if(s[j]==t[k]){
                        cout<<"Yes"<<endl;
                        dec=true;
                        break;
                    }
                }
            }
        }
        if(dec==false){
            cout<<"No"<<endl;
        }
        dec=false;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    int query,counter=-1;
    cin>>query;
    string s,t;
    for(int i=0;i<query;i++){
        cin>>s>>t;
        if(s.length() != t.length()){
            cout<<"No"<<endl;
        }
        else{
            for(int j=0;j<s.length();j++){
                if(s[j]==t[j]){
                    counter++;
                    continue;
                }
                else if(s[j-1]==t[j]||s[j+1]==t[j]||t[j-1]==s[j]||t[j+1]==s[j]){
                    counter++;
                }
            }
        }
        if(counter>=0){
            cout<<"Yes"<<endl;
            counter = -1;
        }
        else{
            cout<<"No"<<endl;
            counter = -1;
        }
    }

    return 0;
}


#include<bits/stdc++.h>
#include<cstring>
using namespace std;

bool search(char a, char* t, int length)
{
    for(int i=0; i<length; i++)
    {
        if(t[i]==a)
        {
            return true;
        }
    }
    return false;
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int q;
    cin>>q;
    while(q--)
    {
        char s[105];
        char t[105];
        cin>>s>>t;
        int i;
        int length = strlen(s);
        for(i=0; i<length; i++)
        {
            if(search(s[i],t,length))
            {
                cout<<"YES"<<endl;
                break;
            }
        }
        if(i==length && ~search(s[i],t,length))
        {
            cout<<"NO"<<endl;
        }
    }

    return 0;
}


#include<bits/stdc++.h>
#include<cstring>
using namespace std;

bool search(char a, char* t, int length)
{
    for(int i=0; i<length; i++)
    {
        if(t[i]=='a')
        {
            return true;
        }
    }
    return false;
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int q;
    cin>>q;
    while(q--)
    {
        char s[105];
        char t[105];
        cin>>s>>t;
        int i;
        int length = strlen(s);
        for(i=0; i<length; i++)
        {
            if(search(s[i],t,length))
            {
                cout<<"YES"<<endl;
                break;
            }
        }
        if(i==length && ~search(s[i],t,length))
        {
            cout<<"NO"<<endl;
        }
    }

    return 0;
}


#include<bits/stdc++.h>
#include<cstring>
using namespace std;

bool search(char a, char* t, int length)
{
    for(int i=0; i<length; i++)
    {
        if(t[i]=='a')
        {
            return true;
        }
    }
    return false;
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int q;
    cin>>q;
    while(q--)
    {
        char s[105];
        char t[105];
        cin>>s>>t;
        int i;
        int length = strlen(s);
        for(i=0; i<length; i++)
        {
            if(search(s[i],t,length))
            {
                cout<<"YES";
                break;
            }
        }
        if(i==length)
        {
            cout<<"NO";
        }
    }

    return 0;
}


#include<bits/stdc++.h>
#include<cstring>
using namespace std;

bool search(char a, char* t, int length)
{
    for(int i=0; i<length; i++)
    {
        if(t[i]=='a')
        {
            return true;
        }
    }
    return false;
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int q;
    cin>>q;
    while(q--)
    {
        char s[105];
        char t[105];
        cin>>s>>t;
        int length = strlen(s);
        for(int i=0; i<length; i++)
        {
            if(search(s[i],t,length))
            {
                cout<<"YES";
                return 0;
            }
        }
        cout<<"NO";
    }

    return 0;
}