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

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

int MOD = 1e9 + 7;
int INF = 0x3f3f3f3f;
// ll INF = 1e18;

string s;

vector<string> out;

int n, v[1005][2]={};

int same(int ux, int uy, int vx, int vy){
	if(uy - vy) return 0;
	for(int i=0;i<uy;i++) if(s[ux+i] - s[vx+i]) return 0;
	return 1;
}

void dfs(int ux, int uy){
	if(ux + uy > n) return;
	if(v[ux][uy-2]) return;
	v[ux][uy-2] = 1;
	if(!same(ux, uy, ux+uy, 2)) dfs(ux + uy, 2);
	if(!same(ux, uy, ux+uy, 3)) dfs(ux + uy, 3);
	string tmp; for(int i=0;i<uy;i++) tmp.push_back(s[ux+i]);
	reverse(tmp.begin(), tmp.end());
	out.push_back(tmp);
}

int solve(){
	cin >> s;
	reverse(s.begin(), s.end());
	n = s.size() - 5;
	if(n <= 1) return cout << 0 << endl, 0;
	dfs(0, 2); dfs(0, 3);
	sort(out.begin(), out.end());
	out.resize(unique(out.begin(), out.end()) - out.begin());
	cout << out.size() << endl;
	for(int i=0;i<out.size();i++) cout << out[i] << endl;
	return 0;
}

int main(){
	ios::sync_with_stdio(0);
	// int t; cin >> t; while(t--)
	solve();
	// cout << (solve() ? "YES" : "NO") << endl;
	return 0;
}


#include<bits/stdc++.h>
#define ll long long int
#define ld long double
#define pi pair<int,int>
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(), x.rend()
#define sz(x) ((int)x.size())
#define ln(x) ((int)x.length())
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define endl '\n'
#define dbg(x) cout<<#x<<": "<<x<<endl
#define clr(x,v) memset(x, v, sizeof(x))
#define FASTIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;
const double eps = 1e-9;
const double PI = acos(-1.0);
const ll mod = 1e9 + 7;
const int MAXN = 1e4 + 5;
string s;
bool vis[MAXN];
map<string, bool> ans;

void solve(int i)
{
    if(i < 0 || vis[i])
        return;
    vis[i] = 1;
    // try 2
    if(i - 2 >= 4 && i >= 3)
    {
        if(s[i] == s[i - 2] && s[i - 1] == s[i - 3])
        {
            // not ok
        }
        else
        {
            string t;
            t += s[i - 1];
            t += s[i];
            ans[t];
            solve(i - 2);
        }
    }
    // try 3
    if(i - 3 >= 4 && i >= 5)
    {
        if(s[i] == s[i - 3] && s[i - 1] == s[i - 4] && s[i - 2] == s[i - 5])
        {
            // not ok
        }
        else
        {
            string t;
            t += s[i - 2];
            t += s[i - 1];
            t += s[i];
            ans[t];
            solve(i - 3);
        }
    }
}

void cp()
{
    cin >> s;
    solve(ln(s) - 1);
    cout << sz(ans) << endl;
    for(auto &x : ans)
        cout << x.ff << endl;
}

int main()
{
    FASTIO;
    int t;
    t = 1;
    // cin >> t;
    while(t--)
    {
        cp();
    }
    return 0;
}


#include<bits/stdc++.h>
#define ll long long int
#define ld long double
#define pi pair<int,int>
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(), x.rend()
#define sz(x) ((int)x.size())
#define ln(x) ((int)x.length())
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define endl '\n'
#define dbg(x) cout<<#x<<": "<<x<<endl
#define clr(x,v) memset(x, v, sizeof(x))
#define FASTIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;
const double eps = 1e-9;
const double PI = acos(-1.0);
const ll mod = 1e9 + 7;
const int MAXN = 1e4 + 5;
string s;
map<pi, bool> vis;
map<string, bool> ans;

void solve(int i, int last)
{
    if(vis.count({i, last}))
        return;
    vis[ {i, last}] = 1;
    string prev;
    for(int j = 0; j < last; j++)
        prev += s[i + j + 1];
    // try 2
    if(i - 2 >= 4)
    {
        string me;
        me += s[i - 1];
        me += s[i];
        if(me != prev)
            ans[me], solve(i - 2, 2);
    }

    // try 3
    if(i - 3 >= 4)
    {
        string me;
        me += s[i - 2];
        me += s[i - 1];
        me += s[i];
        if(me != prev)
            ans[me], solve(i - 3, 3);
    }
}

void cp()
{
    cin >> s;
    solve(ln(s) - 1, 0);
    cout << sz(ans) << endl;
    for(auto &x : ans)
        cout << x.ff << endl;
}

int main()
{
    FASTIO;
    int t;
    t = 1;
    // cin >> t;
    while(t--)
    {
        cp();
    }
    return 0;
}


#include<bits/stdc++.h>
#define ll long long int
#define ld long double
#define pi pair<int,int>
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(), x.rend()
#define sz(x) ((int)x.size())
#define ln(x) ((int)x.length())
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define endl '\n'
#define dbg(x) cout<<#x<<": "<<x<<endl
#define clr(x,v) memset(x, v, sizeof(x))
#define FASTIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;
const double eps = 1e-9;
const double PI = acos(-1.0);
const ll mod = 1e9 + 7;
const int MAXN = 1e4 + 5;
string s;
int dp[MAXN][4];
map<string, bool> ans;

void solve(int i, int last)
{
    int &ret = dp[i][last];
    if(~ret)
        return;
    ret = 1;
    string prev;
    for(int j = 0; j < last; j++)
        prev += s[i + j + 1];
    // try 2
    if(i - 2 >= 4)
    {
        string me;
        me += s[i - 1];
        me += s[i];
        if(me != prev)
            ans[me], solve(i - 2, 2);
    }

    // try 3
    if(i - 3 >= 4)
    {
        string me;
        me += s[i - 2];
        me += s[i - 1];
        me += s[i];
        if(me != prev)
            ans[me], solve(i - 3, 3);
    }
}

void cp()
{
    cin >> s;
    clr(dp, -1);
    solve(ln(s) - 1, 0);
    cout << sz(ans) << endl;
    for(auto &x : ans)
        cout << x.ff << endl;
}

int main()
{
    FASTIO;
    int t;
    t = 1;
    // cin >> t;
    while(t--)
    {
        cp();
    }
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<algorithm>
#include<vector>
#include<set>
#include<map>
#include<utility>
#include<queue>
#include<bitset>
#include<numeric>
#define ll long long
#define inf 0x3f3f3f3f
#define pb push_back
#define mp make_pair
#define ipair pair<ll,ll>
#define inp(a) scanf("%lld",&a)
#define out(a) printf("%lld\n",a)
#define allv(a) a.begin(),a.end()
#define alla(a,n) a,a+n
#define fi(i,a,b) for(ll i=a;i<b;i++)
#define N 100000
#define set(n,x) x|=(1<<n)
#define unset(n,x) x&=~(1<<n)
#define chkbit(n,x) (x&(1<<n))!=0
#define m(a,b) (a>b? b : a)
#define M(a,b) (a>b? a : b)
#define mod 1000000007
using namespace std;

bool mat[10005][2];
set<string> res;
void divide(string s,ll n) {

    mat[n-2][0]=true;
    mat[n-3][1]=true;
    string s1,s2,s3;

    for(ll i=n-4;i>=5;i--) {
        if(s[i]==s[i+2] && s[i+1]==s[i+3])
            mat[i][0]=mat[i+2][1];
        else
            mat[i][0]=mat[i+2][0]|mat[i+2][1];
        if(s[i]==s[i+3] && s[i+1]==s[i+4] && s[i+2]==s[i+5])
            mat[i][1]=mat[i+3][0];
        else
            mat[i][1]=mat[i+3][0]|mat[i+3][1];
    }
}

int main()
{
    ll i,j,k,l,e,n,m,t,f,c;
    string s,work,curr,temp;
    memset(mat,sizeof(mat),false);
    cin>>s;
    n=s.length();
    if(n>=7) {
        divide(s,n);
        /*for(i=0;i<n;i++) {
            for(j=0;j<2;j++)
                cout<<mat[i][j]<<" ";
            cout<<endl;
        }*/
        for(i=5;i<n;i++){
            if(mat[i][0]) {
                temp=s.substr(i,2);
                res.insert(temp);
            }
            if(mat[i][1]){
                temp=s.substr(i,3);
                res.insert(temp);
            }
        }
        cout<<res.size()<<endl;
        for(auto it=res.begin();it!=res.end();it++)
            cout<<*it<<endl;
    }
    else
        cout<<"0"<<endl;
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<algorithm>
#include<vector>
#include<set>
#include<map>
#include<utility>
#include<queue>
#include<bitset>
#include<numeric>
#define ll long long
#define inf 0x3f3f3f3f
#define pb push_back
#define mp make_pair
#define ipair pair<ll,ll>
#define inp(a) scanf("%lld",&a)
#define out(a) printf("%lld\n",a)
#define allv(a) a.begin(),a.end()
#define alla(a,n) a,a+n
#define fi(i,a,b) for(ll i=a;i<b;i++)
#define N 100000
#define set(n,x) x|=(1<<n)
#define unset(n,x) x&=~(1<<n)
#define chkbit(n,x) (x&(1<<n))!=0
#define m(a,b) (a>b? b : a)
#define M(a,b) (a>b? a : b)
#define mod 1000000007
using namespace std;
set<string> res;

void divide(string s,ll n) {
    if(n==3 || n==2) {
        res.insert(s);
        return;
    }
    if(n==4) {
        string temp=s.substr(n-2,n);
        res.insert(temp);
        temp=s.substr(0,n-2);
        divide(temp,n-2);
    }
    else{
        string temp=s.substr(n-2,n);
        res.insert(temp);
        temp = s.substr(0,n-2);
        divide(temp,n-2);
        temp=s.substr(n-3,n);
        res.insert(temp);
        temp=s.substr(0,n-3);
        divide(temp,n-3);
    }
    return;
}

int main()
{
    ll i,j,k,l,e,n,m,t,f,c;
    string s,work;
    cin>>s;
    n=s.length();
    if(n>=7) {
        work=s.substr(5,n);
        divide(work,n-5);
        string temp = work.substr(n-7,n-5);
        res.insert(temp);
        if(n>=8) {
            temp = work.substr(n-8,n-5);
            res.insert(temp);
        }
        cout<<res.size()<<endl;
        for(auto it=res.begin();it!=res.end();it++)
            cout<<*it<<endl;
    }

    else
        cout<<"0"<<endl;
    return 0;
}


#include<iostream>
#include<vector>
#include<cstdio>
#include<algorithm>
#include<bitset>
#include<map>
#include<cstring>
#include<set>
#include<queue>
#include<climits>
#include<iomanip>
using namespace std;
#define uii long long int
#define it(a)  ::iterator a
#define sd(a) double a;scanf("%lf",&a);
#define slld(a) uii a;scanf("%lld",&a)
#define ss(a) scanf("%s",a)
#define plld(a) printf("%lld",a)
#define INF LLONG_MAX
#define MOD 1000000007
#define powOf2(a) !(a&a-1)
#define mod(a) (a>0 ? a : (-1*a))
#define tc(a) uii a; for(scanf("%lld",&a);a--;)
#define swap(a,b) a = a^b; b = a^b;a = a^b;
#define rep(i,n) for(uii i = 0;i<n;i++)
#define set(n,x) x |= (1 << n)
#define unset(n,x) x &= ~(1<<n)
#define check(n,x) (x & 1 << n) != 0
#define ppi pair<uii, pair<uii, uii> >

uii len;
set<string> ax,ans;
uii counter(uii curr, string prev, string m){
	string p1,p2;
	//cout<<prev<<endl;
	uii count = 0;

	if(curr+2 > len) return count;
	for(uii i = curr;i<curr+2;i++){
		p1 += m[i];
	}
	ax.insert(p1);
	//cout<<"p1 : "<<p1<<endl;
	count+=counter(curr+2, p1, m);
	if(p1 != prev) count ++;
	if(curr+3 <= len){
	for(uii i = curr;i<curr+3;i++){
		p2 += m[i];
	}
	//cout<<"p2: "<<p2<<endl;
	//if(p2 != prev && p1 != p2) count++;
	ax.insert(p2);
	count+=counter(curr+3,p2, m);
	}
    else
        return count;
	return count;
}

int main(){
	string s;
	cin>>s;
	string suff;
	uii len1 = s.size();
	for(uii i = 5;i<len1;i++){
		suff+=s[i];
	}
	reverse(suff.begin(), suff.end());
	//cout<<suff<<endl;
	len = suff.size();
	uii u = counter(0, "", suff);
	cout<<ax.size()<<endl;
	for(auto &it : ax)
	{
	    string temp = it;
	    reverse(temp.begin(),temp.end());
	    ans.insert(temp);
	    //cout<<temp<<endl;
	}
	for(string it : ans)
	{
	    cout<<it<<endl;
	}
	return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<algorithm>
#include<vector>
#include<set>
#include<map>
#include<utility>
#include<queue>
#include<bitset>
#include<numeric>
#define ll long long
#define inf 0x3f3f3f3f
#define pb push_back
#define mp make_pair
#define ipair pair<ll,ll>
#define inp(a) scanf("%lld",&a)
#define out(a) printf("%lld\n",a)
#define allv(a) a.begin(),a.end()
#define alla(a,n) a,a+n
#define fi(i,a,b) for(ll i=a;i<b;i++)
#define N 100000
#define set(n,x) x|=(1<<n)
#define unset(n,x) x&=~(1<<n)
#define chkbit(n,x) (x&(1<<n))!=0
#define m(a,b) (a>b? b : a)
#define M(a,b) (a>b? a : b)
#define mod 1000000007
using namespace std;
set<string> res;

void divide(string s,ll n) {
    if(n<=1)
        return;
    if(n==2 || n==3) {
        res.insert(s);
        return;
    }

    else if(n==4) {
        string temp=s.substr(0,2);
        res.insert(temp);
        temp=s.substr(2,n);
        divide(temp,n-2);
        return;
    }
    string temp=s.substr(0,2);
    res.insert(temp);
    temp=s.substr(2,n);
    divide(temp,n-2);
    temp=s.substr(0,3);
    res.insert(temp);
    temp=s.substr(3,n);
    divide(temp,n-3);
    return;
}

int main()
{
    ll i,j,k,l,e,n,m,t,f,c;
    string s,work,curr,temp;
    cin>>s;
    n=s.length();
    if(n>=7) {
        work=s.substr(5,n);
        ll d=n-5;
        c=0;
        for(i=d-1;i>=0;i--) {
            curr.insert(0,1,work[i]);
            c++;
            divide(curr,c);
        }
        cout<<res.size()<<endl;
        for(auto it=res.begin();it!=res.end();it++)
            cout<<*it<<endl;
    }

    else
        cout<<"0"<<endl;
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <cmath>
#include <set>
#include <fstream>
#include <cstring>
#include <string>
#include <algorithm>
#include <map>
#include <queue>
#include <iterator>
#include <iomanip>
//#include<unordered_map>
using namespace std;

#define sqr(x) ((x)*(x))
#define cbr(x) ((x)*(x)*(x))
#define max(a, b) (((a)<(b))? (b):(a))
#define min(a, b) (((a)<(b))? (a):(b))
#define all(a) a.begin(), a.end()

#define _sp system("pause");
#define _ln cout << "------------------------------------------------\n";
#define FI(a, n) for(int i=a;i<n;i++)
#define FJ(a, n) for(int j=a;j<n;j++)
#define REP(a, b, c) for(int (c) = (a); (c) < (b); (c)++)
#define rep(a, b, c) for(int (c) = (a); (c) < (b); (c)++)
#define per(b, a, c) for(int (c) = (b); (c) >= (a); (c)--)

#define ll long long
#define ull unsigned long long
#define pii pair<int, int>
#define mp(a, b) make_pair((a), (b))
#define pb(a) push_back((a))
#define x first
#define y second

#define x1 sasimathx1
#define y1 sasimathy1

ll delbit(ll a, ll k) { return a & (~(1 << k)); }
bool getbit(ll a, ll k) { return 1 & (a >> k); }
ll setbit(ll a, ll k) { return a |= (1 << k); }

inline ll mulmod(ll x, ll n, ll _mod) { ll res = 0; while (n) { if (n & 1)res = (res + x) % _mod; x = (x + x) % _mod; n >>= 1; }return res; }
inline ll powmod(ll x, ll n, ll _mod) { ll res = 1; while (n) { if (n & 1)res = (res*x) % _mod; x = (x*x) % _mod; n >>= 1; }return res; }
inline ll gcd(ll a, ll b) { ll t; while (b) { a = a%b; t = a; a = b; b = t; }return a; }
inline int gcd(int a, int b) { int t; while (b) { a = a%b; t = a; a = b; b = t; }return a; }
inline ll lcm(ll a, ll b) { return a / gcd(a, b)*b; }
inline ll gcd(ll a, ll b, ll c) { return gcd(gcd(a, b), c); }
inline int gcd(int a, int b, int c) { return gcd(gcd(a, b), c); }
double dist(double ax, double ay, double bx, double by) { return sqrt(sqr(ax - bx) + sqr(ay - by)); }

//DBG
template<typename T, typename T2>void printarr(T  a[], T2 sz, T2 beg = 0) { for (T2 i = beg; i<sz; i++) cout << a[i] << " "; cout << endl; }
#define DBG(a)         cout<<#a<<"="<<(a)<<"\n"
#define DBG2(a,b)       cout<<#a<<"="<<(a)<<", "<<#b<<"="<<(b)<<"\n"
#define DBG3(a,b,c)     cout<<#a<<"="<<(a)<<", "<<#b<<"="<<(b)<<", "<<#c<<"="<<(c)<<"\n"

//Files
#define FILE_MODE(FILE) freopen(FILE".in", "r", stdin), freopen(FILE".out", "w", stdout)

//constants
#define PI    3.1415926535897932
#define INF   1011111111
#define LLINF 1000111000111000111LL
#define eps   1e-14
//-------------------------------------------------
#define N 100

set<string> dp[10100][2];

int main()
{
	//FILE_MODE("b3");
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	string s;
	s.resize(10100);
	cin >> s;
	int n = s.length();
	rep(6, n, i) {
		string cur2 = s.substr(i - 1, 2), cur3 = s.substr(i - 2, 3),
			old2 = s.substr(i - 3, 2), old3 = s.substr(i - 5, 3);
		if (old2 != cur2){
			dp[i][0].insert(all(dp[i - 2][0]));
		}
		dp[i][0].insert(all(dp[i - 2][1]));
		dp[i][0].insert(cur2);

		if (i - 3 >= 4 && old3 != cur3) {
			if (old3 != cur3) {
				dp[i][1].insert(all(dp[i - 3][1]));
			}
			dp[i][1].insert(all(dp[i - 3][0]));
			dp[i][1].insert(cur3);
		}
	}
	set<string> ans;
	ans.insert(all(dp[n - 1][0]));
	ans.insert(all(dp[n - 1][1]));
	cout << ans.size() << endl;
	for (auto it : ans) {
		cout << it << endl;
	}

	return 0;
}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <cmath>
#include <set>
#include <fstream>
#include <cstring>
#include <string>
#include <algorithm>
#include <map>
#include <queue>
#include <iterator>
#include <iomanip>
//#include<unordered_map>
using namespace std;

#define sqr(x) ((x)*(x))
#define cbr(x) ((x)*(x)*(x))
#define max(a, b) (((a)<(b))? (b):(a))
#define min(a, b) (((a)<(b))? (a):(b))
#define all(a) a.begin(), a.end()

#define _sp system("pause");
#define _ln cout << "------------------------------------------------\n";
#define FI(a, n) for(int i=a;i<n;i++)
#define FJ(a, n) for(int j=a;j<n;j++)
#define REP(a, b, c) for(int (c) = (a); (c) < (b); (c)++)
#define rep(a, b, c) for(int (c) = (a); (c) < (b); (c)++)
#define per(b, a, c) for(int (c) = (b); (c) >= (a); (c)--)

#define ll long long
#define ull unsigned long long
#define pii pair<int, int>
#define mp(a, b) make_pair((a), (b))
#define pb(a) push_back((a))
#define x first
#define y second

#define x1 sasimathx1
#define y1 sasimathy1

ll delbit(ll a, ll k) { return a & (~(1 << k)); }
bool getbit(ll a, ll k) { return 1 & (a >> k); }
ll setbit(ll a, ll k) { return a |= (1 << k); }

inline ll mulmod(ll x, ll n, ll _mod) { ll res = 0; while (n) { if (n & 1)res = (res + x) % _mod; x = (x + x) % _mod; n >>= 1; }return res; }
inline ll powmod(ll x, ll n, ll _mod) { ll res = 1; while (n) { if (n & 1)res = (res*x) % _mod; x = (x*x) % _mod; n >>= 1; }return res; }
inline ll gcd(ll a, ll b) { ll t; while (b) { a = a%b; t = a; a = b; b = t; }return a; }
inline int gcd(int a, int b) { int t; while (b) { a = a%b; t = a; a = b; b = t; }return a; }
inline ll lcm(ll a, ll b) { return a / gcd(a, b)*b; }
inline ll gcd(ll a, ll b, ll c) { return gcd(gcd(a, b), c); }
inline int gcd(int a, int b, int c) { return gcd(gcd(a, b), c); }
double dist(double ax, double ay, double bx, double by) { return sqrt(sqr(ax - bx) + sqr(ay - by)); }

//DBG
template<typename T, typename T2>void printarr(T  a[], T2 sz, T2 beg = 0) { for (T2 i = beg; i<sz; i++) cout << a[i] << " "; cout << endl; }
#define DBG(a)         cout<<#a<<"="<<(a)<<"\n"
#define DBG2(a,b)       cout<<#a<<"="<<(a)<<", "<<#b<<"="<<(b)<<"\n"
#define DBG3(a,b,c)     cout<<#a<<"="<<(a)<<", "<<#b<<"="<<(b)<<", "<<#c<<"="<<(c)<<"\n"

//Files
#define FILE_MODE(FILE) freopen(FILE".in", "r", stdin), freopen(FILE".out", "w", stdout)

//constants
#define PI    3.1415926535897932
#define INF   1011111111
#define LLINF 1000111000111000111LL
#define eps   1e-14
//-------------------------------------------------
#define N 100

set<string> dp[10100];

int main()
{
	//FILE_MODE("b3");
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	string s;
	s.resize(10100);
	cin >> s;
	int n = s.length();
	rep(6, n, i) {
		dp[i].insert(all(dp[i - 2]));
		dp[i].insert(s.substr(i - 1, 2));
		if (i - 3 >= 4) {
			dp[i].insert(all(dp[i - 3]));
			dp[i].insert(s.substr(i - 2, 3));
		}
	}
	cout << dp[n - 1].size() << endl;
	for (auto it : dp[n - 1]) {
		cout << it << endl;
	}

	return 0;
}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <cmath>
#include <set>
#include <fstream>
#include <cstring>
#include <string>
#include <algorithm>
#include <map>
#include <queue>
#include <iterator>
#include <iomanip>
//#include<unordered_map>
using namespace std;

#define sqr(x) ((x)*(x))
#define cbr(x) ((x)*(x)*(x))
#define max(a, b) (((a)<(b))? (b):(a))
#define min(a, b) (((a)<(b))? (a):(b))
#define all(a) a.begin(), a.end()

#define _sp system("pause");
#define _ln cout << "------------------------------------------------\n";
#define FI(a, n) for(int i=a;i<n;i++)
#define FJ(a, n) for(int j=a;j<n;j++)
#define REP(a, b, c) for(int (c) = (a); (c) < (b); (c)++)
#define rep(a, b, c) for(int (c) = (a); (c) < (b); (c)++)
#define per(b, a, c) for(int (c) = (b); (c) >= (a); (c)--)

#define ll long long
#define ull unsigned long long
#define pii pair<int, int>
#define mp(a, b) make_pair((a), (b))
#define pb(a) push_back((a))
#define x first
#define y second

#define x1 sasimathx1
#define y1 sasimathy1

ll delbit(ll a, ll k) { return a & (~(1 << k)); }
bool getbit(ll a, ll k) { return 1 & (a >> k); }
ll setbit(ll a, ll k) { return a |= (1 << k); }

inline ll mulmod(ll x, ll n, ll _mod) { ll res = 0; while (n) { if (n & 1)res = (res + x) % _mod; x = (x + x) % _mod; n >>= 1; }return res; }
inline ll powmod(ll x, ll n, ll _mod) { ll res = 1; while (n) { if (n & 1)res = (res*x) % _mod; x = (x*x) % _mod; n >>= 1; }return res; }
inline ll gcd(ll a, ll b) { ll t; while (b) { a = a%b; t = a; a = b; b = t; }return a; }
inline int gcd(int a, int b) { int t; while (b) { a = a%b; t = a; a = b; b = t; }return a; }
inline ll lcm(ll a, ll b) { return a / gcd(a, b)*b; }
inline ll gcd(ll a, ll b, ll c) { return gcd(gcd(a, b), c); }
inline int gcd(int a, int b, int c) { return gcd(gcd(a, b), c); }
double dist(double ax, double ay, double bx, double by) { return sqrt(sqr(ax - bx) + sqr(ay - by)); }

//DBG
template<typename T, typename T2>void printarr(T  a[], T2 sz, T2 beg = 0) { for (T2 i = beg; i<sz; i++) cout << a[i] << " "; cout << endl; }
#define DBG(a)         cout<<#a<<"="<<(a)<<"\n"
#define DBG2(a,b)       cout<<#a<<"="<<(a)<<", "<<#b<<"="<<(b)<<"\n"
#define DBG3(a,b,c)     cout<<#a<<"="<<(a)<<", "<<#b<<"="<<(b)<<", "<<#c<<"="<<(c)<<"\n"

//Files
#define FILE_MODE(FILE) freopen(FILE".in", "r", stdin), freopen(FILE".out", "w", stdout)

//constants
#define PI    3.1415926535897932
#define INF   1011111111
#define LLINF 1000111000111000111LL
#define eps   1e-14
//-------------------------------------------------
#define N 100

bool dp[10100][2];
set<string> ans;

int main()
{
	//FILE_MODE("b3");
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	string s;
	s.resize(10100);
	cin >> s;
	int n = s.length();
	reverse(all(s));
	dp[0][0] = dp[0][1] = 1;
	rep(1, n - 4, i) {
		//cout << "ok";
		string cur2, old2, old3, cur3;
		if (i - 2 >= 0) {
			cur2 = s.substr(i - 2, 2);
			if (i - 4 >= 0)
				old2 = s.substr(i - 4, 2);
			dp[i][0] = dp[i - 2][1] || (dp[i - 2][0] && cur2 != old2);
		}
		if (i - 3 >= 0) {
			if(i - 6 >= 0)
				old3 = s.substr(i - 6, 3);
			cur3 = s.substr(i - 3, 3);
			dp[i][1] = dp[i - 3][0] || (dp[i - 3][1] && cur3 != old3);
		}
		//DBG3(i, cur2, cur3);
		reverse(all(cur2));
		reverse(all(cur3));
		if (dp[i][0])ans.insert(cur2);
		if (dp[i][1])ans.insert(cur3);
	}
	cout << ans.size() << endl;
	for (auto it : ans) {
		cout << it << endl;
	}

	return 0;
}


#include <bits/stdc++.h>
#define endl "\n"

using namespace std;

map <string, int> save;
bool k [10002][10002];

void dp (int i, int j, string &s, string sb) {

    if( i > j) return;

    if( j-i > 0 ) {

        string s1 = s.substr(j-1 , 2);
        if( sb != s1) {

            save[s1]++;
            if( k[j-2][j] == false ) {
                    k[j-2][j] = true;
                    dp(i, j-2, s, s1);
            }
        }

    }

    if( j-i > 1 ) {
        string s1 = s.substr(j-2 , 3);

        if( sb != s1 ) {

            save[s1]++;
            if( k[j-3][j] == false ) {
                    k[j-3][j] = true;
                    dp(i, j-3, s, s1);

            }
        }
    }

}

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

    string s;
    cin >> s;

    dp(5, s.size()-1, s, "");
    cout<<save.size()<<endl;
    int len = save.size();

    for(map<string, int>::iterator it = save.begin(); it != save.end(); it++ ) cout<<it->first<<endl;
    return 0;
}


#include <bits/stdc++.h>
#define endl "\n"

using namespace std;

map <string, int> save;

void dp (int i, int j, string &s) {

    if( i > j) return;

    if( j-i > 0 ) {

        string s1 = s.substr(j-1 , 2);
        if( save[s1] == 0) {

            save[s1]++;
            dp(i, j-2, s);
        }

    }

    if( j-i > 1 ) {
        string s1 = s.substr(j-2 , 3);

        if( save[s1] == 0) {

            save[s1]++;
            dp(i, j-3, s);
        }
    }

}

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

    string s;
    cin >> s;

    dp(5, s.size()-1, s);
    cout<<save.size()<<endl;
    int len = save.size();

    for(map<string, int>::iterator it = save.begin(); it != save.end(); it++ ) cout<<it->first<<endl;
    return 0;
}


#include <bits/stdc++.h>
#define endl "\n"

using namespace std;

map <string, int> save;
bool k [10002][10002];

void dp (int i, int j, string &s, string sb) {

    k[i][j] = true;

    if( i > j) return;

    if( j-i > 0 ) {

        string s1 = s.substr(j-1 , 2);
        if( sb != s1) {

            save[s1]++;
            if( k[i][j-2] == false )dp(i, j-2, s, s1);
        }

    }

    if( j-i > 1 ) {
        string s1 = s.substr(j-2 , 3);

        if( sb != s1 ) {

            save[s1]++;
            if( k[i][j-3] == false )dp(i, j-3, s, s1);
        }
    }

}

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

    string s;
    cin >> s;

    dp(5, s.size()-1, s, "");
    cout<<save.size()<<endl;
    int len = save.size();

    for(map<string, int>::iterator it = save.begin(); it != save.end(); it++ ) cout<<it->first<<endl;
    return 0;
}


#include <bits/stdc++.h>
#define endl "\n"

using namespace std;

map <string, int> save;

void dp (int i, int j, string &s, string sb) {

    if( i > j) return;

    if( j-i > 0 ) {

        string s1 = s.substr(j-1 , 2);
        if( sb != s1) {

            save[s1]++;
            dp(i, j-2, s, s1);
        }

    }

    if( j-i > 1 ) {
        string s1 = s.substr(j-2 , 3);

        if( sb != s1 ) {

            save[s1]++;
            dp(i, j-3, s, s1);
        }
    }

}

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

    string s;
    cin >> s;

    dp(5, s.size()-1, s, "");
    cout<<save.size()<<endl;
    int len = save.size();

    for(map<string, int>::iterator it = save.begin(); it != save.end(); it++ ) cout<<it->first<<endl;
    return 0;
}


#include <bits/stdc++.h>
#define endl "\n"

using namespace std;

map <string, int> save;
bool k [10002][10002];

void dp (int i, int j, string &s, string sb) {

    k[i][j] = true;

    if( i > j) return;

    if( j-i > 0 ) {

        string s1 = s.substr(j-1 , 2);
        if( sb != s1) {

            save[s1]++;
            if( k[j-2][j] == false )dp(i, j-2, s, s1);
        }

    }

    if( j-i > 1 ) {
        string s1 = s.substr(j-2 , 3);

        if( sb != s1 ) {

            save[s1]++;
            if( k[j-3][j] == false )dp(i, j-3, s, s1);
        }
    }

}

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

    string s;
    cin >> s;

    dp(5, s.size()-1, s, "");
    cout<<save.size()<<endl;
    int len = save.size();

    for(map<string, int>::iterator it = save.begin(); it != save.end(); it++ ) cout<<it->first<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define oo 2000000000
const int N = 10010;
bool can[27][27][27];
bool can2[27][27];
bool vis[N][27][27][27][2];
bool dp[N][27][27][27][2];
char s[N];

bool solve(int i,int f,int ss,int t,bool en){
	if(en)
		return (i >= 4);
	if(i < 5)
		return false;
	if(vis[i][f][ss][t][en])
		return dp[i][f][ss][t][en];
	int a = s[i-1]-'a';
	int b = s[i]-'a';
	if((a != f || b != ss) && solve(i-2,a,b,26,1)){
		dp[i][f][ss][t][en] = true;
		can2[a][b] = true;
	}
	if((a != f || b != ss)&& solve(i-2,a,b,26,0)){
		dp[i][f][ss][t][en] = true;
		can2[a][b] = true;
	}
	a = s[i-2]-'a';
	b = s[i-1]-'a';
	int c = s[i] - 'a';
	if((a != f || b != ss || t != c)&& solve(i-3,a,b,c,1)){
		dp[i][f][ss][t][en] = true;
		can[a][b][c] = true;
	}
	if(a != f && b != ss && t != c && solve(i-3,a,b,c,0)){
		dp[i][f][ss][t][en] = true;
		can[a][b][c] = true;
	}
	vis[i][f][ss][t][en] = true;
	return dp[i][f][ss][t][en];

}

int main(){
	//freopen("in.txt","r",stdin);
	scanf(" %s",s);
	int n = strlen(s);
	solve(n-1,27,27,27,0);
	vector<string> v;
	for(int i='a';i<='z';i++){
		for(int j='a';j<='z';j++){
			string s;
			s.resize(2);
			s[0] = i;
			s[1] = j;
			if(can2[i-'a'][j-'a'])
				v.push_back(s);
			for(int k='a';k<='z';k++){
				s.resize(3);
				s[0] = i;
				s[1] = j;
				s[2] = k;
				if(can[i-'a'][j-'a'][k-'a'])
					v.push_back(s);
			}
		}
	}
	sort(v.begin(),v.end());
	cout << v.size() << endl;
	for(int i=0;i<v.size();i++){
		cout << v[i] << endl;
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define oo 2000000000
const int N = 10010;
bool can[27][27][27];
bool can2[27][27];
int main(){
	//freopen("in.txt","r",stdin);
	char s[N];
	scanf(" %s",s);
	int n = strlen(s);
	for(int i=5;i<n-1;i++){
		if(i == n-3)
			continue;
		int f = s[i] - 'a';
		int ss = s[i+1] - 'a';
		can2[f][ss] = true;
	}
	for(int i=5;i<n-2;i++){
		if(i == n-4)
			continue;
		int f = s[i] - 'a';
		int ss = s[i+1] - 'a';
		int t = s[i+2] - 'a';
		can[f][ss][t] = true;
	}
	vector<string> v;
	for(int i='a';i<='z';i++){
		for(int j='a';j<='z';j++){
			string s;
			s.resize(2);
			s[0] = i;
			s[1] = j;
			if(can2[i-'a'][j-'a'])
				v.push_back(s);
			for(int k='a';k<='z';k++){
				s.resize(3);
				s[0] = i;
				s[1] = j;
				s[2] = k;
				if(can[i-'a'][j-'a'][k-'a'])
					v.push_back(s);
			}
		}
	}
	sort(v.begin(),v.end());
	cout << v.size() << endl;
	for(int i=0;i<v.size();i++){
		cout << v[i] << endl;
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define oo 2000000000
const int N = 10010;
bool can[27][27][27];
bool can2[27][27];
bool vis[N][3];
bool dp[N][3];
char s[N];
int n;

bool solve(int i,int last){
	if(i > n)
		return false;
	if(i == n)
		return true;
	if(vis[i][last])
		return dp[i][last];
	vis[i][last] = true;
	int a = s[i] - 'a';
	int b = s[i+1] - 'a';
	int c = s[i+2] - 'a';
	if(last == 0){
		if(solve(i+2,1)){
			dp[i][last] = true;
			can2[a][b] = true;
		}
		if(solve(i+3,2)){
			dp[i][last] = true;
			can[a][b][c] = true;
		}
	}
	else if (last == 1){
		int aa = s[i-2] - 'a';
		int bb = s[i-1] - 'a';
		if((aa != a || bb != b) && solve(i+2,1)){
			dp[i][last] = true;
			can2[a][b] = true;
		}
		if(solve(i+3,2)){
			dp[i][last] = true;
			can[a][b][c] = true;
		}
	}
	else{
		int aa = s[i-3] - 'a';
		int bb = s[i-2] - 'a';
		int cc = s[i-1] - 'a';
		if((aa != a || bb != b || cc != c) && solve(i+3,2)){
			dp[i][last] = true;
			can[a][b][c] = true;
		}
		if(solve(i+2,1)){
			dp[i][last] = true;
			can2[a][b] = true;
		}

	}
	return dp[i][last];

}

int main(){
	//freopen("in.txt","r",stdin);
	scanf(" %s",s);
	n = strlen(s);
	for(int i=5;i<n;i++){
		solve(i,0);
	}
	vector<string> v;
	for(int i='a';i<='z';i++){
		for(int j='a';j<='z';j++){
			string s;
			s.resize(2);
			s[0] = i;
			s[1] = j;
			if(can2[i-'a'][j-'a'])
				v.push_back(s);
			for(int k='a';k<='z';k++){
				s.resize(3);
				s[0] = i;
				s[1] = j;
				s[2] = k;
				if(can[i-'a'][j-'a'][k-'a'])
					v.push_back(s);
			}
		}
	}
	sort(v.begin(),v.end());
	cout << v.size() << endl;
	for(int i=0;i<v.size();i++){
		cout << v[i] << endl;
	}
	return 0;
}


#include<bits/stdc++.h>
#define read(x) scanf("%d",&x)
#define lread(x) scanf("%lld",&x)
#define dread(x) scanf("%lf",&x)
#define sread(x) scanf("%s",x)

using namespace std;

const int N=1e4+7;
const int M=1e4+7;
const int mod=1e9+7;
const double pi=3.1415926;
typedef long long ll;

int n;
string s;
set<string> ans;
bool flag[N];
void dfs(int u)
{
    if(flag[u]) return;
    flag[u]=true;
    if(u+2<=n && u+2!=n-1)
    {
        ans.insert(s.substr(u,2));
        dfs(u+2);
    }
    if(u+3<=n && u+3!=n-1)
    {
        ans.insert(s.substr(u,3));
        dfs(u+3);
    }
}
int main()
{
    cin>>s;
    n=s.size();
    for(int i=5;i<n && i<=6;i++)
        dfs(i);
    cout<<ans.size()<<"\n";
    for(string out :ans)
        cout<<out<<"\n";
    return 0;
}


#include<bits/stdc++.h>
#define read(x) scanf("%d",&x)
#define lread(x) scanf("%lld",&x)
#define dread(x) scanf("%lf",&x)
#define sread(x) scanf("%s",x)

using namespace std;

const int N=1e4+7;
const int M=1e4+7;
const int mod=1e9+7;
const double pi=3.1415926;
typedef long long ll;

int n;
string s;
set<string> ans;
bool dp[N][2];
int main()
{
    cin>>s;
    n=s.size();
    dp[n][1]=dp[n][0]=true;
    for(int i=n-2;i>=5;i--)
    {
        if(i+2<=n)
        {
            if(dp[i+2][1])
                ans.insert(s.substr(i,2)),dp[i][0]=true;
            else if(dp[i+2][0] && s.substr(i,2)!=s.substr(i+2,2))
                ans.insert(s.substr(i,2)),dp[i][0]=true;
        }
        if(i+3<=n)
        {
            if(dp[i+3][0])
                ans.insert(s.substr(i,3)),dp[i][1]=true;
            else if(dp[i+3][1] && s.substr(i,3)!=s.substr(i+3,3))
                ans.insert(s.substr(i,3)),dp[i][0]=true;
        }
    }
    cout<<ans.size()<<'\n';
    for(auto i:ans)
        cout<<i<<'\n';
    return 0;
}
/*
abcdexyzzzz

5
xyz
yz
yzz
zz
zzz
*/


#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>

#include <ext/pb_ds/tree_policy.hpp>

using namespace std;

using namespace __gnu_pbds;

typedef long long ll;

typedef long double ldb;

typedef pair<ll,ll> pll;

template <typename T> using ordered_set =  tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define ff first

#define ss second

#define pb push_back

#define mp make_pair

#define V vector

#define endl "\n"

#define CLEAR(a) memset(a,0,sizeof(a))

#define all(x) x.begin(),x.end()

#define sz(x) ((ll)x.size())

#define rep0(i,n) for(ll i=0;i<n;i++)

#define rep1(i,n) for(ll i=1;i<=n;i++)

#define per(i,a,b) for(ll i=a;i>=b;i--)

#define ios_tie() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cerr.tie(nullptr)

#define trace1(a)             cout <<#a<<":"<<a<< endl;

#define trace2(a,b)           cout <<#a<<":"<<a<<" | "<<#b<<":"<<b<< endl;

#define trace3(a,b,c)         cout <<#a<<":"<<a<<" | "<<#b<<":"<<b<<" | "<<#c<<":"<<c<<endl;

#define trace4(a,b,c,d)       cout <<#a<<":"<<a<<" | "<<#b<<":"<<b<<" | "<<#c<<":"<<c<<" | "<<#d<<":"<<d<<endl;

const ll inf = LLONG_MAX;

const ll mod = 998244353;

const ll maxn = 1e4+1;

const ldb PI = acos(-1);

void lol(ll s) {cerr<<"check........................................... "<<s<<endl;}

ll power(ll x,ll y) {ll res=1; x%=mod; while(y) {if(y&1) res=(res*x)%mod; y>>=1LL; x=(x*x)%mod; }return res;}

ll inv(ll x) {return power(x,mod-2);}//(1/x)%y = x^(y-2) % y;	// pow(x,y)%m = pow(x,y%(m-1))%m

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

ll gcd(ll a, ll b) {while(b) b ^= a ^= b ^= a %= b; return a;}
ll dp[maxn][4];
string s;
set<string> st;
void go(ll idx, ll lst)
{
	if(dp[idx][lst])
		return;
	dp[idx][lst] = 1;
	if((idx+2>=sz(s) || s[idx]!=s[idx+2] || s[idx-1]!=s[idx+1] || lst!=2) && idx-1>4)
	{
		st.insert(s.substr(idx-1,2));
		go(idx-2,2);
	}
	if((idx+3>=sz(s) || s[idx]!=s[idx+3] || s[idx-1]!=s[idx+2] || s[idx-2]!=s[idx+1] || lst!=3) && idx-2>4)
	{
		st.insert(s.substr(idx-2,3));
		go(idx-3,3);
	}
}

int main()

{

    ios_tie();

    cin>>s;
    go(sz(s)-1,0);
    cout<<sz(st)<<endl;
    for(auto it:st)
    	cout<<it<<endl;

    return 0;

}


#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>

#include <ext/pb_ds/tree_policy.hpp>

using namespace std;

using namespace __gnu_pbds;

typedef long long ll;

typedef long double ldb;

typedef pair<ll,ll> pll;

template <typename T> using ordered_set =  tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define ff first

#define ss second

#define pb push_back

#define mp make_pair

#define V vector

#define endl "\n"

#define CLEAR(a) memset(a,0,sizeof(a))

#define all(x) x.begin(),x.end()

#define sz(x) ((ll)x.size())

#define rep0(i,n) for(ll i=0;i<n;i++)

#define rep1(i,n) for(ll i=1;i<=n;i++)

#define per(i,a,b) for(ll i=a;i>=b;i--)

#define ios_tie() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cerr.tie(nullptr)

#define trace1(a)             cout <<#a<<":"<<a<< endl;

#define trace2(a,b)           cout <<#a<<":"<<a<<" | "<<#b<<":"<<b<< endl;

#define trace3(a,b,c)         cout <<#a<<":"<<a<<" | "<<#b<<":"<<b<<" | "<<#c<<":"<<c<<endl;

#define trace4(a,b,c,d)       cout <<#a<<":"<<a<<" | "<<#b<<":"<<b<<" | "<<#c<<":"<<c<<" | "<<#d<<":"<<d<<endl;

const ll inf = LLONG_MAX;

const ll mod = 998244353;

const ll maxn = 1e4+1;

const ldb PI = acos(-1);

void lol(ll s) {cerr<<"check........................................... "<<s<<endl;}

ll power(ll x,ll y) {ll res=1; x%=mod; while(y) {if(y&1) res=(res*x)%mod; y>>=1LL; x=(x*x)%mod; }return res;}

ll inv(ll x) {return power(x,mod-2);}//(1/x)%y = x^(y-2) % y;	// pow(x,y)%m = pow(x,y%(m-1))%m

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

ll gcd(ll a, ll b) {while(b) b ^= a ^= b ^= a %= b; return a;}
ll dp[maxn];
string s;
set<string> st;
void go(ll idx = sz(s)-1)
{
	if(dp[idx])
		return;
	dp[idx] = 1;
	if((idx+2>=sz(s) || s[idx]!=s[idx+2] || s[idx-1]!=s[idx+1]) && idx-1>4)
	{
		st.insert(s.substr(idx-1,2));
		go(idx-2);
	}
	if((idx+3>=sz(s) || s[idx]!=s[idx+3] || s[idx-1]!=s[idx+2] || s[idx-2]!=s[idx+1]) && idx-2>4)
	{
		st.insert(s.substr(idx-2,3));
		go(idx-3);
	}
}

int main()

{

    ios_tie();

    cin>>s;
    go();
    cout<<sz(st)<<endl;
    for(auto it:st)
    	cout<<it<<endl;

    return 0;

}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long ll
#define all(x) x.begin(),x.end()
#define ff first
#define ss second
#define p(x) printf("%d\n", x)
#define pl(x) printf("%lld\n", x)
#define s(x) scanf("%d", &x)
#define sl(x) scanf("%lld", &x)
#define sf(x) scanf("%lf", &x)
#define bitcount __builtin_popcountll
#define INF 1e18+9
#define eb emplace_back
#define pb push_back
#define mp make_pair
#define FIO ios_base::sync_with_stdio(false)
//#define mod 1000000007
#define mod 1003
ll power(ll a,ll b,ll m)
{
    a%=m;
    ll ret=1;
    while(b)
    {
        if(b&1)
            ret=((ret%m)*(a%m))%m;
        a=((a%m)*(a%m))%m;
        b>>=1;
    }
    return ret;
}

ll get_hash(string s)
{
    ll hash = 0;
    ll p=13;
    for(int i=0;i<s.size();i++)
    {
        ll temp = (((ll)s[i]%mod)*(power(p,i,mod)%mod))%mod;
        hash = ((hash%mod)+(temp%mod))%mod;
    }

    return hash%mod;
}

set < string > se;
string s;
int vis[10001][1003];

void func(int point,string last)
{
    ll second = get_hash(last);

    if(vis[point][second]) return;

    vis[point][second] = 1;

    if((point-2) > 3)
    {
        string str;
        for(int i=point-1;i<=point;i++)
        {
            str.pb(s[i]);
        }

        if(str != last){
            se.insert(str);
            func(point-2,str);
        }
    }
    if((point-3) > 3)
    {
        string str;
        for(int i=point-2;i<=point;i++)
        {
            str.pb(s[i]);
        }

        if(str != last){
            se.insert(str);
            func(point-3,str);
        }
    }
}

int main()
{
    cin >> s;
    func((int)s.size()-1,"**");

    cout << (int)se.size() << endl;
    for(auto it=se.begin();it!=se.end();it++)
    {
        cout << (*it) << endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long ll
#define all(x) x.begin(),x.end()
#define ff first
#define ss second
#define p(x) printf("%d\n", x)
#define pl(x) printf("%lld\n", x)
#define s(x) scanf("%d", &x)
#define sl(x) scanf("%lld", &x)
#define sf(x) scanf("%lf", &x)
#define bitcount __builtin_popcountll
#define INF 1e18+9
#define eb emplace_back
#define pb push_back
#define mp make_pair
#define FIO ios_base::sync_with_stdio(false)
#define mod 1000000007
ll power(ll a,ll b,ll m)
{
    a%=m;
    ll ret=1;
    while(b)
    {
        if(b&1)
            ret=((ret%m)*(a%m))%m;
        a=((a%m)*(a%m))%m;
        b>>=1;
    }
    return ret;
}
set < string > se;
string s;
int vis[10001];

void func(int point)
{
    if(vis[point]) return;

    vis[point] = 1;

    if((point-2) > 3)
    {
        string str;
        for(int i=point-1;i<=point;i++)
        {
            str.pb(s[i]);
        }

        se.insert(str);
        func(point-2);
    }
    if((point-3) > 3)
    {
        string str;
        for(int i=point-2;i<=point;i++)
        {
            str.pb(s[i]);
        }

        se.insert(str);
        func(point-3);
    }
}

int main()
{
    cin >> s;
    func((int)s.size()-1);

    cout << (int)se.size() << endl;
    for(auto it=se.begin();it!=se.end();it++)
    {
        cout << (*it) << endl;
    }
    return 0;
}


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

typedef pair<long long int , long long int> P;
#define mod 1000000007
#define all(container) container.begin(),container.end()
#define tr(container,it) for(typeof(container.begin()) it = container.begin();it!=container.end();it++)
#define pb push_back
#define CLR(arr) memset(arr, 0, sizeof(arr))
#define mk make_pair
#define present(container,x) ((container).find(x) != (container).end())
#define inf 123456789123456
#define infl LLONG_MAX
#define fs first
#define sc second
#define ll long long int
#define fr(it,st,en) for(it=st;it<en;it++)
#define INP ios_base::sync_with_stdio(false);cin.tie(NULL);
#define ws(x) cout << #x << " = " << x << endl
#define N 12345

ll b,m,n,q,cn,i,j,k,ans,w,pos,val,tmp1,cnt,f,sz,x,y,mx =-1,tmp,mn=LLONG_MAX,dp[N][4];

string s;
char c1;
map< string , int > mp;
set<string > st;
void rec(int ind , int stat , string sref){
	if(ind < 5)
		return;
	if(dp[ind][stat]) return;
	string stmp  = s.substr(ind,stat);
	//ws(stmp);
	if(stmp.compare(sref)!=0)
	{
		st.insert(stmp);
		//ws(stmp);
		rec(ind-3,3,stmp);
		rec(ind -2 ,2,stmp);
		dp[ind][stat] = 1;
	}

}
int main(){
INP
if (fopen("inp.txt", "r")) {
    freopen("myfile.txt","w",stdout);
    freopen("inp.txt", "r", stdin);
}
cin>>s;
n =s.size();
rec(n-3, 3 ,"*");
rec(n-2,2,"*");
//ws(mp.size());
cout<<st.size()<<"\n";
for(auto &it :st){
	cout<<it<<"\n";
}

return 0;
}


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

typedef pair<long long int , long long int> P;
#define mod 1000000007
#define all(container) container.begin(),container.end()
#define tr(container,it) for(typeof(container.begin()) it = container.begin();it!=container.end();it++)
#define pb push_back
#define CLR(arr) memset(arr, 0, sizeof(arr))
#define mk make_pair
#define present(container,x) ((container).find(x) != (container).end())
#define inf 123456789123456
#define infl LLONG_MAX
#define fs first
#define sc second
#define ll long long int
#define fr(it,st,en) for(it=st;it<en;it++)
#define INP ios_base::sync_with_stdio(false);cin.tie(NULL);
#define ws(x) cout << #x << " = " << x << endl
#define N 12345

ll b,m,n,q,cn,i,j,k,ans,w,pos,val,tmp1,cnt,f,sz,x,y,mx =-1,tmp,mn=LLONG_MAX,dp[N][4];

string s;
char c1;
map< string , int > mp;
set<string > st;
void rec(int ind , int stat , string sref){
	if(ind < 5)
		return;
	if(dp[ind][stat]) return;
	string stmp  = s.substr(ind,stat);
	//ws(stmp);
	if(stmp.compare(sref)!=0)
	{
		st.insert(stmp);
		//ws(stmp);
		rec(ind-3,3,stmp);
		rec(ind -2 ,2,stmp);
	}
	dp[ind][stat] = 1;

}
int main(){
INP
if (fopen("inp.txt", "r")) {
    freopen("myfile.txt","w",stdout);
    freopen("inp.txt", "r", stdin);
}
cin>>s;
n =s.size();
rec(n-3, 3 ,"*");
rec(n-2,2,"*");
//ws(mp.size());
cout<<st.size()<<"\n";
for(auto &it :st){
	cout<<it<<"\n";
}

return 0;
}


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

typedef pair<long long int , long long int> P;
#define mod 1000000007
#define all(container) container.begin(),container.end()
#define tr(container,it) for(typeof(container.begin()) it = container.begin();it!=container.end();it++)
#define pb push_back
#define CLR(arr) memset(arr, 0, sizeof(arr))
#define mk make_pair
#define present(container,x) ((container).find(x) != (container).end())
#define inf 123456789123456
#define infl LLONG_MAX
#define fs first
#define sc second
#define ll long long int
#define fr(it,st,en) for(it=st;it<en;it++)
#define INP ios_base::sync_with_stdio(false);cin.tie(NULL);
#define ws(x) cout << #x << " = " << x << endl
#define N 11

ll b,m,n,q,cn,i,j,k,ans,w,pos,val,tmp1,cnt,f,sz,x,y,mx =-1,tmp,mn=LLONG_MAX,a[N][N],ds[N][N];

string s;
char c1;
map< string , int > mp;
int main(){
INP
if (fopen("inp.txt", "r")) {
    freopen("myfile.txt","w",stdout);
    freopen("inp.txt", "r", stdin);
}
cin>>s;
n =s.size();
fr(i,5,n){

	if(i+2 <= n){
		string st  = s.substr(i,2);
		mp[st]++;
		// ws(st);
		// ws(i);
	}
	if(i+3 <= n){
		string st  = s.substr(i,3);
		mp[st]++;
		// ws(st);
		// ws(i);
	}

}
ans = mp.size();
string st="*" ,st1="*";
//ws(mp.size());
if(n>=9){
	 st  = s.substr(n-4,3);
	if(mp[st] == 1){
		f= 1;
		ans--;
	}
}

if(n>=8){
	 st1  = s.substr(n-3,2);
	if(mp[st1] == 1){
		f= 1;
		ans--;
	}
}

//ws(mp.size());
cout<<ans<<"\n";
for(auto &it :mp){
	if(f && (st.compare(it.fs) == 0 || st1.compare(it.fs) == 0  ) ) continue;
	cout<<it.fs<<"\n";
}

return 0;
}


// In The Name Of God
// ttldomliwptte
#include <bits/stdc++.h>

#define sqr(A) ((A) * (A))
using namespace std;
typedef long long ll;
typedef long double ld;
const int MOD = 1e9 + 7;
const int INF = INT_MAX;
const ll LINF = LLONG_MAX;

const int N = 1e4 + 20;
string s;
set<string> ans;
bool f[N][2];
int n;

string sub(int l, int r) {
	string res;
	for (int i = l; i <= r; i++)
		res += s[i];
	return res;
}

int main() {
	ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
	cin >> s; n = s.size();
	if (n < 7)
		return cout << 0 << endl, 0;
	f[n - 2][0] = f[n - 3][1] = 1;
	ans.insert(s.substr(n - 2, 2));
	ans.insert(s.substr(n - 3, 3));
	for (int i = n - 4; i > 4; i--) {
		if ((i + 3 < n && sub(i, i + 1) != s.substr(i + 2, i + 3) && f[i + 2][0]) || f[i + 2][1]) {
			ans.insert(sub(i, i + 1));
			f[i][0] = 1;
		}
		if ((i + 5 < n && s.substr(i, i + 2) != s.substr(i + 3, i + 5) && f[i + 3][1]) || f[i + 3][0]) {
			ans.insert(sub(i, i + 2));
			f[i][1] = 1;
		}
	}
	cout << ans.size() << endl;
	for (auto w : ans)
		cout << w << endl;
}


// In The Name Of God
// ttldomliwptte
#include <bits/stdc++.h>

#define sqr(A) ((A) * (A))
using namespace std;
typedef long long ll;
typedef long double ld;
const int MOD = 1e9 + 7;
const int INF = INT_MAX;
const ll LINF = LLONG_MAX;

const int N = 1e4 + 20;
string s;
set<string> ans;
bool f[N][2];
int n;

int main() {
	ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
	cin >> s; n = s.size();
	if (n < 7)
		return cout << 0 << endl, 0;
	f[n - 2][0] = f[n - 3][1] = 1;
	ans.insert(s.substr(n - 2, 2));
	ans.insert(s.substr(n - 3, 3));
	for (int i = n - 4; i > 4; i--) {
		if (s.substr(i, 2) != s.substr(i + 2, 2) && f[i + 2][0] || f[i + 2][1]) {
			ans.insert(s.substr(i, 2));
			f[i][0] = 1;
		}
		if (s.substr(i, 3) != s.substr(i + 3, 3) && f[i + 3][1] || f[i + 3][0]) {
			ans.insert(s.substr(i, 3));
			f[i][1] = 1;
		}
	}
	cout << ans.size() << endl;
	for (auto w : ans)
		cout << w << endl;
}


// In The Name Of God
// ttldomliwptte
#include <bits/stdc++.h>

#define sqr(A) ((A) * (A))
using namespace std;
typedef long long ll;
typedef long double ld;
const int MOD = 1e9 + 7;
const int INF = INT_MAX;
const ll LINF = LLONG_MAX;

const int N = 1e4 + 20;
string s;
set<string> ans;
bool f[N];
int n;

int main() {
	ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
	cin >> s; n = s.size();
	if (n < 7)
		return cout << 0 << endl, 0;
	f[n - 2] = f[n - 3] = 1;
	ans.insert(s.substr(n - 2, 2));
	ans.insert(s.substr(n - 3, 3));
	for (int i = n - 4; i > 4; i--) {
		if (s.substr(i, 2) != s.substr(i + 2, 2) && f[i + 2]) {
			ans.insert(s.substr(i, 2));
			f[i] = 1;
		}
		if (s.substr(i, 3) != s.substr(i + 3, 3) && f[i + 3]) {
			ans.insert(s.substr(i, 3));
			f[i] = 1;
		}
	}
	cout << ans.size() << endl;
	for (auto w : ans)
		cout << w << endl;
}


// In The Name Of God
// ttldomliwptte
#include <bits/stdc++.h>

#define sqr(A) ((A) * (A))
using namespace std;
typedef long long ll;
typedef long double ld;
const int MOD = 1e9 + 7;
const int INF = INT_MAX;
const ll LINF = LLONG_MAX;

const int N = 1e4 + 20;
string s;
set<string> ans;
bool f[N][2];
int n;

string sub(int l, int r) {
	string res;
	for (int i = l; i <= r; i++)
		res += s[i];
	return res;
}

int main() {
	ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
	cin >> s; n = s.size();
	if (n < 7)
		return cout << 0 << endl, 0;
	f[n - 2][0] = f[n - 3][1] = 1;
	ans.insert(s.substr(n - 2, 2));
	if (n > 7)
		ans.insert(s.substr(n - 3, 3));
	for (int i = n - 4; i > 4; i--) {
		if ((i + 3 < n && sub(i, i + 1) != s.substr(i + 2, i + 3) && f[i + 2][0]) || f[i + 2][1]) {
			ans.insert(sub(i, i + 1));
			f[i][0] = 1;
		}
		if ((i + 5 < n && s.substr(i, i + 2) != s.substr(i + 3, i + 5) && f[i + 3][1]) || f[i + 3][0]) {
			ans.insert(sub(i, i + 2));
			f[i][1] = 1;
		}
	}
	cout << ans.size() << endl;
	for (auto w : ans)
		cout << w << endl;
}


// In The Name Of God
// ttldomliwptte
#include <bits/stdc++.h>

#define sqr(A) ((A) * (A))
using namespace std;
typedef long long ll;
typedef long double ld;
const int MOD = 1e9 + 7;
const int INF = INT_MAX;
const ll LINF = LLONG_MAX;

const int N = 1e4 + 20;
string s;
set<string> ans;
bool f[N][2];
int n;

string sub(int l, int r) {
	string res;
	for (int i = l; i <= r; i++)
		res += s[i];
	return res;
}

int main() {
	ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
	cin >> s; n = s.size();
	if (n < 7)
		return cout << 0 << endl, 0;
	f[n - 2][0] = f[n - 3][1] = 1;
	ans.insert(sub(n - 2, n - 1));
	if (n > 7)
		ans.insert(sub(n - 3, n - 1));
	for (int i = n - 4; i > 4; i--) {
		if ((i + 3 < n && sub(i, i + 1) != sub(i + 2, i + 3) && f[i + 2][0]) || f[i + 2][1]) {
			ans.insert(sub(i, i + 1));
			f[i][0] = 1;
		}
		if ((i + 5 < n && sub(i, i + 2) != sub(i + 3, i + 5) && f[i + 3][1]) || f[i + 3][0]) {
			ans.insert(sub(i, i + 2));
			f[i][1] = 1;
		}
	}
	cout << ans.size() << endl;
	for (auto w : ans)
		cout << w << endl;
}


#include <cstdio>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <iostream>
#include <algorithm>
#include <string>
#define CLR(a, b) memset(a, b, sizeof(a))
using namespace std;
typedef long long LL;
typedef pair<int, int> pii;
const int MAXN = 1e5 + 10;
const int MOD = 1e9 + 7;
const int INF = 0x3f3f3f3f;
set<string> ans;
set<string> :: iterator it;
string str;
bool dp[MAXN][2];
int main()
{
    while(cin >> str) {
        ans.clear(); CLR(dp, 0); int len = str.size();
        for(int i = len-1; i >= 5; --i) {
            if(i + 2 == len) {
                dp[i][0] = true;
                ans.insert(str.substr(i, 2));
                continue;
            }
            if(i + 3 == len) {
                dp[i][1] = true;
                ans.insert(str.substr(i, 3));
                continue;
            }
            if(dp[i+2][1] || (dp[i+2][0] && str.substr(i, 2) != str.substr(i + 2, 2))) {
                dp[i][0] = true;
                ans.insert(str.substr(i, 2));
            }
            if(dp[i+3][0] || (dp[i+3][1] && str.substr(i, 3) != str.substr(i + 3, 3))) {
                dp[i][1] = true;
                ans.insert(str.substr(i, 3));
            }
        }
        cout << ans.size() << endl;
        for(it = ans.begin(); it != ans.end(); ++it) {
            cout << *it << endl;
        }
    }
    return 0;
}


#include<iostream>
#include<cmath>
#include<queue>
#include<stack>
#include<algorithm>
#include<cstdio>
#include<string>
#include<map>
using namespace std;
string tu[100000];
map<string,int>ys;
int main()
{
	#define int long long
	string q;
	cin>>q;
	if(q.size()<=6)
	{
		cout<<0<<endl;
		return 0;
	}
	string y=q.substr(q.size()-2,2);
	ys[y]=1;
	tu[1]=y;
	if(q.size()==7)
	{
		cout<<1<<endl;
		cout<<y<<endl;
		return 0;
	}
	y=q.substr(q.size()-3,3);
	ys[y]=1;
	tu[2]=y;
	if(q.size()==8)
	{
		cout<<2<<endl;
		if(tu[1]<tu[2])
		{
			cout<<tu[1]<<endl;
			cout<<tu[2]<<endl;
		}
		else
		{
			cout<<tu[2]<<endl;
			cout<<tu[1]<<endl;
		}
		return 0;
	}
//	cout<<ys.size()<<endl;
	for(int a=q.size()-4;a>=5;a--)
	{
		int jianc=0;
		y=q.substr(a,2);
		if(!ys[y]&&(ys[q.substr(a+2,2)]||ys[q.substr(a+2,3)]))
		{
			ys[y]=1;
			tu[ys.size()]=y;
		}
		else jianc++;
		y=q.substr(a,3);
		if(!ys[y]&&(ys[q.substr(a+3,2)]||ys[q.substr(a+3,3)]))
		{
			ys[y]=1;
			tu[ys.size()]=y;
		}
		else jianc++;
		if(jianc==2)break;
	}
	sort(tu+1,tu+ys.size()+1);
	cout<<ys.size()-2<<endl;
	for(int a=3;a<=ys.size();a++)
	{
		cout<<tu[a]<<endl;
	}
	return 0;
}


#include<iostream>
#include<cmath>
#include<queue>
#include<stack>
#include<algorithm>
#include<cstdio>
#include<string>
#include<map>
using namespace std;
string tu[100000];
map<string,int>ys;
int main()
{
	#define int long long
	string q;
	cin>>q;
	if(q.size()<=6)
	{
		cout<<0<<endl;
		return 0;
	}
	string y=q.substr(q.size()-2,2);
	ys[y]=1;
	tu[1]=y;
	if(q.size()==7)
	{
		cout<<1<<endl;
		cout<<y<<endl;
		return 0;
	}
	y=q.substr(q.size()-3,3);
	ys[y]=1;
	tu[2]=y;
	if(q.size()==8)
	{
		cout<<2<<endl;
		if(tu[1]<tu[2])
		{
			cout<<tu[1]<<endl;
			cout<<tu[2]<<endl;
		}
		else
		{
			cout<<tu[2]<<endl;
			cout<<tu[1]<<endl;
		}
		return 0;
	}
//	cout<<ys.size()<<endl;
	for(int a=q.size()-4;a>=5;a--)
	{
		int jianc=0;
		y=q.substr(a,2);
		if(!ys[y]&&(ys[q.substr(a+2,2)]||ys[q.substr(a+2,3)]))
		{
			ys[y]=1;
			tu[ys.size()]=y;
		}
		else jianc++;
		y=q.substr(a,3);
		if(!ys[y]&&(ys[q.substr(a+3,2)]||ys[q.substr(a+3,3)]))
		{
			ys[y]=1;
			tu[ys.size()]=y;
		}
		else jianc++;
		if(jianc==2)break;
	}
	sort(tu+1,tu+ys.size()+1);
	int sdsd=0;
	for(int a=1;a<=ys.size();a++)
	{
		if(tu[a]=="")continue;
		sdsd++;
	}
	cout<<sdsd<<endl;
	for(int a=1;a<=ys.size();a++)
	{
		if(tu[a]=="")continue;
		cout<<tu[a]<<endl;
	}
	return 0;
}


#include<iostream>
#include<cmath>
#include<queue>
#include<stack>
#include<algorithm>
#include<cstdio>
#include<string>
#include<map>
using namespace std;
string tu[100000];
map<string,int>ys,dp[50001];
int main()
{
	#define int long long
	string q;
	cin>>q;
	if(q.size()<=6)
	{
		cout<<0<<endl;
		return 0;
	}
	string y=q.substr(q.size()-2,2);
	ys[y]=1;
	tu[1]=y;
	dp[2][y]=1;
	if(q.size()==7)
	{
		cout<<1<<endl;
		cout<<y<<endl;
		return 0;
	}
	y=q.substr(q.size()-3,3);
	ys[y]=1;
	tu[2]=y;
	dp[3][y]=1;
	if(q.size()==8)
	{
		cout<<2<<endl;
		if(tu[1]<tu[2])
		{
			cout<<tu[1]<<endl;
			cout<<tu[2]<<endl;
		}
		else
		{
			cout<<tu[2]<<endl;
			cout<<tu[1]<<endl;
		}
		return 0;
	}
//	cout<<ys.size()<<endl;
	for(int a=q.size()-4;a>=5;a--)
	{
		int jianc=0;
		y=q.substr(a,2);
		if(!ys[y])
		{
			string yuy=q.substr(a+2,2),uyu=q.substr(a+2,3);
			map<string,int>
			ys[y]=1;
			tu[ys.size()]=y;
		}
//		else jianc++;
		y=q.substr(a,3);
		if(!ys[y])
		{
			ys[y]=1;
			tu[ys.size()]=y;
		}
//		else jianc++;
		if(jianc==2)break;
	}
	sort(tu+1,tu+ys.size()+1);
	int sdsd=0;
	for(int a=1;a<=ys.size();a++)
	{
		if(tu[a]=="")continue;
		sdsd++;
	}
	cout<<sdsd<<endl;
	for(int a=1;a<=ys.size();a++)
	{
		if(tu[a]=="")continue;
		cout<<tu[a]<<endl;
	}
	return 0;
}


# include <bits/stdc++.h>

using namespace std;

int sz;
string s;
set <string> ans;

int main(){
      cin >> s;

      sz = s.size();
      s = ' ' + s;

      for(int i = sz; i > 6; i -= 2){
            string t;
            t = s[i - 1];
            t += s[i];
            ans.insert(t);
      }
      for(int i = sz - 3; i > 6; i -= 2){
            string t;
            t = s[i - 1];
            t += s[i];
            ans.insert(t);
      }
      for(int i = sz; i > 7; i -= 3){
            string t;
            t = s[i - 2];
            t += s[i - 1];
            t += s[i];
            ans.insert(t);
      }
      for(int i = sz - 2; i > 7; i -= 3){
            string t;
            t = s[i - 2];
            t += s[i - 1];
            t += s[i];
            ans.insert(t);
      }
      for(int i = sz - 4; i > 7; i -= 3){
            string t;
            t = s[i - 2];
            t += s[i - 1];
            t += s[i];
            ans.insert(t);
      }

      cout << ans.size() << endl;
      for(auto i : ans)
            cout << i << endl;
}


#include <bits/stdc++.h>

using namespace std;

const int N = (int) 1e4 + 5;

set<string> ans;
string s;
int can[2][N];

int main () {
        cin >> s;

        if (s.size () >= 7) {
                ans.insert (s.substr (s.size () - 2));
                can[0][(int) s.size () - 2] = 1;
        }

        if (s.size () >= 8) {
                ans.insert (s.substr (s.size () - 3));
                can[1][(int) s.size () - 3] = 1;
        }

        for (int i = s.size () - 4; i >= 5; i--) {
                string cur = ""; cur += s[i]; cur += s[i + 1];
                string nxt = ""; nxt += s[i + 2]; nxt += s[i + 3];
                if (can[1][i + 2] == 1 || (can[0][i + 2] == 1 && cur != nxt)) {
                        can[0][i] = 1;
                        ans.insert (cur);
                }
                nxt = "";
                if (s.size () - i >= 6) {
                        nxt += s[i + 3]; nxt += s[i + 4]; nxt += s[i + 5];
                }
                cur += s[i + 2];
                if (can[0][i + 3] == 1 || (can[1][i + 3] == 1 && cur != nxt)) {
                        can[1][i] = 1;
                        ans.insert (cur);
                }
        }

        printf ("%d\n", (int) ans.size ());

        for (auto i : ans) {
                puts (i.c_str ());
        }

        return 0;
}


# include <bits/stdc++.h>

using namespace std;

int sz;
string s;
set <string> ans;

int main(){
      cin >> s;

      sz = s.size();
      s = ' ' + s;

      for(int i = sz; i > 6; i -= 2){
            string t;
            t = s[i - 1];
            t += s[i];
            int s1 = ans.size();
            ans.insert(t);
            int s2 = ans.size();
            if(s1 == s2) break;
      }
      for(int i = sz - 3; i > 6; i -= 2){
            string t;
            t = s[i - 1];
            t += s[i];
            int s1 = ans.size();
            ans.insert(t);
            int s2 = ans.size();
            if(s1 == s2) break;
      }
      for(int i = sz; i > 7; i -= 3){
            string t;
            t = s[i - 2];
            t += s[i - 1];
            t += s[i];
            int s1 = ans.size();
            ans.insert(t);
            int s2 = ans.size();
            if(s1 == s2) break;
      }
      for(int i = sz - 2; i > 7; i -= 3){
            string t;
            t = s[i - 2];
            t += s[i - 1];
            t += s[i];
            int s1 = ans.size();
            ans.insert(t);
            int s2 = ans.size();
            if(s1 == s2) break;
      }
      for(int i = sz - 4; i > 7; i -= 3){
            string t;
            t = s[i - 2];
            t += s[i - 1];
            t += s[i];
            int s1 = ans.size();
            ans.insert(t);
            int s2 = ans.size();
            if(s1 == s2) break;
      }

      cout << ans.size() << endl;
      for(auto i : ans)
            cout << i << endl;
}


# include <bits/stdc++.h>

using namespace std;

int sz;
string s;
set <string> ans, st;

int main(){
      cin >> s;

      sz = s.size();
      s = ' ' + s;

      for(int i = sz; i > 6; i -= 2){
            string t;
            t = s[i - 1];
            t += s[i];
            int s1 = st.size();
            ans.insert(t);
            st.insert(t);
            int s2 = st.size();
            if(s1 == s2) break;
      }
      st.clear();
      for(int i = sz - 3; i > 6; i -= 2){
            string t;
            t = s[i - 1];
            t += s[i];
            int s1 = st.size();
            ans.insert(t);
            st.insert(t);
            int s2 = st.size();
            if(s1 == s2) break;
      }
      st.clear();
      for(int i = sz; i > 7; i -= 3){
            string t;
            t = s[i - 2];
            t += s[i - 1];
            t += s[i];
            int s1 = st.size();
            ans.insert(t);
            st.insert(t);
            int s2 = st.size();
            if(s1 == s2) break;
      }
      st.clear();
      for(int i = sz - 2; i > 7; i -= 3){
            string t;
            t = s[i - 2];
            t += s[i - 1];
            t += s[i];
            int s1 = st.size();
            ans.insert(t);
            st.insert(t);
            int s2 = st.size();
            if(s1 == s2) break;
      }
      st.clear();
      for(int i = sz - 4; i > 7; i -= 3){
            string t;
            t = s[i - 2];
            t += s[i - 1];
            t += s[i];
            int s1 = st.size();
            ans.insert(t);
            st.insert(t);
            int s2 = st.size();
            if(s1 == s2) break;
      }

      cout << ans.size() << endl;
      for(auto i : ans)
            cout << i << endl;
}


#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>

using namespace std;

string answer[100000];
int ansidx[100000];
set<string> slist[4];

int main() {
    string input;
    int cnt = 0;
    cin >> input;
    if (input.length() >= 7) {
        slist[0].insert(input.substr(input.length() - 2, 2));
        answer[cnt++] = input.substr(input.length() - 2, 2);
    }
    if (input.length() >= 8) {
        slist[1].insert(input.substr(input.length() - 3, 3));
        answer[cnt++] = input.substr(input.length() - 3, 3);
    }
    if (input.length() >= 9) {
        if (slist[0].find(input.substr(input.length() - 4, 2)) == slist[0].end()) {
            slist[2].insert(input.substr(input.length() - 4, 2));
            answer[cnt++] = input.substr(input.length() - 4, 2);
        }
    }
    for (int i = 5; i <= input.length() - 5; i++) {
        int tmp = (i + 2) % 4;
        slist[tmp].clear();
        for (set<string>::iterator it = slist[(tmp + 2) % 4].begin(); it != slist[(tmp + 2) % 4].end(); it++) {
            if (*it != input.substr(input.length() - i, 2)) {
                slist[tmp].insert(input.substr(input.length() - i, 2));
                answer[cnt++] = input.substr(input.length() - i, 2);
            }
        }
        for (set<string>::iterator it = slist[(tmp + 1) % 4].begin(); it != slist[(tmp + 1) % 4].end(); it++) {
            if (*it != input.substr(input.length() - i, 3)) {
                slist[tmp].insert(input.substr(input.length() - i, 3));
                answer[cnt++] = input.substr(input.length() - i, 3);
            }
        }
    }
    sort(answer, answer + cnt);
    int anscnt = 0;
    string prev = "";
    for (int i = 0; i < cnt; i++) {
        if (prev != answer[i]) {
            ansidx[anscnt++] = i;
            prev = answer[i];
        }
    }
    cout << anscnt << endl;
    for (int i = 0; i < anscnt; i++) cout << answer[ansidx[i]] << endl;
}


#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>

using namespace std;

set<string> answer;
vector<string> slist[3];

int main() {
    string input;
    cin >> input;
    if (input.length() >= 7) {
        slist[0].push_back(input.substr(input.length() - 2, 2));
        answer.insert(input.substr(input.length() - 2, 2));
    }
    if (input.length() >= 8) {
        slist[1].push_back(input.substr(input.length() - 3, 3));
        answer.insert(input.substr(input.length() - 3, 3));
    }
    if (input.length() >= 9) {
        if (input.substr(input.length() - 4, 2) != slist[0][0]) {
            slist[2].push_back(input.substr(input.length() - 4, 2));
            answer.insert(input.substr(input.length() - 4, 2));
        }
    }
    for (int i = 5; i <= input.length() - 5; i++) {
        int tmp = (i + 1) % 3;
        for (int j = 0; j < slist[(tmp + 1) % 3].size(); j++) {
            if (input.substr(input.length() - i, 2) != slist[(tmp + 1) % 3][j]) {
                slist[tmp].push_back(input.substr(input.length() - i, 2));
                answer.insert(input.substr(input.length() - i, 2));
            }
        }
        for (int j = 0; j < slist[(tmp + 2) % 3].size(); j++) {
            if (input.substr(input.length() - i, 3) != slist[(tmp + 2) % 3][j]) {
                slist[tmp].push_back(input.substr(input.length() - i, 3));
                answer.insert(input.substr(input.length() - i, 3));
            }
        }
    }
    cout << answer.size() << endl;
    for (set<string>::iterator it = answer.begin(); it != answer.end(); it++) {
        cout << *it << endl;
    }
}


#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>

using namespace std;

string answer[30000];
int ansidx[30000];
vector<string> slist[4];

int main() {
    string input;
    int cnt = 0;
    cin >> input;
    if (input.length() >= 7) {
        slist[0].push_back(input.substr(input.length() - 2, 2));
        answer[cnt++] = input.substr(input.length() - 2, 2);
    }
    if (input.length() >= 8) {
        slist[1].push_back(input.substr(input.length() - 3, 3));
        answer[cnt++] = input.substr(input.length() - 3, 3);
    }
    if (input.length() >= 9) {
        if (input.substr(input.length() - 4, 2) != slist[0][0]) {
            slist[2].push_back(input.substr(input.length() - 4, 2));
            answer[cnt++] = input.substr(input.length() - 4, 2);
        }
    }
    for (int i = 5; i <= input.length() - 5; i++) {
        int tmp = (i + 2) % 4;
        for (int j = 0; j < slist[(tmp + 2) % 4].size(); j++) {
            if (input.substr(input.length() - i, 2) != slist[(tmp + 2) % 4][j]) {
                slist[tmp].push_back(input.substr(input.length() - i, 2));
                answer[cnt++] = input.substr(input.length() - i, 2);
            }
        }
        for (int j = 0; j < slist[(tmp + 1) % 4].size(); j++) {
            if (input.substr(input.length() - i, 3) != slist[(tmp + 1) % 4][j]) {
                slist[tmp].push_back(input.substr(input.length() - i, 3));
                answer[cnt++] = input.substr(input.length() - i, 3);
            }
        }
    }
    sort(answer, answer + cnt);
    int anscnt = 0;
    string prev = "";
    for (int i = 0; i < cnt; i++) {
        if (prev != answer[i]) {
            ansidx[anscnt++] = i;
            prev = answer[i];
        }
    }
    cout << anscnt << endl;
    for (int i = 0; i < anscnt; i++) cout << answer[ansidx[i]] << endl;
}


#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>

using namespace std;

set<string> answer;
vector<string> slist[4];

int main() {
    string input;
    cin >> input;
    if (input.length() >= 7) {
        slist[0].push_back(input.substr(input.length() - 2, 2));
        answer.insert(input.substr(input.length() - 2, 2));
    }
    if (input.length() >= 8) {
        slist[1].push_back(input.substr(input.length() - 3, 3));
        answer.insert(input.substr(input.length() - 3, 3));
    }
    if (input.length() >= 9) {
        if (input.substr(input.length() - 4, 2) != slist[0][0]) {
            slist[2].push_back(input.substr(input.length() - 4, 2));
            answer.insert(input.substr(input.length() - 4, 2));
        }
    }
    for (int i = 5; i <= input.length() - 5; i++) {
        int tmp = (i + 2) % 4;
        for (int j = 0; j < slist[(tmp + 2) % 4].size(); j++) {
            if (input.substr(input.length() - i, 2) != slist[(tmp + 2) % 4][j]) {
                slist[tmp].push_back(input.substr(input.length() - i, 2));
                answer.insert(input.substr(input.length() - i, 2));
            }
        }
        for (int j = 0; j < slist[(tmp + 1) % 4].size(); j++) {
            if (input.substr(input.length() - i, 3) != slist[(tmp + 1) % 4][j]) {
                slist[tmp].push_back(input.substr(input.length() - i, 3));
                answer.insert(input.substr(input.length() - i, 3));
            }
        }
    }
    cout << answer.size() << endl;
    for (set<string>::iterator it = answer.begin(); it != answer.end(); it++) {
        cout << *it << endl;
    }
}


#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>

using namespace std;

set<string> answer;
vector<string> slist[3];

int main() {
    string input;
    cin >> input;
    if (input.length() >= 7) {
        slist[0].push_back(input.substr(input.length() - 2, 2));
        answer.insert(input.substr(input.length() - 2, 2));
    }
    if (input.length() >= 8) {
        slist[1].push_back(input.substr(input.length() - 3, 3));
        answer.insert(input.substr(input.length() - 3, 3));
    }
    for (int i = 4; i <= input.length() - 5; i++) {
        int tmp = (i + 1) % 3;
        for (int j = 0; j < slist[(tmp + 1) % 3].size(); j++) {
            if (input.substr(input.length() - i, 2) != slist[(tmp + 1) % 3][j]) {
                slist[tmp].push_back(input.substr(input.length() - i, 2));
                answer.insert(input.substr(input.length() - i, 2));
            }
        }
        for (int j = 0; j < slist[(tmp + 2) % 3].size(); j++) {
            if (input.substr(input.length() - i, 3) != slist[(tmp + 2) % 3][j]) {
                slist[tmp].push_back(input.substr(input.length() - i, 3));
                answer.insert(input.substr(input.length() - i, 3));
            }
        }
    }
    cout << answer.size() << endl;
    for (set<string>::iterator it = answer.begin(); it != answer.end(); it++) {
        cout << *it << endl;
    }
}


#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>

using namespace std;

string answer[100000];
int ansidx[100000];
set<string> slist[4];

int main() {
    string input;
    int cnt = 0;
    cin >> input;
    if (input.length() >= 7) {
        slist[0].insert(input.substr(input.length() - 2, 2));
        answer[cnt++] = input.substr(input.length() - 2, 2);
    }
    if (input.length() >= 8) {
        slist[1].insert(input.substr(input.length() - 3, 3));
        answer[cnt++] = input.substr(input.length() - 3, 3);
    }
    if (input.length() >= 9) {
        if (slist[0].find(input.substr(input.length() - 4, 2)) == slist[0].end()) {
            slist[2].insert(input.substr(input.length() - 4, 2));
            answer[cnt++] = input.substr(input.length() - 4, 2);
        }
    }
    for (int i = 5; i <= input.length() - 5; i++) {
        int tmp = (i + 2) % 4;
        slist[tmp].clear();
        if (slist[(tmp + 2) % 4].find(input.substr(input.length() - i, 2)) == slist[(tmp + 2) % 4].end()) {
            slist[tmp].insert(input.substr(input.length() - i, 2));
            answer[cnt++] = input.substr(input.length() - i, 2);
        }
        if (slist[(tmp + 1) % 4].find(input.substr(input.length() - i, 3)) == slist[(tmp + 1) % 4].end()) {
            slist[tmp].insert(input.substr(input.length() - i, 3));
            answer[cnt++] = input.substr(input.length() - i, 3);
        }
    }
    sort(answer, answer + cnt);
    int anscnt = 0;
    string prev = "";
    for (int i = 0; i < cnt; i++) {
        if (prev != answer[i]) {
            ansidx[anscnt++] = i;
            prev = answer[i];
        }
    }
    cout << anscnt << endl;
    for (int i = 0; i < anscnt; i++) cout << answer[ansidx[i]] << endl;
}


#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>

using namespace std;

string answer[30000];
vector<string> slist[10000];

int main() {
    int cnt = 0;
    string input;
    cin >> input;
    if (input.length() >= 7) {
        slist[2].push_back(input.substr(input.length() - 2, 2));
        answer[cnt++] = input.substr(input.length() - 2, 2);
    }
    if (input.length() >= 8) {
        slist[3].push_back(input.substr(input.length() - 3, 3));
        answer[cnt++] = input.substr(input.length() - 3, 3);
    }
    for (int i = 4; i <= input.length() - 5; i++) {
        for (int j = 0; j < slist[i - 2].size(); j++) {
            if (input.substr(input.length() - i, 2) != slist[i - 2][j]) {
                slist[i].push_back(input.substr(input.length() - i, 2));
                answer[cnt++] = input.substr(input.length() - i, 2);
            }
        }
        for (int j = 0; j < slist[i - 3].size(); j++) {
            if (input.substr(input.length() - i, 3) != slist[i - 3][j]) {
                slist[i].push_back(input.substr(input.length() - i, 3));
                answer[cnt++] = input.substr(input.length() - i, 3);
            }
        }
    }
    sort(answer, answer + cnt);
    cout << cnt << endl;
    for (int i = 0; i < cnt; i++) {
        cout << answer[i] << endl;
    }
}


#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>

using namespace std;

set<string> answer;
vector<string> slist[10000];

int main() {
    string input;
    cin >> input;
    if (input.length() >= 7) {
        slist[2].push_back(input.substr(input.length() - 2, 2));
        answer.insert(input.substr(input.length() - 2, 2));
    }
    if (input.length() >= 8) {
        slist[3].push_back(input.substr(input.length() - 3, 3));
        answer.insert(input.substr(input.length() - 3, 3));
    }
    for (int i = 4; i <= input.length() - 5; i++) {
        for (int j = 0; j < slist[i - 2].size(); j++) {
            if (input.substr(input.length() - i, 2) != slist[i - 2][j]) {
                slist[i].push_back(input.substr(input.length() - i, 2));
                answer.insert(input.substr(input.length() - i, 2));
            }
        }
        for (int j = 0; j < slist[i - 3].size(); j++) {
            if (input.substr(input.length() - i, 3) != slist[i - 3][j]) {
                slist[i].push_back(input.substr(input.length() - i, 3));
                answer.insert(input.substr(input.length() - i, 3));
            }
        }
    }
    cout << answer.size() << endl;
    for (set<string>::iterator it = answer.begin(); it != answer.end(); it++) {
        cout << *it << endl;
    }
}


#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>

using namespace std;

string answer[100000];
int ansidx[100000];
vector<string> slist[4];

int main() {
    string input;
    int cnt = 0;
    cin >> input;
    if (input.length() >= 7) {
        slist[0].push_back(input.substr(input.length() - 2, 2));
        answer[cnt++] = input.substr(input.length() - 2, 2);
    }
    if (input.length() >= 8) {
        slist[1].push_back(input.substr(input.length() - 3, 3));
        answer[cnt++] = input.substr(input.length() - 3, 3);
    }
    if (input.length() >= 9) {
        if (input.substr(input.length() - 4, 2) != slist[0][0]) {
            slist[2].push_back(input.substr(input.length() - 4, 2));
            answer[cnt++] = input.substr(input.length() - 4, 2);
        }
    }
    for (int i = 5; i <= input.length() - 5; i++) {
        int tmp = (i + 2) % 4;
        for (int j = 0; j < slist[(tmp + 2) % 4].size(); j++) {
            if (input.substr(input.length() - i, 2) != slist[(tmp + 2) % 4][j]) {
                slist[tmp].push_back(input.substr(input.length() - i, 2));
                answer[cnt++] = input.substr(input.length() - i, 2);
            }
        }
        for (int j = 0; j < slist[(tmp + 1) % 4].size(); j++) {
            if (input.substr(input.length() - i, 3) != slist[(tmp + 1) % 4][j]) {
                slist[tmp].push_back(input.substr(input.length() - i, 3));
                answer[cnt++] = input.substr(input.length() - i, 3);
            }
        }
    }
    sort(answer, answer + cnt);
    int anscnt = 0;
    string prev = "";
    for (int i = 0; i < cnt; i++) {
        if (prev != answer[i]) {
            ansidx[anscnt++] = i;
            prev = answer[i];
        }
    }
    cout << anscnt << endl;
    for (int i = 0; i < anscnt; i++) cout << answer[ansidx[i]] << endl;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define MOD 1000000007
#define sc(n) scanf("%d",&n)
#define scl(n) scanf("%lld",&n)
#define p(n) printf("%d",n)
#define fi first
#define sec second
#define mp make_pair
#define pb push_back
int a[1000005];
set<string>se;
string str;
bool vis[10005][4];
void rec(int id,int prev_len)
{
	if(id <= 4) return;
	if(vis[id][prev_len]){
		return;
	}
	string str2,str3;
	vis[id][prev_len] = true;
	string str4 = "";
	for(int i = id+1;i < id+1+prev_len;i++){
		str4 += str[i];
	}
	if(id - 2 >= 5){
		str2 = "";
		for(int i = id-2;i <= id;i++){
			str2 += str[i];
		}
		if(str2 != str4){
			rec(id-3,3);
			se.insert(str2);
		}
	}
	if(id-1 >= 5){
		str3 = "";
		for(int i = id-1;i <= id;i++){
			str3 += str[i];
		}
		if(str3 != str4){
			rec(id-2,2);
			se.insert(str3);
		}
	}
}

int main()
{
	int i,j,k,l,m,t,r,cnt;
	int flag = 0;
	ll ans = 0,an = 0;
	t = 1;
	while(t--){
		cin >> str;
		int n = str.length();
		rec(n-1,0);
		cout << (int)se.size() << endl;
	}
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define MOD 1000000007
#define sc(n) scanf("%d",&n)
#define scl(n) scanf("%lld",&n)
#define p(n) printf("%d",n)
#define fi first
#define sec second
#define mp make_pair
#define pb push_back
int a[1000005];
set<string>se;
string str;
bool vis[10005][4];
void rec(int id,int prev_len)
{
	if(id <= 4) return;
	if(vis[id][prev_len]){
		return;
	}
	string str2,str3;
	vis[id][prev_len] = true;
	string str4 = "";
	for(int i = id+1;i < id+1+prev_len;i++){
		str4 += str[i];
	}
	if(id - 2 >= 5){
		str2 = "";
		for(int i = id-2;i <= id;i++){
			str2 += str[i];
		}
		if(str2 != str4){
			rec(id-3,3);
			se.insert(str2);
		}
	}
	if(id-1 >= 5){
		str3 = "";
		for(int i = id-1;i <= id;i++){
			str3 += str[i];
		}
		if(str3 != str4){
			rec(id-2,2);
			se.insert(str3);
		}
	}
}

int main()
{
	int i,j,k,l,m,t,r,cnt;
	int flag = 0;
	ll ans = 0,an = 0;
	t = 1;
	while(t--){
		cin >> str;
		int n = str.length();
		rec(n-1,0);
		cout << (int)se.size() << endl;
		for(string it : se){
			cout << it << endl;
		}
	}
}


            #pragma GCC optimize("O3")
            #pragma comment(linker, "/stack:200000000")
            #pragma GCC optimize("unroll-loops")

            #include <algorithm>
            #include <bitset>
            #include <cassert>
            #include <chrono>
            #include <cmath>
            #include <complex>
            #include <cstdio>
            #include <cstdlib>
            #include <cstring>
            #include <ctime>
            #include <deque>
            #include <functional>
            #include <iomanip>
            #include <iostream>
            #include <iterator>
            #include <limits>
            #include <climits>
            #include <list>
            #include <map>
            #include <numeric>
            #include <queue>
            #include <random>
            #include <ratio>
            #include <set>
            #include <sstream>
            #include <stack>
            #include <string>
            #include <unordered_map>
            #include <unordered_set>
            #include <utility>
            #include <vector>
            using namespace std;

            typedef long long ll;
            typedef long double LD;
            #define int ll
            #define double LD
            #define pb push_back
            #define mp make_pair
            #define REP(i,n) for (int i = 0; i < n; i++)
            #define loop(i,n) for (int i = 0; i < n; i++)
            #define FOR(i,a,b) for (int i = a; i < b; i++)
            #define REPD(i,n) for (int i = n-1; i >= 0; i--)
            #define FORD(i,a,b) for (int i = a; i >= b; i--)
            #define remax(a,b) a = max(a,b)
            #define remin(a,b) a = min(a,b)
            #define mem(a, b) memset(a, b, sizeof a)
            #define append push_back
            #define all(v) v.begin(),v.end()
            #define F first
            #define S second
            #define print(x) cout << (x) << endl
            #define PRECISION(x) cout << fixed << setprecision(x)
            #define FAST_IO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
            #define N 505
            #define pb push_back
            const double PI=acos(-1);
            const int MOD = 1000000007;
            const int FMOD = 998244353;
            const double eps = 1e-9;

            mt19937 RNG(chrono::steady_clock::now().time_since_epoch().count());

         	bool dp[20000][2];
           signed main()
           {
           		string s;
           		cin>>s;
           		int n=s.size();
           		set<string> ans;
           		mem(dp,false);
           		for(int i=n-1;i>=5;i--)
           		{
           			if(i+2==n)
					{
						dp[i][0]=true;
						ans.insert(s.substr(i,2));
						continue;
					}
					if(i+3==n)
					{
						dp[i][1]=true;
						ans.insert(s.substr(i,3));
						continue;
					}
					if(dp[i+2][1] || (dp[i+2][0] && s.substr(i,2)!=s.substr(i+2,2)))
					{
						dp[i][0]=true;
						ans.insert(s.substr(i,2));
					}
					if(dp[i+3][0] || (dp[i+3][1] && s.substr(i,3)!=s.substr(i+3,3)))
					{
						dp[i][1]=true;
						ans.insert(s.substr(i,3));
					}
				}
				cout<<ans.size()<<endl;
				for(auto x:ans)
				cout<<x<<endl;
		   }


        #include <algorithm>
        #include <bitset>
        #include <cassert>
        #include <chrono>
        #include <cmath>
        #include <complex>
        #include <cstdio>
        #include <cstdlib>
        #include <cstring>
        #include <ctime>
        #include <deque>
        #include <functional>
        #include <iomanip>
        #include <iostream>
        #include <iterator>
        #include <limits>
        #include <climits>
        #include <list>
        #include <map>
        #include <numeric>
        #include <queue>
        #include <random>
        #include <ratio>
        #include <set>
        #include <sstream>
        #include <stack>
        #include <string>
        #include <unordered_map>
        #include <unordered_set>
        #include <utility>
        #include <vector>
        using namespace std;

        typedef long long ll;
        typedef long double LD;
        #define int ll
        #define double LD
        #define pb push_back
        #define mp make_pair
        #define REP(i,n) for (int i = 0; i < n; i++)
        #define loop(i,n) for (int i = 0; i < n; i++)
        #define FOR(i,a,b) for (int i = a; i < b; i++)
        #define REPD(i,n) for (int i = n-1; i >= 0; i--)
        #define FORD(i,a,b) for (int i = a; i >= b; i--)
        #define remax(a,b) a = max(a,b)
        #define remin(a,b) a = min(a,b)
        #define mem(a, b) memset(a, b, sizeof a)
        #define append push_back
        #define all(v) v.begin(),v.end()
        #define F first
        #define S second
        #define print(x) cout << (x) << endl
        #define PRECISION(x) cout << fixed << setprecision(x)
        #define FAST_IO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
        #define Test(){int t;cin >> t;for(int i=1;i<=t;i++){cout << "Case #" << i << ": ";solve();}}
        #define test(){int t; cin>>t; for(int i=1;i<=t;i++){solve();}}
        #define vi vector<int>
        #define vii vector<pair<int,int> >
        #define vci vector<pair<char,int> >
        #define vic vector<pair<int,char> >
        #define N 10005
        #define pb push_back
        const double PI=acos(-1);
        const int MOD = 1000000007;
        const int FMOD = 998244353;

		int power(int x, int y, int p)
		{
		    int res = 1;
		    x = x % p;

		    if (x == 0)
			return 0;

		    while (y > 0)
		    {
		        if (y & 1)
		            res = (res*x) % p;

		        y = y>>1;
		        x = (x*x) % p;
		    }
		    return res;
		}
		int dp[N][2];
        void solve()
        {
         	string s;
         	cin>>s;

         	int n=s.size();
         	set<string> ans;
         	for(int i=n-1;i>=5;i--)
         	{
         		if(i+2==n)
         		{
         			dp[i][0]=1;
         			ans.insert(s.substr(i,2));
         			continue;
				}
				if(i+3==n)
				{
					dp[i][1]=1;
					ans.insert(s.substr(i,3));
					continue;
				}
				if(dp[i+2][1] || (dp[i+2][0] && s.substr(i,2)!=s.substr(i+2,2)))
				{
					dp[i][0]=1;
					ans.insert(s.substr(i,2));
				}
				if(dp[i+3][0] || (dp[i+3][1] && s.substr(i,3)!=s.substr(i+3,3)))
				{
					dp[i][1]=1;
					ans.insert(s.substr(i,3));
				}
			}
			cout<<ans.size()<<endl;

			for(auto x:ans)
			cout<<x<<endl;
       	}
        signed main()
        {
           // test();
          	  solve();
        }


#pragma comment(linker, "/STACK:1024000000,1024000000")
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<vector>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<iostream>
using namespace std;
typedef long long LL;
const double pi=acos(-1.0),eps=1e-6;
void File()
{
    freopen("D:\\in.txt","r",stdin);
    freopen("D:\\out.txt","w",stdout);
}
template <class T>
inline void read(T &x)
{
    char c=getchar(); x=0;
    while(!isdigit(c)) c=getchar();
    while(isdigit(c)) {x=x*10+c-'0'; c=getchar();}
}

const int maxn=100100;
char s[maxn];
int len,f[maxn][2];
vector<string>ans;

int main()
{
    memset(s,0,sizeof s);
    scanf("%s",s); len=strlen(s);
    f[len][0]=f[len][1]=1;
    for(int i=len-1;i>4;i--)
    {
        if(len-i>=2)
        {
            if(f[i+2][1]==1)
            {
                char t[5]; memset(t,0,sizeof t);
                t[0]=s[i]; t[1]=s[i+1];

                f[i][0]=1;
                ans.push_back(t);
            }
            else if(f[i+2][0]==1)
            {
                char t[5],g[5]; memset(t,0,sizeof t); memset(g,0,sizeof g);
                t[0]=s[i]; t[1]=s[i+1]; g[0]=s[i+2]; g[1]=s[i+3];

                if(strcmp(t,g)==0) continue;
                f[i][0]=1;
                ans.push_back(t);
            }
        }
        if(len-i>=3)
        {
            if(f[i+3][0]==1)
            {
                char t[5]; memset(t,0,sizeof t);
                t[0]=s[i]; t[1]=s[i+1]; t[2]=s[i+2];

                f[i][1]=1;
                ans.push_back(t);
            }

            else if(f[i+3][1]==1)
            {
                char t[5],g[5]; memset(t,0,sizeof t); memset(g,0,sizeof g);
                t[0]=s[i]; t[1]=s[i+1]; t[2]=s[i+2];
                g[0]=s[i+3]; g[1]=s[i+4]; g[2]=s[i+5];

                if(strcmp(t,g)==0) continue;
                f[i][1]=1;
                ans.push_back(t);
            }
        }
    }
    sort(ans.begin(),ans.end());
    printf("%d\n",ans.size());
    for(int i=0;i<ans.size();i++) cout<<ans[i]<<endl;
    return 0;
}


#pragma comment(linker, "/STACK:1024000000,1024000000")
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<vector>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<iostream>
using namespace std;
typedef long long LL;
const double pi=acos(-1.0),eps=1e-6;
void File()
{
    freopen("D:\\in.txt","r",stdin);
    freopen("D:\\out.txt","w",stdout);
}
template <class T>
inline void read(T &x)
{
    char c=getchar(); x=0;
    while(!isdigit(c)) c=getchar();
    while(isdigit(c)) {x=x*10+c-'0'; c=getchar();}
}

const int maxn=100100;
char s[maxn];
int len,f[maxn][2];
vector<string>ans;
map<string,bool>d;

int main()
{
    memset(s,0,sizeof s);
    scanf("%s",s); len=strlen(s);
    f[len][0]=f[len][1]=1;
    for(int i=len-1;i>4;i--)
    {
        if(len-i>=2)
        {
            if(f[i+2][1]==1)
            {
                char t[5]; memset(t,0,sizeof t);
                t[0]=s[i]; t[1]=s[i+1];

                f[i][0]=1;
                if(d[t]==0) ans.push_back(t),d[t]=1;
            }
            else if(f[i+2][0]==1)
            {
                char t[5],g[5]; memset(t,0,sizeof t); memset(g,0,sizeof g);
                t[0]=s[i]; t[1]=s[i+1]; g[0]=s[i+2]; g[1]=s[i+3];

                if(strcmp(t,g)==0) continue;
                f[i][0]=1;
                if(d[t]==0) ans.push_back(t),d[t]=1;
            }
        }
        if(len-i>=3)
        {
            if(f[i+3][0]==1)
            {
                char t[5]; memset(t,0,sizeof t);
                t[0]=s[i]; t[1]=s[i+1]; t[2]=s[i+2];

                f[i][1]=1;
                if(d[t]==0) ans.push_back(t),d[t]=1;
            }

            else if(f[i+3][1]==1)
            {
                char t[5],g[5]; memset(t,0,sizeof t); memset(g,0,sizeof g);
                t[0]=s[i]; t[1]=s[i+1]; t[2]=s[i+2];
                g[0]=s[i+3]; g[1]=s[i+4]; g[2]=s[i+5];

                if(strcmp(t,g)==0) continue;
                f[i][1]=1;
                if(d[t]==0) ans.push_back(t),d[t]=1;
            }
        }
    }
    sort(ans.begin(),ans.end());
    printf("%d\n",ans.size());
    for(int i=0;i<ans.size();i++) cout<<ans[i]<<endl;
    return 0;
}


#pragma comment(linker, "/STACK:1024000000,1024000000")
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<vector>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<iostream>
using namespace std;
typedef long long LL;
const double pi=acos(-1.0),eps=1e-6;
void File()
{
    freopen("D:\\in.txt","r",stdin);
    freopen("D:\\out.txt","w",stdout);
}
template <class T>
inline void read(T &x)
{
    char c=getchar(); x=0;
    while(!isdigit(c)) c=getchar();
    while(isdigit(c)) {x=x*10+c-'0'; c=getchar();}
}

const int maxn=10010;
char s[maxn];
int len;
map<string,bool>f,g;
vector<string>ans;

void dfs(int x)
{
    string t="";

    if(x-2>=4)
    {
        t=t+s[x-1]+s[x];
        if(!g[t])
        {
            g[t]=1;
            if(!f[t]) f[t]=1,ans.push_back(t);
            dfs(x-2);
            g[t]=0;
        }
    }

    if(x-3>=4)
    {
        t=""; t=t+s[x-2]+s[x-1]+s[x];
        if(!g[t])
        {
            g[t]=1;
            if(!f[t]) f[t]=1,ans.push_back(t);
            dfs(x-3);
            g[t]=0;
        }
    }
}

int main()
{
    scanf("%s",s); len=strlen(s);
    dfs(len-1);
    sort(ans.begin(),ans.end());
    printf("%d\n",ans.size());
    for(int i=0;i<ans.size();i++) cout<<ans[i]<<endl;
    return 0;
}


#include <bits/stdc++.h>
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long
#define en cin.close();return 0;
#define INF ((ll)(2e18))
#define pb push_back
#define fi first//printf("%lli\n",cur);
#define se second//scanf("%lli",&n);
using namespace std;
const ll N = 1e4+5;
bool can2[N], can3[N];
int main()
{
    fio
    //ifstream cin("in.inn");
    set<string> s;
    string str;
    cin >> str;
    can2[str.size()-2]=1;
    can3[str.size()-3]=1;
    if(str.size()-2>4)
        s.insert(str.substr(str.size()-2,2));
    if(str.size()-3>4)
        s.insert(str.substr(str.size()-3,3));
    for(ll i = str.size()-4;i>4;i--)
    {
        if(can3[i+2]||(can2[i+2]&&str.substr(i,2)!=str.substr(i+2,2)))
            can2[i]=1, s.insert(str.substr(i,2));
        if(can2[i+3]||(can3[i+3]&&str.substr(i,3)!=str.substr(i+3,3)))
            can3[i]=1, s.insert(str.substr(i,3));
    }
    cout << s.size() << "\n";
    for(auto t:s)
        cout << t << "\n";
    //cin.close();
    return 0;
}


#include <bits/stdc++.h>
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long
#define en cin.close();return 0;
#define INF ((ll)(2e18))
#define pb push_back
#define fi first//printf("%lli\n",cur);
#define se second//scanf("%lli",&n);
using namespace std;
int main()
{
    fio
    //ifstream cin("in.inn");
    set<string> s;
    string str;
    cin >> str;
    str=str.substr(5,str.size()-5);
    if(str.size()>=2)
    {
        string endd = str.substr(str.size()-2,2);
        s.insert(endd);
        ll it = str.size()-2;
        while(it>=0&&str.substr(it,2)==endd)
        {
            if(it-3>=0)
                s.insert(str.substr(it-3,3));
            if(it-2>=0)
                s.insert(str.substr(it-2,2));
            it-=2;
        }
    }
    if(str.size()>=3)
    {
        string endd = str.substr(str.size()-3,3);
        s.insert(endd);
        ll it = str.size()-3;
        while(it>=0&&str.substr(it,3)==endd)
        {
            if(it-3>=0)
                s.insert(str.substr(it-3,3));
            if(it-2>=0)
                s.insert(str.substr(it-2,2));
            it-=3;
        }
    }
    cout << s.size() << "\n";
    for(auto t:s)
        cout << t << "\n";
    //cin.close();
    return 0;
}


#include <bits/stdc++.h>
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long
#define en cin.close();return 0;
#define INF ((ll)(2e18))
#define pb push_back
#define fi first//printf("%lli\n",cur);
#define se second//scanf("%lli",&n);
using namespace std;
int main()
{
    fio
    //ifstream cin("in.inn");
    set<string> s;
    string str;
    cin >> str;
    for(ll i = 5;i<str.size();i++)
    {
        for(ll siz = 2;siz<=3;siz++)
        {
            ll left = str.size()-i-siz;
            if(left<=1&&left!=0)continue;
            s.insert(str.substr(i,siz));
        }
    }
    cout << s.size() << "\n";
    for(auto t:s)
        cout << t << "\n";
    //cin.close();
    return 0;
}


#include <bits/stdc++.h>
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long
#define en cin.close();return 0;
#define INF ((ll)(2e18))
#define pb push_back
#define fi first//printf("%lli\n",cur);
#define se second//scanf("%lli",&n);
using namespace std;
int main()
{
    fio
    //ifstream cin("in.inn");
    set<string> s;
    string str;
    cin >> str;
    str=str.substr(5,str.size()-5);
    if(str.size()>=2)
    {
        string endd = str.substr(str.size()-2,2);
        s.insert(endd);
        ll it = str.size()-2;
        while(it>=0&&str.substr(it,2)==endd)
        {
            if(it-3>=0)
                s.insert(str.substr(it-3,3));
            it-=2;
        }
        if(it>=0)
        {
            s.insert(str.substr(it,2));
            if(it>0)
                s.insert(str.substr(it-1,3));
        }
    }
    if(str.size()>=3)
    {
        string endd = str.substr(str.size()-3,3);
        s.insert(endd);
        ll it = str.size()-3;
        while(it>=0&&str.substr(it,3)==endd)
        {
            if(it-2>=0)
                s.insert(str.substr(it-2,2));
            it-=3;
        }
        if(it>=-1)
        {
            s.insert(str.substr(it+1,2));
            if(it>=0)
                s.insert(str.substr(it,3));
        }
    }
    cout << s.size() << "\n";
    for(auto t:s)
        cout << t << "\n";
    //cin.close();
    return 0;
}


#include <bits/stdc++.h>
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long
#define en cin.close();return 0;
#define INF ((ll)(2e18))
#define pb push_back
#define fi first//printf("%lli\n",cur);
#define se second//scanf("%lli",&n);
using namespace std;
const ll N = 1e4+5;
bool can[N];
int main()
{
    fio
    //ifstream cin("in.inn");
    set<string> s;
    string str;
    cin >> str;
    can[str.size()-2]=1;
    can[str.size()-3]=1;
    if(str.size()-2>4)
        s.insert(str.substr(str.size()-2,2));
    if(str.size()-3>4)
        s.insert(str.substr(str.size()-3,3));
    for(ll i = str.size()-4;i>4;i--)
    {
        if(can[i+2]&&str.substr(i,2)!=str.substr(i+2,2))
            can[i]=1, s.insert(str.substr(i,2));
        if(can[i+3]&&str.substr(i,3)!=str.substr(i+3,3))
            can[i]=1, s.insert(str.substr(i,3));
    }
    cout << s.size() << "\n";
    for(auto t:s)
        cout << t << "\n";
    //cin.close();
    return 0;
}


#pragma comment(linker, "/stack:200000000")

#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")

#include <bits/stdc++.h>

#define int long long
#define ll long long
#define ull unsigned long long
#define ld long double
#define rep(i, l, r) for (int i = l; i < r; i++)
#define repb(i, r, l) for (int i = r; i > l; i--)
#define sz(a) (int)a.size()
#define fi first
#define se second
#define all(x) x.begin(),x.end()
#define pb push_back
#define mp(a, b) make_pair(a, b)
#define ret(a) return cout<<a,0;
#define f(a , b , c  , d) mp( mp(a , b) , mp(c , d) )
using namespace std;

mt19937 mrand(random_device{}());
const ll mod=2971215073;
int rnd(int x) { return mrand() % x;}
ll powmod(ll a,ll b,ll mod) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}

typedef pair < int , int > pii ;
typedef pair < long long  , long long > pll ;

const int N = 2e5 + 123;
int n , m , k , T;
int a[N];
bool dp[2][N];
set < string > st;
string s;
ld pi = acos(-1.0) , d  ,h , v , e;

main(){
	ios::sync_with_stdio(0); cin.tie(0);cout.tie(0);
	cin >> s;
	reverse(all(s));
	for(int i = 0 ; i < 5 ; i++)
		s.pop_back();

	if(sz(s) <= 1)
		ret(0);
	if(sz(s) <= 2){
		reverse(all(s));
		ret(s);
	}
	reverse(all(s));
	st.insert(s.substr(sz(s) - 2 ,2));	st.insert(s.substr(sz(s) - 3,3));
	reverse(all(s));
	s = '#' + s;

	dp[0][2] = 1;
	dp[1][3] = 1;
	for(int i = 4 ; i < sz(s) ; i++){
		string a = s.substr(i - 1, 2);
		string b = s.substr(i - 2, 3);
		dp[0][i] = (dp[0][i - 2] && a != s.substr( i - 3 , 2)) or (dp[1][i - 2]);
        dp[1][i] = (i - 5 > 0 && dp[1][i - 3] && b != s.substr(i - 5 , 3))or dp[0][i - 3];
        reverse(all(a));
		reverse(all(b));
        if(dp[0][i])
        	st.insert(a);
        if(dp[1][i])
        	st.insert(b);

	}
	cout << sz(st) << '\n';
	for(auto x : st)
		cout << x << '\n';

}


#pragma comment(linker, "/stack:200000000")

#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")

#include <bits/stdc++.h>

#define int long long
#define ll long long
#define ull unsigned long long
#define ld long double
#define rep(i, l, r) for (int i = l; i < r; i++)
#define repb(i, r, l) for (int i = r; i > l; i--)
#define sz(a) (int)a.size()
#define fi first
#define se second
#define all(x) x.begin(),x.end()
#define pb push_back
#define mp(a, b) make_pair(a, b)
#define ret(a) return cout<<a,0;
#define f(a , b , c  , d) mp( mp(a , b) , mp(c , d) )
using namespace std;

mt19937 mrand(random_device{}());
const ll mod=2971215073;
int rnd(int x) { return mrand() % x;}
ll powmod(ll a,ll b,ll mod) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}

typedef pair < int , int > pii ;
typedef pair < long long  , long long > pll ;

const int N = 2e5 + 123;
int n , m , k , T;
int a[N];
bool dp[2][N];
set < string > st;
string s;
ld pi = acos(-1.0) , d  ,h , v , e;

main(){
	ios::sync_with_stdio(0); cin.tie(0);cout.tie(0);
	cin >> s;
	reverse(all(s));
	for(int i = 0 ; i < 5 ; i++)
		s.pop_back();

	if(sz(s) <= 1)
		ret(0);
	if(sz(s) <= 2){
		reverse(all(s));

		ret("1\n" + s);
	}
	reverse(all(s));
	st.insert(s.substr(sz(s) - 2 ,2));	st.insert(s.substr(sz(s) - 3,3));
	reverse(all(s));
	s = '#' + s;

	dp[0][2] = 1;
	dp[1][3] = 1;
	for(int i = 4 ; i < sz(s) ; i++){
		string a = s.substr(i - 1, 2);
		string b = s.substr(i - 2, 3);
		dp[0][i] = (dp[0][i - 2] && a != s.substr( i - 3 , 2)) or (dp[1][i - 2]);
        dp[1][i] = (i - 5 > 0 && dp[1][i - 3] && b != s.substr(i - 5 , 3))or dp[0][i - 3];
        reverse(all(a));
		reverse(all(b));
        if(dp[0][i])
        	st.insert(a);
        if(dp[1][i])
        	st.insert(b);

	}
	cout << sz(st) << '\n';
	for(auto x : st)
		cout << x << '\n';

}