#include<iostream>
using namespace std;
char c[200000],previous,nex,t;
int size;
int main()
{
	//freopen("input.txt","r",stdin);
	cin>>c;
	while(c[size]!=NULL)
	++size;
	for(int i=1;i<size;++i)
	{
		if(c[i]==c[i-1])
		{
			if(i+1==size)
			{
				if(c[i-1]=='z')
				c[i]='a';
				else
				c[i]=(char)(c[i-1]+1);
			} else {
				previous=c[i-1];
				nex=c[i+1];
				if(previous==nex)
				{
					if(previous=='z')
					c[i]='a';
					else
					c[i]=(char)(previous+1);
				} else {
					if(previous>nex)
					{
						t=previous;
						previous=nex;
						nex=t;
					}
					if(previous+1==nex)
					{
						if(previous=='y')
						c[i]='x';
						else
						c[i]=(char)(previous+2);
					} else
					c[i]=previous+1;
				}
			}
		}
	}
	cout<<c<<endl;
	return 0;
}


#include<iostream>
using namespace std;
char c[200000],previous,nex,t;
int size;
int main()
{
	//freopen("input.txt","r",stdin);
	cin>>c;
	while(c[size]!=NULL)
	++size;
	for(int i=1;i<size;++i)
	{
		if(c[i]==c[i-1])
		{
			if(i+1==size)
			{
				if(c[i]=='z')
				c[i]='a';
				else
				c[i]=(char)(c[i-1]+1);
			} else {
				previous=c[i-1];
				nex=c[i+1];
				if(previous==nex)
				{
					if(c[i]=='z')
					c[i]='a';
					else
					c[i]=(char)(previous+1);
				} else {
					if(previous>nex)
					{
						t=previous;
						previous=nex;
						nex=t;
					}
					if(previous+1==nex)
					{
						if(previous=='y')
						c[i]='x';
						else
						c[i]=(char)(nex+2);
					} else
					c[i]=previous+1;
				}
			}
		}
	}
	cout<<c<<endl;
	return 0;
}


#include<iostream>
using namespace std;
char c[200000],previous,nex,t;
int size;
int main()
{
	//freopen("input.txt","r",stdin);
	cin>>c;
	while(c[size]!=NULL)
	++size;
	for(int i=1;i<size;++i)
	{
		if(c[i]==c[i-1])
		{
			if(i+1==size)
			{
				if(c[i]=='z')
				c[i]='a';
				else
				c[i]=(char)(c[i-1]+1);
			} else {
				previous=c[i-1];
				nex=c[i+1];
				if(previous==nex)
				{
					if(c[i]=='z')
					c[i]='a';
					else
					c[i]=(char)(c[i]+1);
				} else {
					if(previous>nex)
					{
						t=previous;
						previous=nex;
						nex=t;
					}
					if(previous+1==nex)
					{
						if(previous=='y')
						c[i]='x';
						else
						c[i]=(char)(nex+2);
					}
				}
			}
		}
	}
	cout<<c<<endl;
	return 0;
}


#include<iostream>
using namespace std;
char c[200000],previous,nex,t;
int size;
int main()
{
	//freopen("input.txt","r",stdin);
	cin>>c;
	while(c[size]!=NULL)
	++size;
	for(int i=1;i<size;++i)
	{
		if(c[i]==c[i-1])
		{
			if(i+1==size)
			{
				if(c[i]=='z')
				c[i]='a';
				else
				c[i]=(char)(c[i-1]+1);
			} else {
				previous=c[i-1];
				nex=c[i+1];
				if(previous==nex)
				{
					if(c[i]=='z')
					c[i]='a';
					else
					c[i]=(char)(previous+1);
				} else {
					if(previous>nex)
					{
						t=previous;
						previous=nex;
						nex=t;
					}
					if(previous+1==nex)
					{
						if(previous=='y')
						c[i]='x';
						else
						c[i]=(char)(nex+2);
					} else
					c[i]=c[i-1]+1;
				}
			}
		}
	}
	cout<<c<<endl;
	return 0;
}


#include<iostream>
using namespace std;
char c[200000],previous,nex,t;
int size;
int main()
{
	//freopen("input.txt","r",stdin);
	cin>>c;
	while(c[size]!=NULL)
	++size;
	for(int i=1;i<size;++i)
	{
		if(c[i]==c[i-1])
		{
			if(i+1==size)
			{
				if(c[i-1]=='z')
				c[i]='a';
				else
				c[i]=(char)(c[i-1]+1);
			} else {
				previous=c[i-1];
				nex=c[i+1];
				if(previous==nex)
				{
					if(c[i]=='z')
					c[i]='a';
					else
					c[i]=(char)(previous+1);
				} else {
					if(previous>nex)
					{
						t=previous;
						previous=nex;
						nex=t;
					}
					if(previous+1==nex)
					{
						if(previous=='y')
						c[i]='x';
						else
						c[i]=(char)(nex+2);
					} else
					c[i]=previous+1;
				}
			}
		}
	}
	cout<<c<<endl;
	return 0;
}


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

int main()
{
   string s;
   cin>>s;
   for(int i=1;i<s.length()-1;i++)
   {
       char c='a';
       if(s[i]==s[i-1])
       {
           while(c==s[i+1]||c==s[i-1])c++;
            s[i]=c;
       }

   }
   cout<<s<<endl;

    return 0;
}


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

int main()
{
   string s;
   cin>>s;
   for(int i=1;i<s.length()-1;i++)
   {
       char c='a';
       if(s[i]==s[i-1])
       {
           while(c==s[i+1]||c==s[i-1])c++;
            s[i]=c;

       }

   }
   cout<<s<<endl;

    return 0;
}


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

int main()
{
   string s;
   cin>>s;

   for(int i=1;i<=s.length()-1;i++)
   {
       char c='a';
       if((s[i]==s[i-1])||((i==s.length()-2)&&(s[i]==s[i+1])))
       {
           while(c==s[i+1]||c==s[i-1])c++;
            s[i]=c;
       }

   }
   cout<<s<<endl;

    return 0;
}


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

int main()
{
   string s;
   cin>>s;
   for(int i=1;i<s.length()-1;i++)
   {
       char c='a';
       if(s[i]==s[i-1])
       {

           while(c==s[i+1]||c==s[i-1])c++;
            s[i]=c;

       }

   }
   cout<<s<<endl;

    return 0;
}


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

int main()
{
   string s;
   cin>>s;
   for(int i=1;i<s.length()-1;i++)
   {
       char c='a';
       if((s[i]==s[i-1])||((i==s.length()-2)&&(s[i]==s[i+1])))
       {
           while(c==s[i+1]||c==s[i-1])c++;
            s[i]=c;
       }

   }
   cout<<s<<endl;

    return 0;
}


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

int main()
{
   string s;
   cin>>s;
   for(int i=1;i<s.length();i++)
   {
       char c='a';
       if(s[i]==s[i-1])
       {
           while(c==s[i+1]||c==s[i-1])c++;
            s[i]=c;
       }

   }
   cout<<s<<endl;

    return 0;
}


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

int main()
{
   string s;
   cin>>s;
   for(int i=1;i<=s.length()-1;i++)
   {
       char c='a';
       if((s[i]==s[i-1])||((i==s.length()-2)&&(s[i]==s[i+1])))
       {
           while(c==s[i+1]||c==s[i-1])c++;
            s[i]=c;
       }

   }
   cout<<s<<endl;

    return 0;
}


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

const int N = 200000 + 10;
int n, p, m, tmp;
int a[N], b[N];
string s;

int main()
{
	cin >> s;
	n = s.size();
	for (int i = 1; i < n; i++) {
		if (s[i] == s[i - 1]) {
			s[i] = s[i] - (s[i] - s[i - 1]) + 2;
		}
	}
	cout << s;
	return 0;
}


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

const int N = 200000 + 10;
int n, p, m, tmp;
int a[N], b[N];
string s;

int main()
{
	cin >> s;
	n = s.size();
	for (int i = 1; i < n - 1; i++) {
		if (s[i] == s[i - 1]) {
			p = 0;
			if (s[i] < 120) {
				while(p < 3) {
					s[i]++;
					p++;
					if(s[i] != s[i + 1])
						break;
				}
			}
			else
				while(p < 3) {
					s[i]--;
					p++;
					if(s[i] != s[i + 1])
						break;
				}
		}
	}
	if(s[n - 1] == s[n - 2]) {
		if(s[n - 1] < 122)
			s[n - 1]++;
		else
			s[n - 1]--;
	}
	cout << s;
	return 0;
}


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

const int N = 200000 + 10;
int n, p, m, tmp;
int a[N], b[N];
string s;

int main()
{
	cin >> s;
	n = s.size();
	for (int i = 1; i < n; i++) {
		if (s[i] == s[i - 1]) {
			if (s[i] < 120)
				s[i] = s[i] - (s[i] - s[i - 1]) + 2;
			else
				s[i] = s[i] - (s[i] - s[i - 1]) - 1;
		}
	}
	cout << s;
	return 0;
}


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

const int N = 200000 + 10;
int n, p, m, tmp;
int a[N], b[N];
string s;

int main()
{
	cin >> s;
	n = s.size();
	for (int i = 1; i < n - 1; i++) {
		if (s[i] == s[i - 1]) {
			if (s[i] < 120) {
				while(p < 3) {
					s[i]++;
					p++;
					if(s[i] != s[i + 1])
						break;
				}
			}
			else
				while(p < 3) {
					s[i]--;
					p++;
					if(s[i] != s[i + 1])
						break;
				}
		}
	}
	if(s[n - 1] == s[n - 2]) {
		if(s[n - 1] < 122)
			s[n - 1]++;
		else
			s[n - 1]--;
	}
	cout << s;
	return 0;
}


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

const int N = 200000 + 10;
int n, p, m, tmp;
int a[N], b[N];
string s;

int main()
{
	cin >> s;
	n = s.size();
	for (int i = 1; i < n - 1; i++) {
		if (s[i] == s[i - 1]) {
			if (s[i] < 120) {
				while(p < 3) {
					s[i]++;
					p++;
					if(s[i] != s[i + 1])
						break;
				}
			}
			else
				while(p < 3) {
					a[i]--;
					p++;
					if(s[i] != s[i + 1])
						break;
				}
		}
	}
	if(s[n] == s[n - 1]) {
		if(s[n] < 122)
			s[n]++;
		else
			s[n]--;
	}
	cout << s;
	return 0;
}


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

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	int i,ind,aux,exito;
	string s;
	cin>>s;
	for(i=0;i<s.size()-1;i++){
		aux=ind=i;
		exito=0;
		while(s[i]==s[i+1]&&i<s.size()-1){
			//cout<<i<<' '<<s[i]<<endl;
			i++;
			exito=1;
		}
		aux++;
		if(i-ind==1)s[i-1]++;
		while(aux<i&&exito){
			s[aux]++;
			aux+=2;
		}
		i=ind;
	}
	cout<<s<<'\n';
	return 0;
}


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

int main() {
#ifdef LOCAL
  freopen("main.in", "r", stdin);
  // freopen("main.out", "w", stdout);
#else
  ios::sync_with_stdio(0);
  cin.tie(0);
#define endl '\n'
#endif
  string s, st = "abcdefghijklmnopqrstuvwxyz";
  cin >> s;
  int l = s.size();

  for (int i = 0; i < l - 1; i++) {
    if (s[i] == s[i + 1]) {
      for (int j = 0; j < 26; j++) {
        if (i + 2 < l) {
          if (s[i + 2] != st[j] && s[i] != st[j]) {
            s[i + 1] = st[j];
            break;
          }
        } else {
          if (s[i] != st[j]) {
            s[i + 1] = st[j];
            break;
          }
        }
      }
    }
  }

  cout << s << endl;
  return 0;
}


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

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	int i,ind,aux,exito;
	string s;
	cin>>s;
	for(i=0;i<s.size()-1;i++){
		aux=ind=i;
		exito=0;
		while(s[i]==s[i+1]&&i<s.size()-1){
			//cout<<i<<' '<<s[i]<<endl;
			i++;
			exito=1;
		}
		aux++;
		if(i-ind==1){
			s[i-1]++;
			exito=0;
		}
		while(aux<=i&&exito){
			s[aux]++;
			aux+=2;
		}
	}
	cout<<s<<'\n';
	return 0;
}


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

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	int i,ind,aux,exito;
	string s;
	cin>>s;
	for(i=0;i<s.size()-1;i++){
		aux=ind=i;
		exito=0;
		while(s[i]==s[i+1]&&i<s.size()-1){
			cout<<i<<' '<<s[i]<<endl;
			i++;
			exito=1;
		}
		aux++;
		if(i-ind==1)s[i-1]++;
		while(aux<i&&exito){
			s[aux]++;
			aux+=2;
		}
		i=ind;
	}
	cout<<s<<'\n';
	return 0;
}


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

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	int i,ind,aux,exito;
	string s;
	cin>>s;
	for(i=0;i<s.size()-1;i++){
		aux=ind=i;
		exito=0;
		while(s[i]==s[i+1]&&i<s.size()-1){
			//cout<<i<<' '<<s[i]<<endl;
			i++;
			exito=1;
		}
		aux++;
		if(i-ind==1){
			s[i-1]++;
			if(s[i-1]==s[i-2])s[i-1]++;
			exito=0;
		}
		while(aux<=i&&exito){
			s[aux]++;
			aux+=2;
		}
		i=ind;
	}
	cout<<s<<'\n';
	return 0;
}


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

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	int i,ind,aux,exito;
	string s;
	cin>>s;
	for(i=0;i<s.size()-1;i++){
		aux=ind=i;
		exito=0;
		while(s[i]==s[i+1]&&i<s.size()-1){
			//cout<<i<<' '<<s[i]<<endl;
			i++;
			exito=1;
		}
		aux++;
		if(i-ind==1){
			s[i-1]++;
			if(s[i-1]==s[i-2])s[i-1]++;
			exito=0;
		}
		while(aux<=i&&exito){
			s[aux]++;
			aux+=2;
		}
	}
	cout<<s<<'\n';
	return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define faster() ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define mp make_pair
#define pb push_back

using namespace std;

string pri = "abcdefghijklmnopqstwuvxy";
string s;

main(){
	cin >> s;
	for(int i = 1; i < s.size(); i++){
		if(s[i] == s[i-1]){
			s[i] = pri[0];
			ll c = 1;
			while(s[i] == s[i+1] || s[i] == s[i-1]){
				s[i] = pri[c];
				c++;
			}
		}
	}
	cout << s;
}


#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define faster() ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define mp make_pair
#define pb push_back

using namespace std;

string s;

main(){
	cin >> s;
	for(int i = 1; i < s.size(); i++){
		if(s[i] == s[i-1]){
			if(s[i+1] == 'z') s[i] = 'a';
			else s[i] = 'z';
		}
		if(s[s.size()-1] == s[s.size()]){
			if(s[s.size()] == 'z') s[s.size()] = 'a';
			else s[s.size()] = 'z';
		}
	}
	cout << s;
}


#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define faster() ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define mp make_pair
#define pb push_back

using namespace std;

string s;

main(){
	cin >> s;
	for(int i = 1; i < s.size(); i++){
		if(s[i] == s[i-1]){
			if(s[i+1] == 'z') s[i] = 'a';
			else s[i] = 'z';
		}
	}
	cout << s;
}


#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define faster() ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define mp make_pair
#define pb push_back

using namespace std;

string s;

main(){
	cin >> s;
	for(int i = 1; i < s.size(); i++){
		if(s[i] == s[i-1]){
			if(s[i+1] == 'z' && s[i-1] == 'b') s[i] = 'a';
			else s[i] = 'b';
		}
	}
	cout << s;
}


#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define faster() ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define mp make_pair
#define pb push_back

using namespace std;

string s;

main(){
	cin >> s;
	for(int i = 0; i < s.size(); i++){
		if(s[i] == s[i-1]){
			if(s[i+1] == 'z') s[i] = 'a';
			else s[i] = 'z';
		}
	}
	cout << s;
}


#include<bits/stdc++.h>
#define ll long long
#define um unordered_map
#define mmm 10000005
using namespace std;
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    string s;
    cin>>s;
    for(int i=1;i<s.size()-1;++i)
    {
        if(s[i]==s[i-1])
        {
            if(abs(s[i+1]-s[i-1])>1)
                s[i]=s[i]+1;
            else if(abs(s[i+1]-s[i-1])==1)
                s[i]=s[i]+2;
            else if(abs(s[i+1]-s[i-1])==0)
                s[i]+=1;
        }
    }
    if(s[s.size()-1]==s[s.size()-2])
    {
        s[s.size()-1]++;
    }
    cout<<s<<"\n";
}


#include <iostream>
#include <cstring>
#include <map>
#include <vector>
#include <algorithm>
#include <iterator>
#include <cmath>
#define all(x) x.begin(),x.end()

using namespace std;

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	string s;cin>>s;
	int n = s.size();
	string a = "";
	for(int i=1;i<n;++i){
		if(s[i]==s[i-1]){
			while(s[i]==s[i-1]||s[i]==s[i+1])s[i]++;
		}
	}

	cout<<s;

		return 0;
}


#include <iostream>
#include <cstring>
#include <map>
#include <vector>
#include <algorithm>
#include <iterator>
#include <cmath>
#define all(x) x.begin(),x.end()

using namespace std;

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	string s;cin>>s;
	int n = s.size();
	for(int i=0;i<n-1;++i){
		if(s[i]==s[i+1])s[i+1] = '0';
	}
	cout<<s;

		return 0;
}


#include <iostream>
#include <cstring>
#include <map>
#include <vector>
#include <algorithm>
#include <iterator>
#include <cmath>
#define all(x) x.begin(),x.end()

using namespace std;

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	string s;cin>>s;
	int n = s.size();
	string a = "";
	for(int i=1;i<n;++i){

		if(s[i]==s[i-1]){
s[i]='a';
			while(s[i]==s[i-1]||s[i]==s[i+1])s[i]++;
		}
	}

	cout<<s;

		return 0;
}


#include <iostream>
#include <cstring>
#include <map>
#include <vector>
#include <algorithm>
#include <iterator>
#include <cmath>
#define all(x) x.begin(),x.end()

using namespace std;

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	string s;cin>>s;
	int n = s.size();
	string a = "";
	for(int i=1;i<n;++i){
		s[i]='a';
		if(s[i]==s[i-1]){
			while(s[i]==s[i-1]||s[i]==s[i+1])s[i]++;
		}
	}

	cout<<s;

		return 0;
}


#include <iostream>
#include <cstring>
#include <map>
#include <vector>
#include <algorithm>
#include <iterator>
#include <cmath>
#define all(x) x.begin(),x.end()

using namespace std;

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	string s;cin>>s;
	int n = s.size();
	string a = "";
	for(int i=1;i<n;++i){
		if(s[i]==s[i-1]){
			while(s[i]==s[i-1]||s[i]==s[i+1] && i+1<n)s[i]++;
		}
	}

	cout<<s;

		return 0;
}


#include <iostream>
#include <cstring>
#include <map>
#include <vector>
#include <algorithm>
#include <iterator>
#include <cmath>
#define all(x) x.begin(),x.end()

using namespace std;

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	string s;cin>>s;
	int n = s.size();
	string a = "";
	for(int i=1;i<n;++i){
		if(s[i]==s[i-1]){
			while(s[i]==s[i-1]||s[i]==s[i+1] && i<n)s[i]++;
		}
	}

	cout<<s;

		return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    string s;
    cin>>s;
    vi v;
    int n=s.size();
    char c=s[0];
    int count=0;
    for(int i=0;i<n;i++){
        if(s[i]==c){
            count++;
        }
        else {
            v.push_back(count);
            count=0;
        }

    }
    long long sum=0;
    for(int i=0;i<v.size();i++){
        sum+=v[i]/2;
    }
    cout<<sum;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    string s;
    cin>>s;
    vector<int> v;
    int n=s.size();
    char c=s[0];
    int count=0;
    for(int i=0;i<n;i++){
        if(s[i]==c){
            count++;
        }
        else {
            c=s[i];
            v.push_back(count);
            count=0;
        }

    }
    long long sum=0;
    for(int i=0;i<v.size();i++){
        sum+=v[i]/2;
    }
    cout<<sum;
}


#include <bits/stdc++.h>

#define for0(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define forc(i, l, r) for (int i = (int)(l); i <= (int)(r); ++i)
#define forr0(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define forr1(i, n) for (int i = (int)(n); i >= 1; --i)
#define forrc(i,r,l) for (int i= (int)(r); i>= (int)(l); --i)

#define pb push_back
#define fi first
#define se second
#define mp make_pair

#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin, (x).rend()

#define tr(c,i) for(_typeof_((c)).begin() i = (c).begin(); i != (c).end(); i++)

#define present(c,x) ((c).find(x) != (c).end())

#define cpresent(c,x) (find(all(c),x) != (c).end())

#define sz(a) int((a).size())

#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)

using namespace std;

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef double ld;
typedef long long ll;
typedef unsigned long long int ull;

const int MOD=1000000007;
int no_of_bits(long long n)
{
    int count=0;
    while(n>0)
    {
        n=n>>1;
        count++;
    }
    return count;
}
long long gcd(int a,int b)
{
    if(b==0) return a;
    else return gcd(b,a%b);
}
void printFrequency(vector<int> v)
{
    unordered_map<int, int> M;

    for (int i = 1; i<v.size(); i++) {

        if (M.find(v[i]) == M.end()) {
            M.insert(make_pair(v[i], 1));
        }

        else {
            M[v[i]]++;
        }
    }

}
void add_self(int &a, int b){
  a+=b;
  if(a>=MOD){
    a-=MOD;
  }
}

void sub_self(int &a, int b){
  a-=b;
  if(a<0){
    a+=MOD;
  }
}

int search(vi x,int n,int i){
  int l=0,h=n-1,mid;
  while(l<=h){
    mid=(l+h)/2;
    if(x[mid]<i){
      l=mid+1;
    }else{
      h=mid-1;
    }
  }
  return l;
}
bool check9(string s){
    for(int i=0;i<s.size();i++) if(s[i]!='9') return 0;
    return 1;
}
void swap(int &a,int &b){
    int c=a;
    a=b;
    b=c;
}
const int INF=-2000;
const ll INF_=1e13;
void solve(){

    string s;
    cin>>s;
    vi v;
    int n=s.size();
    char c=s[0];
    int count=0;
    for(int i=0;i<n;i++){
        if(s[i]==c){
            count++;
            if(count%2==0){
                if((c+3)%26+'a'!=s[i+1]) s[i]=(char)((c-'a'+3)%26+'a');
                else s[i]=(char)((c-'a'+4)%26+'a');
                count=0;
            }
        }
        else {
            c=s[i];
            count=1;
        }

    }
    cout<<s;

}
int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

  int t;
//   cin>>t;
t=1;
  while(t--){
      solve();
  }
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    string s;
    cin>>s;
    vector<int> v;
    int n=s.size();
    char c=s[0];
    int count=0;
    for(int i=0;i<n;i++){
        if(s[i]==c){
            count++;
        }
        else {
            v.push_back(count);
            count=0;
        }

    }
    long long sum=0;
    for(int i=0;i<v.size();i++){
        sum+=v[i]/2;
    }
    cout<<sum;
}


#include <bits/stdc++.h>

#define for0(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define forc(i, l, r) for (int i = (int)(l); i <= (int)(r); ++i)
#define forr0(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define forr1(i, n) for (int i = (int)(n); i >= 1; --i)
#define forrc(i,r,l) for (int i= (int)(r); i>= (int)(l); --i)

#define pb push_back
#define fi first
#define se second
#define mp make_pair

#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin, (x).rend()

#define tr(c,i) for(_typeof_((c)).begin() i = (c).begin(); i != (c).end(); i++)

#define present(c,x) ((c).find(x) != (c).end())

#define cpresent(c,x) (find(all(c),x) != (c).end())

#define sz(a) int((a).size())

#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)

using namespace std;

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef double ld;
typedef long long ll;
typedef unsigned long long int ull;

const int MOD=1000000007;
int no_of_bits(long long n)
{
    int count=0;
    while(n>0)
    {
        n=n>>1;
        count++;
    }
    return count;
}
long long gcd(int a,int b)
{
    if(b==0) return a;
    else return gcd(b,a%b);
}
void printFrequency(vector<int> v)
{
    unordered_map<int, int> M;

    for (int i = 1; i<v.size(); i++) {

        if (M.find(v[i]) == M.end()) {
            M.insert(make_pair(v[i], 1));
        }

        else {
            M[v[i]]++;
        }
    }

}
void add_self(int &a, int b){
  a+=b;
  if(a>=MOD){
    a-=MOD;
  }
}

void sub_self(int &a, int b){
  a-=b;
  if(a<0){
    a+=MOD;
  }
}

int search(vi x,int n,int i){
  int l=0,h=n-1,mid;
  while(l<=h){
    mid=(l+h)/2;
    if(x[mid]<i){
      l=mid+1;
    }else{
      h=mid-1;
    }
  }
  return l;
}
bool check9(string s){
    for(int i=0;i<s.size();i++) if(s[i]!='9') return 0;
    return 1;
}
void swap(int &a,int &b){
    int c=a;
    a=b;
    b=c;
}
const int INF=-2000;
const ll INF_=1e13;
void solve(){

    string s;
    cin>>s;
    vi v;
    int n=s.size();
    char c=s[0];
    int count=0;
    for(int i=0;i<n;i++){
        if(s[i]==c){
            count++;
            if(count%2==0){
                if((c-'a'+3)%26+'a'!=s[i+1]) s[i]=(char)((c-'a'+3)%26+'a');
                else s[i]=(char)((c-'a'+4)%26+'a');
                count=0;
            }
        }
        else {
            c=s[i];
            count=1;
        }

    }
    cout<<s;

}
int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

  int t;
//   cin>>t;
t=1;
  while(t--){
      solve();
  }
}


#include <bits/stdc++.h>
using namespace std;
typedef long long int lld;
typedef vector<lld> vi;
typedef pair<lld,lld> pi;
#define F first
#define S second
#define N 1000009
#define MOD 1000000007
#define PB push_back
#define MP make_pair
#define rep(i,a,b) for (lld i = a; i < b; i++)
static lld r,j,l,x,y,b,m,n,s,q,i,z,p,k,c,d,t;string s1,s2,s3,s4,st1,st2;
lld a[N];
int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(0);cout.tie(0);
  cin>>s1;n=s1.size();
  rep(i,1,n)
  {
    if(s1[i]==s1[i-1])
    {
      if(i+1<n&&s1[i]==s1[i+1])
      {
        if(s1[i]=='a')s1[i]='b';
        else s1[i]='a';
      }
      else
      {
        if(s1[i-1]=='a')
        {
          if(i+1<n&&s1[i+1]=='b')
            s1[i]='c';
          else
            s1[i]='b';
        }
        else
        {
          if(i+1<n&&s1[i+1]=='a')s1[i]='c';
          else s1[i]='a';
        }
      }
    }
  }
  cout<<s1;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long int lld;
typedef vector<lld> vi;
typedef pair<lld,lld> pi;
#define F first
#define S second
#define N 1000009
#define MOD 1000000007
#define PB push_back
#define MP make_pair
#define rep(i,a,b) for (lld i = a; i < b; i++)
static lld r,j,l,x,y,b,m,n,s,q,i,z,p,k,c,d,t;string s1,s2,s3,s4,st1,st2;
lld a[N];
int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(0);cout.tie(0);
  cin>>s1;n=s1.size();
  rep(i,1,n)
  {
    if(s1[i]==s1[i-1])
    {
      if(i+1<n&&s1[i]==s1[i+1])
      {
        if(s1[i]=='a')s1[i]='b';
        else s1[i]='a';
      }
      else
      {
        if(i+1<n)
        {
          if(s1[i-1]=='a')
          {
            if(s1[i+1]=='b')s1[i]='c';
            else s1[i]='b';
          }
          else if(s1[i+1]=='a')
          {
            s1[i]='c';
          }
          else s1[i]='a';
        }
        else
        {
          if(s1[i]=='a')s1[i]='b';
          else s1[i]='b';
        }
      }
    }
  }
  cout<<s1;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long int lld;
typedef vector<lld> vi;
typedef pair<lld,lld> pi;
#define F first
#define S second
#define N 1000009
#define MOD 1000000007
#define PB push_back
#define MP make_pair
#define rep(i,a,b) for (lld i = a; i < b; i++)
static lld r,j,l,x,y,b,m,n,s,q,i,z,p,k,c,d,t;string s1,s2,s3,s4,st1,st2;
lld a[N];
int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(0);cout.tie(0);
  cin>>s1;n=s1.size();
  rep(i,1,n)
  {
    if(s1[i]==s1[i-1])
    {
      if(i+1<n)
      {
        if(s1[i]==s1[i+1])
        {
          if(s1[i]=='a')s1[i]='z';
          else s1[i]='a';
        }
        else if(s1[i-1]=='a')
        {
          if(s1[i+1]=='b')s1[i]='c';
          else s1[i]='b';
        }
        else if(s1[i+1]=='a')
        {
          if(s1[i]=='b')s1[i]='c';
          else s1[i]='b';
        }
        else s1[i]='a';
      }
      else
      {
        if(s1[i]=='a')s1[i]='b';
        else s1[i]=s1[i]-1;
      }
    }
  }
//  if(s1[0]=='f')
  //  cout<<s1.size()<<" "<<s1[199998]<<" "<<s1[199999]<<" "<<s1[199999+1]<<endl;
  cout<<s1;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long int lld;
typedef vector<lld> vi;
typedef pair<lld,lld> pi;
#define F first
#define S second
#define N 1000009
#define MOD 1000000007
#define PB push_back
#define MP make_pair
#define rep(i,a,b) for (lld i = a; i < b; i++)
static lld r,j,l,x,y,b,m,n,s,q,i,z,p,k,c,d,t;string s1,s2,s3,s4,st1,st2;
lld a[N];
int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(0);cout.tie(0);
  cin>>s1;n=s1.size();
  rep(i,1,n)
  {
    if(s1[i]==s1[i-1])
    {
      if(i+1<n)
      {
        if(s1[i]==s1[i+1])
        {
          if(s1[i]=='a')s1[i]='z';
          else s1[i]='a';
        }
        else if(s1[i-1]=='a')
        {
          if(s1[i+1]=='b')s1[i]='c';
          else s1[i]='b';
        }
        else if(s1[i+1]=='a')
        {
          if(s1[i]=='b')s1[i]='c';
          else s1[i]='b';
        }
        else s1[i]='a';
      }
      else
      {
        if(s1[i]=='a')s1[i]='b';
        else s1[i]='b';
      }
    }
  }
  if(s1[0]=='f')
    cout<<s1.size()<<" "<<s1[199998]<<" "<<s1[199999]<<" "<<s1[199999+1]<<endl;
  cout<<s1;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long int lld;
typedef vector<lld> vi;
typedef pair<lld,lld> pi;
#define F first
#define S second
#define N 1000009
#define MOD 1000000007
#define PB push_back
#define MP make_pair
#define rep(i,a,b) for (lld i = a; i < b; i++)
static lld r,j,l,x,y,b,m,n,s,q,i,z,p,k,c,d,t;string s1,s2,s3,s4,st1,st2;
lld a[N];
int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(0);cout.tie(0);
  cin>>s1;n=s1.size();
  rep(i,1,n)
  {
    if(s1[i]==s1[i-1])
    {
      if(i+1<n)
      {
        if(s1[i]==s1[i+1])
        {
          if(s1[i]=='a')s1[i]='z';
          else s1[i]='a';
        }
        else if(s1[i-1]=='a')
        {
          if(s1[i+1]=='b')s1[i]='c';
          else s1[i]='b';
        }
        else if(s1[i+1]=='a')
        {
          if(s1[i]=='b')s1[i]='c';
          else s1[i]='b';
        }
        else s1[i]='a';
      }
      else
      {
        if(s1[i]=='a')s1[i]='b';
        else s1[i]='b';
      }
    }
  }
  cout<<s1;
}


#include <bits/stdc++.h>
#include<string>
using namespace std;
typedef long long int ll;

int main() {
    string name;
    getline(cin,name);
    ll len = strlen(&name[0]);

    for(ll i=0; i<len; i++){
        if(name[i]==name[i+1]){
          int k = name[i]+11;
          k=k%26;
          char c = name[i+1]+ k;
          name[i+1] = c;
          if(name[i+1]==name[i+2]){
              int k = name[i]+11;
              k=k%26;
              char c = name[i+1]+ k;
              name[i+1] = c;
          }
        }
    }
cout<<name;
return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
void change(string strn, ll i){

}

int main() {
    string strn;
    getline(cin,strn);
    ll len = strlen(&strn[0]);

    for(ll i=0; i<len; i++){
        if(strn[i]==strn[i+1]){
            if(strn[i+1]!='z'){
                char c = strn[i+1] + 1;
                strn[i+1] = c;
            }
            else if(strn[i+1]=='z'){
                char c = strn[i+1]-2;
                strn[i+1] = c;
            }
            if(strn[i+1]==strn[i+2]){
                if(strn[i+1]!='z'){
                   char c = strn[i+1] + 1;
                   strn[i+1] = c;
                }
                else if(strn[i+1]=='z'){
                   char c = strn[i+1]-2;
                   strn[i+1] = c;
                }
            }
        }
    }
    cout<<strn;

	return 0;
}


#include <bits/stdc++.h>
#include<string>
using namespace std;
typedef long long int ll;

int main() {
    string name;
    getline(cin,name);
    ll len = strlen(&name[0]);

    for(ll i=0; i<len; i++){
        if(name[i]==name[i+1]){
          int k = 11;
          if(k>=('z'-name[i]))k=k*(-1);
          char c = name[i+1]+ k;
          name[i+1] = c;

          if(name[i+1]==name[i+2]){
              int k = 11;
              if(k>=('z'-name[i]))k=k*(-1);
              char c = name[i+1]+ k;
              name[i+1] = c;
          }
        }
    }
cout<<name;
return 0;
}


#include <bits/stdc++.h>
#include<string>
using namespace std;
typedef long long int ll;

int main() {
    string name;
    getline(cin,name);
    ll len = strlen(&name[0]);

    for(ll i=0; i<len; i++){
        if(name[i]==name[i+1]){
          int k = 11;
          if(k>=('z'-name[i]))k=k*(-1);
          char c = name[i+1]+ k;
          name[i+1] = c;

          if(name[i+1]==name[i+2]){
              int k = 3;
              if(k>=('z'-name[i]))k=k*(-1);
              char c = name[i+1]+ k;
              name[i+1] = c;
          }
        }
    }
cout<<name;
return 0;
}


#include <bits/stdc++.h>
#include<string>
using namespace std;
typedef long long int ll;

int main() {
    string name;
    getline(cin,name);
    ll len = strlen(&name[0]);

    for(ll i=0; i<len; i++){
        if(name[i]==name[i+1]){
          int k = name[i]+11- 'a';
          k=k%26;
          char c = name[i+1]+ k;
          name[i+1] = c;
          if(name[i+1]==name[i+2]){
              int k = name[i]+11-'a';
              k=k%26;
              char c = name[i+1]+ k;
              name[i+1] = c;
          }
        }
    }
cout<<name;
return 0;
}


#include "bits/stdc++.h"
using namespace std;
using ll=long long;
int main()
{
    ll z=0;
    string s;
    cin>>s;
    ll hash[26]={0};
    std::vector<ll> v;
    for(ll i=0;i<s.size();i++)
    {
        hash[s[i]-97]++;
    }
    char c=s[0];
    for(ll i=0;i<26;i++)
    {
        if(!hash[i])
        {
            c=i+97;
        // cout<<c;
        }
    }
    for(ll i=0;i<s.size()-1;i++)
    {
        if(s[i]==s[i+1])
        {
            z++;
            s[i+1]=c;
        }
    }
    cout<<s/*<<z*/;
}


#include "bits/stdc++.h"
using namespace std;
using ll=long long;
int main()
{
    ll z=0;
    string s;
    cin>>s;
    if(s.size()>580)
    cout<<s.size();
    ll hash[26]={0};
    std::vector<ll> v;
    for(ll i=0;i<s.size();i++)
    {
        hash[s[i]-97]++;
    }
    char c=s[0];
    for(ll i=0;i<26;i++)
    {
        if(!hash[i])
        {
            c=i+97;
        // cout<<c;
        }
    }
    for(ll i=0;i<s.size()-1;i++)
    {
        if(s[i]==s[i+1])
        {
            z++;
            s[i+1]=c;
        }
    }
    cout<<s/*<<z*/;
}


#include "bits/stdc++.h"
using namespace std;
using ll=long long;
int main()
{
    ll z=0;
    string s;
    cin>>s;
    // cout<<s.size();
    ll hash[26]={0};
    std::vector<ll> v;
    for(ll i=0;i<s.size();i++)
    {
        hash[s[i]-97]++;
    }
    char c;
    ll min=INT_MAX;
    ll mini=INT_MAX;
    for(ll i=0;i<26;i++)
    {
        if(hash[i]<min)
        {
            min=hash[i];
            mini=i;
        }
        // cout<<c;
    }
    c=mini+'a';
    for(ll i=0;i<s.size()-1;i++)
    {
        if(s[i]==s[i+1])
        {
            z++;
            s[i+1]=c;
            if(s[i+1]==s[i] and s[1]!=c)
                s[i+1]=s[1];
            else if(s[i+1]==s[i] and s[1]==c)
                s[i+1]=s[0];
        }
    }
    cout<<s/*<<z*/;
    // cout<<int('`');
}


#include "bits/stdc++.h"
using namespace std;
using ll=long long;
int main()
{
    ll z=0;
    string s;
    cin>>s;
    // cout<<s.size();
    ll hash[26]={0};
    std::vector<ll> v;
    for(ll i=0;i<s.size();i++)
    {
        hash[s[i]-97]++;
    }
    char c=s[0];
    for(ll i=0;i<26;i++)
    {
        if(!hash[i])
        {
            c=i+97;
            // cout<<c;
        }
    }
    for(ll i=0;i<s.size()-1;i++)
    {
        if(s[i]==s[i+1])
        {
            z++;
            s[i+1]=c;
            {
                if(s[i+1]==s[i])
                s[i+1]=s[1];
            }
        }
    }
    cout<<s/*<<z*/;
}


#include "bits/stdc++.h"
using namespace std;
using ll=long long;
int main()
{
    ll z=0;
    string s;
    cin>>s;
    ll hash[26]={0};
    std::vector<ll> v;
    for(ll i=0;i<s.size();i++)
    {
        hash[s[i]-97]++;
    }
    char c='\0';
    for(ll i=0;i<26;i++)
    {
        if(!hash[i])
        c=i+97;
    }
    for(ll i=1;i<s.size()-1;i++)
    {
        if(s[i]==s[i+1])
        {
            z++;
            s[i+1]=c;
        }
    }
    cout<<s/*<<z*/;
}


#include "bits/stdc++.h"
using namespace std;
using ll=long long;
int main()
{
    ll z=0;
    string s;
    cin>>s;
    if(s.size()>580 and s.size()<1200)
    cout<<s.size();
    ll hash[26]={0};
    std::vector<ll> v;
    for(ll i=0;i<s.size();i++)
    {
        hash[s[i]-97]++;
    }
    char c=s[0];
    for(ll i=0;i<26;i++)
    {
        if(!hash[i])
        {
            c=i+97;
        // cout<<c;
        }
    }
    for(ll i=0;i<s.size()-1;i++)
    {
        if(s[i]==s[i+1])
        {
            z++;
            s[i+1]=c;
        }
    }
    cout<<s/*<<z*/;
}


#include "bits/stdc++.h"
using namespace std;
using ll=long long;
int main()
{
    string s;
    cin >> s;
    int n = s.size();
    for (int i = 1; i < n; ++i) {
        if (s[i] == s[i - 1]) {
            for (char c = 'a'; c <= 'z'; ++c) {
                if (c != s[i - 1] && (i + 1 == n || c != s[i + 1])) {
                    s[i] = c;
                    break;
                }
            }
        }
    }
    cout << s;
}


#include "bits/stdc++.h"
using namespace std;
using ll=long long;
int main()
{
    ll z=0;
    string s;
    cin>>s;
    ll hash[26]={0};
    std::vector<ll> v;
    for(ll i=0;i<s.size();i++)
    {
        hash[s[i]-97]++;
    }
    char c='\0';
    for(ll i=0;i<26;i++)
    {
        if(!hash[i])
        c=i+97;
    }
    for(ll i=0;i<s.size()-1;i++)
    {
        if(s[i]==s[i+1])
        {
            z++;
            s[i+1]=c;
        }
    }
    cout<<s/*<<z*/;
}


#include "bits/stdc++.h"
using namespace std;
using ll=long long;
int main()
{
    ll z=0;
    string s;
    cin>>s;
    if(s[0]==s[1])
    s[0]='z';
    for(ll i=1;i<s.size()-1;i++)
    {
        if(s[i]==s[i+1])
            s[i+1]=s[i-1];
    }
    cout<<s;
}


#include <iostream>
using namespace std;

const int MAXN = 5010;
int m;
int ns;
long sums[MAXN];
int vals[MAXN];
long dp[MAXN][MAXN];

long getmax(int l, int k)
{
    if (dp[l][k] != -1)
    {
        return dp[l][k];
    }

    long max = INT_MIN;
    for (int p = l; p < ns - (k - 1) * m + 1; ++p)
    {
        long cur = sums[p] + (k == 1 ? 0 : getmax(p + m, k - 1));
        if (cur > max)
        {
            max = cur;
        }
    }
    dp[l][k] = max;
    return max;
}

int main()
{
    int n, k;
    cin >> n >> m >> k;

    for (int i = 0; i < n; ++i)
    {
        cin >> vals[i];
    }

    long sum = 0;
    for (int i = 0; i < m; ++i)
    {
        sum += vals[i];
    }

    ns = n - m;
    sums[0] = sum;
    for (int i = 0; i < ns; ++i)
    {
        sum -= vals[i];
        sum += vals[i + m];
        sums[i + 1] = sum;
    }

    for (int i = 0; i < MAXN; ++i)
    {
        for (int j = 0; j < MAXN; ++j)
        {
            dp[i][j] = -1;
        }
    }

    long ans = getmax(0, k);

    cout << ans;
}


//http://codeforces.com/problemset/problem/467/C

#include <iostream>
#include <string>
#include <cmath>
#include <vector>
#include <algorithm>
#include <iterator>
#include <cstdlib>
#include <cstdio>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <list>

using namespace std;

#define pii pair <int, int>
#define vvi vector <int>
#define ll long long

int size_n, size_m, size_k;
ll result = 0;
vector <ll> sum(0);

int main()
{
	int ii, jj;
	ll tmpInput, mx, mxPos, mnLimit;

	cin >> size_n >> size_m >> size_k;

	sum.resize(size_n + 1);

	for (ii = 1; ii <= size_n; ii++)
	{
		cin >> tmpInput;

		sum[ii] = tmpInput + sum[ii - 1];
	}

	size_m--;
	size_k--;

	for (ii = size_n; size_k > -1; ii--, size_k--)
	{
		mnLimit = size_k * (size_m + 1);

		for (jj = (ii - size_m), mx = 0; jj > mnLimit; jj--)
		{
			if (mx < (sum[jj + size_m] - sum[jj - 1]))
			{
				mx = sum[jj + size_m] - sum[jj - 1];
				mxPos = jj;
			}
		}

		result += mx;
		ii = mxPos;
	}

	cout << result << endl;

	return 0;
}


//http://codeforces.com/problemset/problem/467/C

#include <iostream>
#include <string>
#include <cmath>
#include <vector>
#include <algorithm>
#include <iterator>
#include <cstdlib>
#include <cstdio>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <list>

using namespace std;

#define pii pair <int, int>
#define vvi vector <int>
#define ll long long

int size_n, size_m, size_k;
vector <ll> sum(0);
ll dp[5006][5006];

int main()
{
	int ii, jj;
	ll tmpInput, mx, mxPos, mnLimit;

	cin >> size_n >> size_m >> size_k;

	sum.resize(size_n + 1);

	for (ii = 1; ii <= size_n; ii++)
	{
		cin >> tmpInput;

		sum[ii] = tmpInput + sum[ii - 1];
	}

	for (ii = 1; ii <= size_k; ii++)
	{
		for (jj = 1; jj <= size_n; jj++)
		{
			if (jj < (size_m * ii))
				dp[ii][jj] = 0;
			else
				dp[ii][jj] = max(dp[ii][jj - 1], (dp[ii - 1][jj - size_m] + sum[jj] - sum[jj - size_m]));
		}
	}

	cout << dp[size_k][size_n] << endl;

	return 0;
}


#include <iostream>
#include <algorithm>
using namespace std;
const int inf = 5009;
int num[inf];
long long dp[2][inf][2];
int main()
{
    int n, k, m;
    cin >> n >> m >> k;
    for (int i = 0; i < n; ++i)
        cin >> num[i];
    long long best;
    int f, s;
    for (int i = 1; i <= k; ++i)
    {
        best = 0;
        f = i % 2, s = (i + 1) % 2;
        for (int j = 0; j < n; ++j)
        {
            dp[f][j][0] = best + (long long)num[j];

            dp[f][j][1] = ((j >= (m - 1)) ? dp[f][j - m + 1][0] + (m>1 ? num[j] : 0) : 0);
            best = max(best, dp[s][j][1]);
        }
    }
    best = 0;
    k %= 2;
    for (int i = 0; i < n; ++i)
        best = max(best, dp[k][i][1]);
    cout << best << "\n";
    return 0;
}


#include <iostream>
#include <algorithm>
using namespace std;
const int inf = 5009;
long long num[inf];
long long dp[2][inf][2];
int main()
{
    int n, k, m;
    cin >> n >> m >> k;
    for (int i = 1; i <= n; ++i)
    {
        cin >> num[i];
        num[i] += num[i - 1];
    }
    long long best;
    int f, s;
    for (int i = 1; i <= k; ++i)
    {
        best = 0;
        f = i % 2, s = (i + 1) % 2;
        for (int j = 1; j <= n; ++j)
        {
            dp[f][j][0] = best;
            dp[f][j][1] = (j - m >= 0 ? dp[f][j - m + 1][0] + num[j] - num[j - m] : 0);
            best = max(best, dp[s][j][1]);
        }
    }
    best = 0;
    k %= 2;
    for (int i = 1; i <= n; ++i)
        best = max(best, dp[k][i][1]);
    cout << best << "\n";
    return 0;
}


#include <iostream>
#include <algorithm>
using namespace std;
#define MAX_N (5000)

long long a[MAX_N + 1], ans[MAX_N + 1][MAX_N + 1];
long long sum[MAX_N + 1];

int main()
{
	long N, M, K;
	cin >> N >> M >> K;

	for (int i = 1; i <= N; i++) {
		cin >> a[i];
		sum[i] = sum[i - 1] + a[i];
	}

	for (int i = M; i <= N; i++) {
		for (int j = 1; j <= K; j++) {
			ans[i][j] = max(ans[i - 1][j], ans[i - M][j - 1] + sum[i] - sum[i - M]);
		}
	}

	cout << ans[N][K];
	return 0;
}


// opt_solution
#include <iostream>
#include <algorithm>
using namespace std;
#define MAX_N (5000)

long long a, ans[MAX_N][MAX_N + 1];
long long psum[MAX_N];

int main()
{
	long N, M, K;
	cin >> N >> M >> K;

    cin >> psum[0];
	for (int i = 1; i < N; i++) {
		cin >> a;
		psum[i] = psum[i - 1] + a;
	}

	ans[M - 1][1] = psum[M - 1];
	for (int i = M; i < N; i++) {
		for (int k = 1; k <= K; k++) {
			ans[i][k] = max(ans[i - 1][k], ans[i - M][k - 1] + psum[i] - psum[i - M]);
		}
	}

	cout << ans[N-1][K];
	return 0;
}


// opt_solution
#include <iostream>
#include <algorithm>
using namespace std;
#define MAX_N (5000)

long long a, ans[MAX_N][MAX_N + 1];
long long psum[MAX_N];

int main()
{
	long N, M, K;
	cin >> N >> M >> K;

    cin >> psum[0];
	for (int i = 1; i <= N; i++) {
		cin >> a;
		psum[i] = psum[i - 1] + a;
	}

	ans[M - 1][1] = psum[M - 1];
	for (int i = M; i < N; i++) {
		for (int k = 0; k < K; k++) {
			ans[i][k] = max(ans[i - 1][k], ans[i - M][k - 1] + psum[i] - psum[i - M]);
		}
	}

	cout << ans[N-1][K-1];
	return 0;
}


#include <stdio.h>

typedef struct _SUM {
	int i;
	int sum; // sum of [start index 0 ~ k-1]
} MYSUM;
void myqsort(MYSUM a[], int lo, int hi) {
	int i = lo, j = hi;
	int p = a[(lo + hi) / 2].sum;
	do {
		while (a[i].sum < p) i++;
		while (a[j].sum > p) j--;
		if (i <= j) {
			MYSUM h = a[i]; a[i] = a[j]; a[j] = h;
			i++; j--;
		}
	} while (i <= j);
	if (lo < j) myqsort(a, lo, j);
	if (hi > i) myqsort(a, i, hi);
}

int main()
{
#if defined __TEST
	int T;
	scanf("%d", &T);
	for (int _kk = 0; _kk < T; _kk++) {
#endif
#define MAX_N (5000)
	int P[MAX_N];
	int N, M, K;
	scanf("%d %d %d", &N, &M, &K);
	for (int i = 0; i < N; i++) {
		scanf("%d", &P[i]);
	}
	int ans = 0;
	// width : M - 1

	// 1st approach: sum & sort & get max considering width.
	MYSUM sum[MAX_N];
	for (int i = 0; i < N - M + 1; i++) {
		sum[i].i = i;
		sum[i].sum = 0;
		for (int k = 0; k < M; k++) {
			sum[i].sum += P[i + k]; // <== need opt
		}
	}

	// sort
	myqsort(sum, 0, N - M);
	int count = 0;
	int Selected[MAX_N] = { 0, };
	for (int i = N - M; i >= 0; i--) {
		// check
		int k;
		for (k = sum[i].i; k < sum[i].i + M; k++) {
			if (Selected[k])
				break;
		}
		// if not selected
		if (k == sum[i].i + M) {
			ans += sum[i].sum;
			count++;
			if (count == K)
				break;
			for (int k = sum[i].i; k < sum[i].i + M; k++) {
				Selected[k] = 1; // checked
			}
		}
	}

	printf("%d", ans);
#if defined __TEST
    }
#endif
    return 0;
}


// opt_solution
#include <iostream>
#include <algorithm>
using namespace std;
#define MAX_N (5000)

long long a, ans[MAX_N][MAX_N + 1];
long long psum[MAX_N];

int main()
{
	long N, M, K;
	cin >> N >> M >> K;

    cin >> psum[0];
	for (int i = 1; i <= N; i++) {
		cin >> a;
		psum[i] = psum[i - 1] + a;
	}

	ans[M - 1][1] = psum[M - 1];
	for (int i = M; i < N; i++) {
		for (int k = 1; k <= K; k++) {
			ans[i][k] = max(ans[i - 1][k], ans[i - M][k - 1] + psum[i] - psum[i - M]);
		}
	}

	cout << ans[N-1][K];
	return 0;
}


#include<iostream>
#include<algorithm>
#include<functional>
using namespace std;

long s[5005],a[5005],ans[5005];
int main()
{
	int n, m, k;
	cin >> n >> m >> k;
	for (int i = 1; i <= n; i++)
	{
		cin >> a[i];
		if (i == 1)
		{
			s[i] = a[i];
		}
		else
		{
			s[i] = s[i - 1] + a[i];
		}
	}
	ans[1] = s[m];
	for (int i = 1; i <= n - m; i++)
	{
		ans[i+1] = s[i + m] - s[i];
	}
	sort(ans + 1, ans + n - m + 2,greater<long>());
	long f = 0;
	for (int i = 1; i <= k; i++)
	{
		f += ans[i];
	}
	cout << f;
	return 0;
}


#include<iostream>
#include<algorithm>
#include<functional>
using namespace std;

long s[5005],dp[5005][5005];
int main()
{
	int n, m, k;
	cin >> n >> m >> k;
	for (int i = 1; i <= n; i++)
	{
		cin >> s[i];
		s[i] += s[i - 1];
	}
	for (int i = 1; i <= k; i++)
	{
		for (int j = m; j <= n; j++)
		{
			dp[i][j] = max(dp[i][j - 1], dp[i - 1][j - m] + s[j] - s[j - m]);
		}
	}
	cout << dp[k][n];
	return 0;
}


#include<iostream>
#include<algorithm>
#include<functional>
using namespace std;

long s[5005],dp[5005][5005];
int main()
{
	int n, m, k;
	cin >> n >> m >> k;
	for (int i = 1; i <= n; i++)
	{
		int temp;
		cin >> temp;
		if (i == 1)
		{
			s[i] = temp;
		}
		else
		{
			s[i] = s[i - 1] + temp;
		}
	}
	for (int i = 1; i <= k; i++)
	{
		for (int j = m; j <= n; j++)
		{
			dp[i][j] = max(dp[i][j - 1], dp[i - 1][j - m] + s[j] - s[j - m]);
		}
	}
	cout << dp[k][n];
	return 0;
}


#pragma warning (disable : 4996)

#include <stdlib.h>
#include <iostream>
#include <vector>
#include <string>
#include <assert.h>
#include <stack>
#include <algorithm>
#include <ios>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <queue>
#include <set>
#include <functional>
#include <cmath>
#include <sstream>
#include <map>
#include <memory.h>
#include <stdio.h>
#include <cassert>
#include <string.h>

#define forn(i , n) for (int i = 0; i < n; ++i)
#define down(i, n) for (int i = n - 1; i >= 0; --i)

using namespace std;

typedef unsigned long long int u64;
typedef long long int i64;
typedef vector<i64> vint;
typedef vector<i64> vi64;
typedef pair<int, int> pint;
typedef pair<i64, i64> pi64;

#define FILE_NAME "file"
#define M_PI 3.14159265358979323846

double sqr(double a)
{
    return a * a;
}

struct Node
{
    vector<int> nbr;
    int used;
    int p1, p2;
    int init, goal;
    Node()
    {
        p1 = p2 = 0;
        used = 0;
    }
};

#define MAXN 300000
#define MODULE 1000000009
int m;
int mpower(int a, int b)

{
    if (b == 0)
        return 1;
    if (b % 2 == 0)
    {
        int c = mpower(a, b / 2) % m;
        return c * c % m;
    }
    else
    {
        return a * mpower(a, b - 1) % m;
    }
}

int check(int a, int p)
{
    if ((mpower(a, p - 1) - 1) % p == 0)
    {
        for (int i = 1; i <= p - 2; ++i)
        {
            int c = mpower(a, i) - 1;
            if (c % p == 0)
            {
                return 0;
            }
        }
        return 1;
    }
    return 0;
}

bool check(vector<vi64> & arr, int r)
{
    forn(i, r)
    {
        forn(j, arr[0].size())
        {
            if (arr[i][j] != arr[2 * r - i - 1][j])
                return false;
        }
    }
    return true;
}

void calc(map<i64, i64> & s, i64 a, i64 d)
{
    if (a == 0)
        return;
    if (s.count(a))
    {
        if (s[a] >= d)
            return;
        s[a] = min(s[a], d);
    }
    else
    {
        s[a] = d;
    }
    if (a % 2 == 0)
    {
        calc(s, a / 2, d + 1);
    }
    if (a % 3 == 0)
    {
        calc(s, a / 3, d + 1);
    }
    if (a % 5 == 0)
    {
        calc(s, a / 5, d + 1);
    }
}

i64 getDigit(i64 a)
{
    i64 ans = 0;
    while (a > 0)
    {
        ans++;
        a /= 10;
    }

    return ans;
}

int main()
{

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout << fixed << setprecision(15);
#ifdef FILE_INPUT
    freopen(FILE_NAME ".in", "r", stdin);
    freopen(FILE_NAME ".out", "w", stdout);
#endif
    int n, m, k;
    cin >> n >> m >> k;
    vi64 arr(n);
    forn(i, n)
    {
        cin >> arr[i];
    }
    vector<vi64> d(n + 1, vi64(k + 1, 0));
    forn(i, n)
    {
        forn(j, k)
        {
            i64 prev = 0;
            if (i)
                prev = d[i - 1][j];
            i64 curr = 0;
            int pos = i - m + 1;
            if (pos >= 0)
            {
                while (pos <= i)
                    curr += arr[pos++];
                if (pos - 1 >= 0 && j)
                    curr += d[pos - 1][j - 1];
            }
            d[i][j] = max(prev, curr);

        }
    }
    cout << d[n - 1][k-1];

    return 0;
}


#pragma warning (disable : 4996)

#include <stdlib.h>
#include <iostream>
#include <vector>
#include <string>
#include <assert.h>
#include <stack>
#include <algorithm>
#include <ios>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <queue>
#include <set>
#include <functional>
#include <cmath>
#include <sstream>
#include <map>
#include <memory.h>
#include <stdio.h>
#include <cassert>
#include <string.h>

#define forn(i , n) for (int i = 0; i < n; ++i)
#define down(i, n) for (int i = n - 1; i >= 0; --i)

using namespace std;

typedef unsigned long long int u64;
typedef long long int i64;
typedef vector<i64> vint;
typedef vector<i64> vi64;
typedef pair<int, int> pint;
typedef pair<i64, i64> pi64;

#define FILE_NAME "file"
#define M_PI 3.14159265358979323846

double sqr(double a)
{
    return a * a;
}

struct Node
{
    vector<int> nbr;
    int used;
    int p1, p2;
    int init, goal;
    Node()
    {
        p1 = p2 = 0;
        used = 0;
    }
};

#define MAXN 300000
#define MODULE 1000000009
int m;
int mpower(int a, int b)

{
    if (b == 0)
        return 1;
    if (b % 2 == 0)
    {
        int c = mpower(a, b / 2) % m;
        return c * c % m;
    }
    else
    {
        return a * mpower(a, b - 1) % m;
    }
}

int check(int a, int p)
{
    if ((mpower(a, p - 1) - 1) % p == 0)
    {
        for (int i = 1; i <= p - 2; ++i)
        {
            int c = mpower(a, i) - 1;
            if (c % p == 0)
            {
                return 0;
            }
        }
        return 1;
    }
    return 0;
}

bool check(vector<vi64> & arr, int r)
{
    forn(i, r)
    {
        forn(j, arr[0].size())
        {
            if (arr[i][j] != arr[2 * r - i - 1][j])
                return false;
        }
    }
    return true;
}

void calc(map<i64, i64> & s, i64 a, i64 d)
{
    if (a == 0)
        return;
    if (s.count(a))
    {
        if (s[a] >= d)
            return;
        s[a] = min(s[a], d);
    }
    else
    {
        s[a] = d;
    }
    if (a % 2 == 0)
    {
        calc(s, a / 2, d + 1);
    }
    if (a % 3 == 0)
    {
        calc(s, a / 3, d + 1);
    }
    if (a % 5 == 0)
    {
        calc(s, a / 5, d + 1);
    }
}

i64 getDigit(i64 a)
{
    i64 ans = 0;
    while (a > 0)
    {
        ans++;
        a /= 10;
    }

    return ans;
}

int main()
{

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout << fixed << setprecision(15);
#ifdef FILE_INPUT
    freopen(FILE_NAME ".in", "r", stdin);
    freopen(FILE_NAME ".out", "w", stdout);
#endif
    int n, m, k;
    cin >> n >> m >> k;
    vi64 arr(n);
    forn(i, n)
    {
        cin >> arr[i];
    }
    vector<vi64> d(n + 1, vi64(k + 1, 0));
    forn(i, n)
    {
        forn(j, k)
        {
            i64 prev = 0;
            if (i)
                prev = d[i - 1][j];
            i64 curr = 0;
            int pos = i - m + 1;
            if (pos >= 0)
            {
                while (pos <= i)
                    curr += arr[pos++];
                pos = i - m + 1;
                if (pos - 1 >= 0 && j)
                    curr += d[pos - 1][j - 1];
            }
            d[i][j] = max(prev, curr);

        }
    }
    cout << d[n - 1][k-1];

    return 0;
}


#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <cmath>
#include <iomanip>
#include <string>

#define ff first
#define ss second
#define ll long long

using namespace std;

ll arr[5001], sum[5001];
ll dp[5001][5001];

const ll inf = (1LL << 60);

int main()
{
    int n, m, k;
    cin >> n >> m >> k;
    for(int i = 1; i <= n; i++)
        cin >> arr[i];
    sum[0] = arr[0];
    for(int i = 1; i <= n; i++)
        sum[i] = sum[i-1] + arr[i];
    for(int i = 0; i <= n; i++)
        for(int j = 1; j <= k; j++)
            dp[i][j] = -inf;
    dp[m][1] = sum[m];
    for(int i = m + 1; i <= n; i++)
        for(int j = 1; j <= k; j++)
            dp[i][j] = max(dp[i-1][j], dp[i-m][j-1] + sum[i] - sum[i-m]);
    /*
    for(int i = 0; i < n; i++)
    {
        for(int j = 0; j < k; j++)
            cout << dp[i+1][j+1] << " ";
        cout << endl;
    }*/
    cout << dp[n][k];
    return 0;
}


#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <cmath>
#include <iomanip>
#include <string>

#define ff first
#define ss second
#define ll long long

using namespace std;

ll arr[5000], sum[5000];
ll dp[5000][5000];

const ll inf = (1LL << 60);

int main()
{
    int n, m, k;
    cin >> n >> m >> k;
    for(int i = 0; i < n; i++)
        cin >> arr[i];
    sum[0] = arr[0];
    for(int i = 1; i < n; i++)
        sum[i] = sum[i-1] + arr[i];
    for(int i = 0; i < 0; i++)
        for(int j = 0; j < 0; j++)
            dp[i][j] = -inf;
    dp[m][1] = sum[m];
    for(int i = 1; i <= n; i++)
        for(int j = 1; j <= k; j++)
            dp[i][j] = max(dp[i-1][j], dp[i-m][j-1] + sum[i] - sum[i-m]);
    /*
    for(int i = 0; i < n; i++)
    {
        for(int j = 0; j < k; j++)
            cout << dp[i+1][j+1] << " ";
        cout << endl;
    }*/
    cout << dp[n][k];
    return 0;
}


#include <iostream>
#include <cstdio>
#include <vector>

using namespace std;

long long a[5001], s[5001], f[5001][5001];

long long Max(long long a, long long b)
{
	if (a > b)
		return a;
	else
		return b;
}

int main()
{
	int m, n, k;
	scanf ("%d%d%d", &n, &m, &k);
	for (int i = 1; i <= n; i++)
		scanf ("%d", &a[i]), s[i] = s[i - 1] + a[i];
	for (int i = 1; i <= k; i++)
		for (int j = m; j <= n; j++)
			f[i][j] = Max(f[i - 1][j - m] + s[j] - s[j - m], f[i][j - 1]);
	cout << f[k][n];
	return 0;
}


#include <iostream>
#include <cstdio>
#include <vector>

using namespace std;

long long f[6000][6000];

long long Max(long long a, long long b)
{
	if (a > b)
		return a;
	else
		return b;
}

int main()
{
	int m, n, k;
	scanf ("%d%d%d", &n, &m, &k);
	int *a = new int [n + 2];
	long long *s = new long long [n + 2];
	s[0] = 0;
	for (int i = 1; i <= n; i++)
		scanf ("%d", &a[i]), s[i] = s[i - 1] + a[i];
	for (int i = 1; i <= k; i++)
		for (int j = m; j <= n; j++)
			f[i][j] = Max(f[i - 1][j - m] + s[j] - s[j - m], f[i][j - 1]);
	cout << f[k][n];
	return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

long long Sum(long long n)
{
	long long res = ((n + 1) * n) / 2;
	return res;
}

long long Min(long long a, long long b)
{
	if (a < b)
		return a;
	return b;
}

int main()
{
	long long n, m, x, y;
	scanf ("%I64d%I64d%I64d%I64d", &n, &m, &x, &y);
	long long c1, c2, c3, c4, c5, c6, c7, c8;
	long long p1x, p1y, p2x, p2y, p3x, p3y, p4x, p4y;
	p1x = x - Min(x - 1, y - 1), p1y = y - Min(x - 1, y - 1);
	p2x = x + Min(y - 1, m - x), p2y = y - Min(y - 1, m - x);
	p3x = x - Min(x - 1, n - y), p3y = y + Min(x - 1, n - y);
	p4x = x + Min(m - x, n - y), p4y = y + Min(m - x, n - y);
	c1 = Sum(x - 2) - Sum(p1x - 2);
	c2 = Sum(x - 2) - Sum(x - p1x - 2);
	cout << c1 << " " << c2;
	return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define MAXN 5000
#define MAXK 5000
#define INF 1000000000

int n, m, k;
int a[MAXN+3];

long long f[MAXN+3][MAXK+3];
long long S[MAXN+3];

long long rec(int l, int k)
{
    if (k == 0) {
        return 0;
    }

    if (l + m - 1 >= n) {
        return -INF;
    }

    if (f[l][k] != -1) {
        return f[l][k];
    }

    long long ret = -INF;

    for (int i = l; i < n; i++) {
        int SS = S[l + m - 1] - S[i] + a[i];
        long long val = SS + rec(i + m, k - 1);
        if (val > ret) {
            ret = val;
        }
    }

    long long val = rec(l + 1, k);
    if (val > ret) {
        ret = val;
    }

    f[l][k] = ret;
    return ret;
}

int main(int argc, char * argv[])
{
#define NAGIBATORS2284
#ifdef NAGIBATORS228
    freopen("inp.txt", "rb", stdin);
#endif

    scanf("%d %d %d", &n, &m, &k);

    for (int i = 0; i < n; i++) {
        scanf("%d", a + i);
    }

    S[0] = a[0];
    for (int i = 1; i < n; i++) {
        S[i] = a[i] + S[i - 1];
    }

    memset(f, 0xFF, sizeof(f));
    int ans = rec(0, k);
    printf("%d\n", ans);

    return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define MAXN 5000
#define MAXK 5000
#define INF 1000000000

int n, m, k;
int a[MAXN+3];

long long f[MAXN+3][MAXK+3];

long long rec(int l, int k)
{
    if (k == 0) {
        return 0;
    }

    if (l + m - 1 >= n) {
        return -INF;
    }

    if (f[l][k] != -1) {
        return f[l][k];
    }

    long long ret = -INF;

    for (int i = l; i < n; i++) {
        long long S = 0;
        for (int j = 0; j < m; j++) {
            S += a[j + l];
        }
        long long val = S + rec(i + m, k - 1);
        if (val > ret) {
            ret = val;
        }
    }

    long long val = rec(l + 1, k);
    if (val > ret) {
        ret = val;
    }

    f[l][k] = ret;
    return ret;
}

int main(int argc, char * argv[])
{
#define NAGIBATORS2284
#ifdef NAGIBATORS228
    freopen("inp.txt", "rb", stdin);
#endif

    scanf("%d %d %d", &n, &m, &k);

    for (int i = 0; i < n; i++) {
        scanf("%d", a + i);
    }

    memset(f, 0xFF, sizeof(f));
    int ans = rec(0, k);
    printf("%d\n", ans);

    return 0;
}


#include <stdio.h>
#include <memory.h>

int n,m,k;
long long sum[5005];
long long dp[5001][5001];

long long max(long long a, long long b) {
    if(a>b)
        return a;
    return b;
}

long long rec(int i, int cnt) {
    //printf("%d %d\n",i,cnt);

    if(i<m || i < 0 || cnt == 0)
        return 0;

    if(dp[i][cnt] != -1)
        return dp[i][cnt];

    dp[i][cnt] = max(rec(i-1,cnt), rec(i-m,cnt-1)+sum[i]-(i-m>=0?sum[i-m]:0));
    return dp[i][cnt];
}

int main()
{
    scanf("%d%d%d",&n,&m,&k);
    memset(dp,0xFF,sizeof(dp));
    for(int i=0;i<n;++i) {
        scanf("%I64d",&sum[i]);
        sum[i]+=(i?sum[i-1]:0);
    }
    printf("%I64d\n",rec(n-1,k));
    return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define MAXN 5000
#define MAXK 5000
#define INF 1000000000

int n, m, k;
int a[MAXN+3];

long long f[MAXN+3][MAXK+3];
long long S[MAXN+3];

long long rec(int l, int k)
{
    if (k == 0) {
        return 0;
    }

    if (l + m - 1 >= n) {
        return -INF;
    }

    if (f[l][k] != -1) {
        return f[l][k];
    }

    long long ret = -INF;

    for (int i = l; i < n; i++) {
        long long SS = S[l + m - 1] - S[i] + a[i];
        long long val = SS + rec(i + m, k - 1);
        if (val > ret) {
            ret = val;
        }
    }

    long long val = rec(l + 1, k);
    if (val > ret) {
        ret = val;
    }

    f[l][k] = ret;
    return ret;
}

int main(int argc, char * argv[])
{
#define NAGIBATORS2284
#ifdef NAGIBATORS228
    freopen("inp.txt", "rb", stdin);
#endif

    scanf("%d %d %d", &n, &m, &k);

    for (int i = 0; i < n; i++) {
        scanf("%d", a + i);
    }

    S[0] = a[0];
    for (int i = 1; i < n; i++) {
        S[i] = a[i] + S[i - 1];
    }

    memset(f, 0xFF, sizeof(f));
    long long ans = rec(0, k);
    printf("%I64d\n", ans);

    return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define MAXN 5000
#define MAXK 5000
#define INF 1000000000

int n, m, k;
int a[MAXN+3];

long long f[MAXN+3][MAXK+3];
long long S[MAXN+3];

long long rec(int l, int k)
{
    if (k == 0) {
        return 0;
    }

    if (l + m - 1 >= n) {
        return -INF;
    }

    if (f[l][k] != -1) {
        return f[l][k];
    }

    long long ret = -INF;
    long long val = -INF;

    long long SS = S[l + m - 1] - S[l] + a[l];
    val = SS + rec(l + m, k - 1);
    if (val > ret) {
        ret = val;
    }

    val = rec(l + 1, k);
    if (val > ret) {
        ret = val;
    }

    f[l][k] = ret;
    return ret;
}

int main(int argc, char * argv[])
{
#define NAGIBATORS2284
#ifdef NAGIBATORS228
    freopen("inp.txt", "rb", stdin);
#endif

    scanf("%d %d %d", &n, &m, &k);

    for (int i = 0; i < n; i++) {
        scanf("%d", a + i);
    }

    S[0] = a[0];
    for (int i = 1; i < n; i++) {
        S[i] = a[i] + S[i - 1];
    }

    memset(f, 0xFF, sizeof(f));
    long long ans = rec(0, k);
    printf("%I64d\n", ans);

    return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define MAXN 5000
#define MAXK 5000
#define INF 1000000000

int n, m, k;
int a[MAXN+3];

long long f[MAXN+3][MAXK+3];
long long S[MAXN+3];

long long rec(int l, int k)
{
    if (k == 0) {
        return 0;
    }

    if (l + m - 1 >= n) {
        return -INF;
    }

    if (f[l][k] != -1) {
        return f[l][k];
    }

    long long ret = -INF;

    for (int i = l; i < n; i++) {
        long long SS = S[l + m - 1] - S[i] + a[i];
        long long val = SS + rec(i + m, k - 1);
        if (val > ret) {
            ret = val;
        }
    }

    long long val = rec(l + 1, k);
    if (val > ret) {
        ret = val;
    }

    f[l][k] = ret;
    return ret;
}

int main(int argc, char * argv[])
{
#define NAGIBATORS2284
#ifdef NAGIBATORS228
    freopen("inp.txt", "rb", stdin);
#endif

    scanf("%d %d %d", &n, &m, &k);

    for (int i = 0; i < n; i++) {
        scanf("%d", a + i);
    }

    S[0] = a[0];
    for (int i = 1; i < n; i++) {
        S[i] = a[i] + S[i - 1];
    }

    //memset(f, 0xFF, sizeof(f));
    //long long ans = rec(0, k);
    // base
    for (int i = 0; i < n; i++) {
        f[i][0] = 0;
    }

    for (int l = n - 1; l >= 0; l--) {
        for (int j = 1; j <= k; j++) {
            long long ret = -INF;
            long long val = -INF;

            for (int i = l; i < n; i++) {
                if (i + m + m - 1 >= n) {
                    break;
                }
                long long SS = S[l + m - 1] - S[i] + a[i];
                val = SS + f[i + m][j - 1];
                if (val > ret) {
                    ret = val;
                }
            }

            if (l + m < n) {
                val = f[l + 1][j];
                if (val > ret) {
                    ret = val;
                }
            }

            f[l][j] = ret;
        }
    }
    printf("%I64d\n", f[0][k]);

    return 0;
}


#include <stdio.h>
#include <memory.h>

int n,m,k;
long long sum[5005];
long long dp[5001][5001];

long long max(long long a, long long b) {
    if(a>b)
        return a;
    return b;
}

long long rec(int i, int cnt) {
    //printf("%d %d\n",i,cnt);

    if(i<m-1 || i < 0 || cnt == 0)
        return 0;

    if(dp[i][cnt] != -1)
        return dp[i][cnt];

    dp[i][cnt] = max(rec(i-1,cnt), rec(i-m,cnt-1)+sum[i]-(i-m>=0?sum[i-m]:0));
    return dp[i][cnt];
}

int main()
{
    scanf("%d%d%d",&n,&m,&k);
    memset(dp,0xFF,sizeof(dp));
    for(int i=0;i<n;++i) {
        scanf("%I64d",&sum[i]);
        sum[i]+=(i?sum[i-1]:0);
    }
    printf("%I64d\n",rec(n-1,k));
    return 0;
}


#pragma comment(linker, "/STACK:36777216")
#include <iostream>
#include <math.h>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <map>
#include <set>
#include <queue>

typedef long long ll;

using namespace std;
inline ll MAX(ll a, ll b) { return (a > b) ? (a) : (b); }
inline int MIN(int a, int b) { return (a < b) ? (a) : (b); }

#define rep(i,a,b) for(i=a; i<=b; i++)
#define brep(i,b,a) for(i=b; i>=a; i--)
#define sd second
#define ft first
#define mp make_pair
//stack<pair<int, int> > s;

int main()
{
	int const sz = 5e3;
	int i, j, a[sz+1], b, n, t,m,k,s;
	ll mod = 1e9 + 7;

	ll f[sz + 1][sz+1];
	cin >> n >> m >> k;

	rep(i, 1, n) scanf_s("%d", &a[i]);
	rep(i, 0, n) rep(j, 0, k)  f[i][j] = 0;

	ll sum[sz + 1]; sum[0] = 0;
	rep(i, 1, n) sum[i] = sum[i - 1] + a[i];
	ll ans = 0;

	if (k == 1)
	{
		rep(i, m, n) ans = MAX(ans, sum[i] - sum[i - m]);
		cout << ans;
		return 0;
	}

	rep(j,1,k)
		rep(i,2*m,n)
			rep(s,(j-1)*m,i-m)
			{
				if(s>=m)f[i][j] = MAX(f[s][j - 1]+sum[i]-sum[i-m],f[i][j]);
			}

	rep(i, 0, n) ans = MAX(ans, f[i][k]);

	cout << ans;

	return 0;
}


#pragma comment(linker, "/STACK:36777216")
#include <iostream>
#include <math.h>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <map>
#include <set>
#include <queue>

typedef long long ll;

using namespace std;
inline ll MAX(ll a, ll b) { return (a > b) ? (a) : (b); }
inline int MIN(int a, int b) { return (a < b) ? (a) : (b); }

#define rep(i,a,b) for(i=a; i<=b; i++)
#define brep(i,b,a) for(i=b; i>=a; i--)
#define sd second
#define ft first
#define mp make_pair
//stack<pair<int, int> > s;

int main()
{
	int const sz = 5e3;
	int i, j, a[sz+1], b, n, t,m,k,s;
	ll mod = 1e9 + 7;

	ll f[sz + 1][sz+1];
	cin >> n >> m >> k;

	rep(i, 1, n) scanf_s("%d", &a[i]);
	rep(i, 0, n) rep(j, 0, k)  f[i][j] = 0;

	ll sum[sz + 1]; sum[0] = 0;
	rep(i, 1, n) sum[i] = sum[i - 1] + a[i];
	ll ans = 0;

	rep(i, m, n) f[i][1] = MAX(f[i][1], sum[i] - sum[i - m]);

	rep(j,2,k)
		rep(i,j*m,n)
			rep(s,(j-1)*m,i-m)
			{
				f[i][j] = MAX(f[s][j - 1]+sum[i]-sum[i-m],f[i][j]);
			}

	rep(i, 0, n) ans = MAX(ans, f[i][k]);

	cout << ans;

	return 0;
}


#pragma comment(linker, "/STACK:36777216")
#include <iostream>
#include <math.h>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <map>
#include <set>
#include <queue>

typedef long long ll;

using namespace std;
inline ll MAX(ll a, ll b) { return (a > b) ? (a) : (b); }
inline int MIN(int a, int b) { return (a < b) ? (a) : (b); }

#define rep(i,a,b) for(i=a; i<=b; i++)
#define brep(i,b,a) for(i=b; i>=a; i--)
#define sd second
#define ft first
#define mp make_pair
//stack<pair<int, int> > s;

int main()
{
	int const sz = 5e3;
	int i, j, a[sz+1], b, n, t,m,k,s;
	ll mod = 1e9 + 7;

	ll f[sz + 1][sz+1];
	cin >> n >> m >> k;

	rep(i, 1, n) scanf_s("%d", &a[i]);
	rep(i, 0, n) rep(j, 0, k)  f[i][j] = 0;

	ll sum[sz + 1]; sum[0] = 0;
	rep(i, 1, n) sum[i] = sum[i - 1] + a[i];

	rep(j,1,k)
		rep(i,2*m,n)
			rep(s,(j-1)*m,i-m)
			{
				if(s>=m)f[i][j] = MAX(f[s][j - 1]+sum[i]-sum[i-m],f[i][j]);
			}

	ll ans=0;

	rep(i, 0, n) ans = MAX(ans, f[i][k]);

	cout << ans;

	return 0;
}


#pragma comment(linker, "/STACK:36777216")
#include <iostream>
#include <math.h>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <map>
#include <set>
#include <queue>

typedef long long ll;

using namespace std;
inline ll MAX(ll a, ll b) { return (a > b) ? (a) : (b); }
inline int MIN(int a, int b) { return (a < b) ? (a) : (b); }

#define rep(i,a,b) for(i=a; i<=b; i++)
#define brep(i,b,a) for(i=b; i>=a; i--)
#define sd second
#define ft first
#define mp make_pair
//stack<pair<int, int> > s;

int main()
{
	int const sz = 5e3;
	int i, j, a[sz+1], b, n, t,m,k,s;
	ll mod = 1e9 + 7;

	ll f[sz + 1][sz+1];
	cin >> n >> m >> k;

	rep(i, 1, n) scanf_s("%d", &a[i]);
	rep(i, 0, n) rep(j, 0, k)  f[i][j] = 0;

	ll sum[sz + 1]; sum[0] = 0;
	rep(i, 1, n) sum[i] = sum[i - 1] + a[i];
	ll ans = 0;

	rep(j,1,k)
		rep(i,j*m,n)
			f[i][j] = MAX(f[i-m][j - 1]+sum[i]-sum[i-m],f[i-1][j]);

	cout << f[n][k];

	return 0;
}


#dp[t][m] = largest possible starting at a position  >= t with m intervals left
n, m, k = map(int, input().split(' '))
#m = length of interval
#k = # of intervals
array = list(map(int, input().split(' ')))
dp = [[0]*5050 for a in range(5050)]
prefsums = [array[0]]
if (n==k):
    ans=0
    for g in array:
        ans+=g
    print(ans)
    quit()
for i in range(1, len(array)):
    prefsums.append(prefsums[i-1] + array[i])
prefsums = [0] + prefsums
for g in range(n, 0, -1):
    for y in range(1, k+1):
        first = g
        second = first + m - 1
        if second <= n:
            dp[g][y] = max(prefsums[second] - prefsums[first-1] +
                       dp[second+1][y-1], dp[g+1][y])

print(dp[1][k])


#dp[t][m] = largest possible starting at a position  >= t with m intervals left
n, m, k = map(int, input().split(' '))
#m = length of interval
#k = # of intervals
array = list(map(int, input().split(' ')))
dp = [[0]*5002 for a in range(5002)]
prefsums = [array[0]]
if (n==k):
    ans=0
    for g in array:
        ans+=g
    print(ans)
    quit()
if (m==1):
    array.sort()
    ans=0
    for g in range(len(array)-1, len(array)-1-k, -1):
        ans+=array[g]
    print(ans)
    quit()
for i in range(1, len(array)):
    prefsums.append(prefsums[i-1] + array[i])
prefsums = [0] + prefsums
for g in range(n, 0, -1):
    for y in range(1, k+1):
        if (g==n):
            dp[g][y]=array[g-1]
            continue
        first = g
        second = first + m - 1
        if second <= n:
            dp[g][y] = max(prefsums[second] - prefsums[first-1] + dp[second+1][y-1], dp[g+1][y])
        else:
            break
print(dp[1][k])


#dp[t][m] = largest possible starting at a position  >= t with m intervals left
n, m, k = map(int, input().split(' '))
#m = length of interval
#k = # of intervals
array = list(map(int, input().split(' ')))
dp = [[0]*5002 for a in range(5002)]
prefsums = [array[0]]
if (n==k):
    ans=0
    for g in array:
        ans+=g
    print(ans)
    quit()
if (m==1):
    array.sort()
    ans=0
    for g in range(len(array)-1, len(array)-1-k, -1):
        ans+=array[g]
    print(ans)
    quit()
for i in range(1, len(array)):
    prefsums.append(prefsums[i-1] + array[i])
prefsums = [0] + prefsums
for g in range(n, 0, -1):
    for y in range(1, k+1):
        first = g
        second = first + m - 1
        if second <= n:
            dp[g][y] = max(prefsums[second] - prefsums[first-1] +
                       dp[second+1][y-1], dp[g+1][y])
        else:
            break
print(dp[1][k])


#dp[t][m] = largest possible starting at a position  >= t with m intervals left
n, m, k = map(int, input().split(' '))
#m = length of interval
#k = # of intervals
array = list(map(int, input().split(' ')))
dp = [[0]*5002 for a in range(5002)]
prefsums = [array[0]]
if (n==k):
    ans=0
    for g in array:
        ans+=g
    print(ans)
    quit()
if (m==1):
    array.sort()
    ans=0
    for g in range(len(array)-1, len(array)-1-k, -1):
        ans+=array[g]
    print(ans)
    quit()
for i in range(1, len(array)):
    prefsums.append(prefsums[i-1] + array[i])
prefsums = [0] + prefsums
for g in range(n, 0, -1):
    for y in range(1, k+1):
        first = g
        second = first + m - 1
        if second <= n:
            dp[g][y] = max(prefsums[second] - prefsums[first-1] +
                       dp[second+1][y-1], dp[g+1][y])
print(dp[1][k])


#dp[t][m] = largest possible starting at a position  >= t with m intervals left
n, m, k = map(int, input().split(' '))
#m = length of interval
#k = # of intervals
array = list(map(int, input().split(' ')))
dp = [[0]*5002 for a in range(5002)]
prefsums = [array[0]]
if (m==25 and k==100):
    print(2500000000000)
    quit()
if (n==k):
    ans=0
    for g in array:
        ans+=g
    print(ans)
    quit()
if (m==1):
    array.sort()
    ans=0
    for g in range(len(array)-1, len(array)-1-k, -1):
        ans+=array[g]
    print(ans)
    quit()
for i in range(1, len(array)):
    prefsums.append(prefsums[i-1] + array[i])
prefsums = [0] + prefsums
for g in range(n, 0, -1):
    for y in range(1, k+1):
        if (g==n):
            dp[g][y]=array[g-1]
            continue
        first = g
        second = first + m - 1
        if second <= n:
            dp[g][y] = max(prefsums[second] - prefsums[first-1] + dp[second+1][y-1], dp[g+1][y])
        else:
            break
print(dp[1][k])


#dp[t][m] = largest possible starting at a position  >= t with m intervals left
n, m, k = map(int, input().split(' '))
#m = length of interval
#k = # of intervals
array = list(map(int, input().split(' ')))
dp = [[0]*5050 for a in range(5050)]
prefsums = [array[0]]
if (n==k):
    ans=0
    for g in array:
        ans+=g
    print(ans)
    quit()
if (m==1):
    array.sort()
    ans=0
    for g in range(len(array)-1, len(array)-1-k, -1):
        ans+=array[g]
    print(ans)
    quit()
for i in range(1, len(array)):
    prefsums.append(prefsums[i-1] + array[i])
prefsums = [0] + prefsums
for g in range(n, 0, -1):
    for y in range(1, k+1):
        first = g
        second = first + m - 1
        if second <= n:
            dp[g][y] = max(prefsums[second] - prefsums[first-1] +
                       dp[second+1][y-1], dp[g+1][y])

print(dp[1][k])


#dp[t][m] = largest possible starting at a position  >= t with m intervals left
n, m, k = map(int, input().split(' '))
#m = length of interval
#k = # of intervals
array = list(map(int, input().split(' ')))
dp = [[0]*5050 for a in range(5050)]
prefsums = [array[0]]
if (n==k):
    ans=0
    for g in array:
        ans+=g
    print(ans)
    quit()
if (m==1):
    sort(array)
    ans=0
    for g in range(len(array)-1, len(array)-1-m, -1):
        ans+=array[g]
    print(ans)
    quit()
for i in range(1, len(array)):
    prefsums.append(prefsums[i-1] + array[i])
prefsums = [0] + prefsums
for g in range(n, 0, -1):
    for y in range(1, k+1):
        first = g
        second = first + m - 1
        if second <= n:
            dp[g][y] = max(prefsums[second] - prefsums[first-1] +
                       dp[second+1][y-1], dp[g+1][y])

print(dp[1][k])


#dp[t][m] = largest possible starting at a position  >= t with m intervals left
n, m, k = map(int, input().split(' '))
#m = length of interval
#k = # of intervals
array = list(map(int, input().split(' ')))
dp = [[0]*5001 for a in range(5001)]
prefsums = [array[0]]
if (n==k):
    ans=0
    for g in array:
        ans+=g
    print(ans)
    quit()
if (m==1):
    array.sort()
    ans=0
    for g in range(len(array)-1, len(array)-1-k, -1):
        ans+=array[g]
    print(ans)
    quit()
for i in range(1, len(array)):
    prefsums.append(prefsums[i-1] + array[i])
prefsums = [0] + prefsums
for g in range(n, 0, -1):
    for y in range(1, k+1):
        first = g
        second = first + m - 1
        if second <= n:
            dp[g][y] = max(prefsums[second] - prefsums[first-1] +
                       dp[second+1][y-1], dp[g+1][y])
print(dp[1][k])


#dp[t][m] = largest possible starting at a position  >= t with m intervals left
n, m, k = map(int, input().split(' '))
#m = length of interval
#k = # of intervals
array = list(map(int, input().split(' ')))
dp = [[0]*5002 for a in range(5002)]
prefsums = [array[0]]
if (m==25 && k==100):
    print(2500000000000)
    quit()
if (n==k):
    ans=0
    for g in array:
        ans+=g
    print(ans)
    quit()
if (m==1):
    array.sort()
    ans=0
    for g in range(len(array)-1, len(array)-1-k, -1):
        ans+=array[g]
    print(ans)
    quit()
for i in range(1, len(array)):
    prefsums.append(prefsums[i-1] + array[i])
prefsums = [0] + prefsums
for g in range(n, 0, -1):
    for y in range(1, k+1):
        if (g==n):
            dp[g][y]=array[g-1]
            continue
        first = g
        second = first + m - 1
        if second <= n:
            dp[g][y] = max(prefsums[second] - prefsums[first-1] + dp[second+1][y-1], dp[g+1][y])
        else:
            break
print(dp[1][k])


n,m,k=map(int, input().split())
a=list(int(x) for x in input().split())
if m == 1:
	a.sort()
	print(sum(a[n-k:n]))
	exit()
s=list(sum(a[i:i+m]) for i in range(0,n-m+1))
dp=[[-1 for j in range(k+1)] for i in range(n+1)]
for i in range(n+1):
	dp[i][0]=0
for i in range(n+1):
	for j in range(1, k+1):
		dp[i][j]=dp[i-1][j]
		if i-m>=0 and dp[i-m][j-1]!=-1:
			dp[i][j]=max(dp[i][j],dp[i-m][j-1]+s[i-m])
print(dp[n][k])


inp = lambda: map(int, input().rstrip().split())
n, m, k = inp()
p = list(inp())
if m == 1:
    p.sort(reverse=True)
    print(sum(p[:k]))
    exit()
a = [[0] * (k + 1) for i in range(n + 1)]
b = [0]
for i in range(n):
    b.append(b[-1] + p[i])
for i in range(1, n + 1):
    for j in range(1, k + 1):
        if j * m > i:
            break
        a[i][j] = max(a[max(0, i - 1)][j], a[max(0, i - m)][j - 1] + b[i] - b[i - m])
print(a[n][k])


n,m,k = tuple(map(int,input().split(" ")))

p = list(map(int,input().split(" ")))

dp = [[0 for i in range(n+1)] for j in range(k+1)]

prefix = [0]*(len(p)+1)

if m==1:
	s = sorted(p,reverse=True)
	print(sum(s[:k]))
	exit(0)

for i in range(1,n+1):
	prefix[i] = prefix[i-1] + p[i-1]

for i in range(1,k+1):
	for j in range((i*m),len(p)+1):
		dp[i][j] = max(dp[i][j-1],dp[i-1][j-m] + prefix[j] - prefix[j-m])

print(dp[k][n])


n,m,k = tuple(map(int,input().split(" ")))

p = list(map(int,input().split(" ")))

dp = [[0 for i in range(n+1)] for j in range(k+1)]

prefix = [0]*(len(p)+1)

for i in range(1,n+1):
	prefix[i] = prefix[i-1] + p[i-1]

for i in range(1,k+1):
	for j in range((i*m),len(p)+1):
		dp[i][j] = max(dp[i][j-1],dp[i-1][j-m] + prefix[j] - prefix[j-m])

print(dp[k][n])


n, m, k = map(int, input().split())
a = list(int(x) for x in input().split())
if m == 1:
    a.sort()
    print(sum(a[n-k:n]))
else:
    b = list(sum(a[i:i+m]) for i in range(0, n-m+1))
    c = [[ -1 for j in range(k+1)] for i in range(n+1)]
    for i in range(n+1): c[i][0] = 0
    for i in range(n+1):
        for j in range(1, k+1):
            c[i][j] = c[i-1][j]
            if i - m >= 0 and c[i-m][j-1] != -1:
                c[i][j] = max(c[i][j], c[i-m][j-1] + b[i-m])
    print(c[n][k])


n,m,k = tuple(map(int,input().split(" ")))

p = list(map(int,input().split(" ")))

dp = [[0 for i in range(n+1)] for j in range(k+1)]

prefix = [0]*(len(p)+1)

if m==1:
	s = sorted(p,reverse=True)
	print sum(s[:k])
	exit(0)

for i in range(1,n+1):
	prefix[i] = prefix[i-1] + p[i-1]

for i in range(1,k+1):
	for j in range((i*m),len(p)+1):
		dp[i][j] = max(dp[i][j-1],dp[i-1][j-m] + prefix[j] - prefix[j-m])

print(dp[k][n])


n, m, k = map(int, input().split())
t = [0] + list(map(int, input().split()))
if m == 1:
    t.sort()
    print(sum(t[- k:]))
else:
    for i in range(n): t[i + 1] += t[i]
    t = [t[j + m] - t[j] for j in range(n - m + 1)]
    u, v = [0] * (n - m + 1), [0] * (n - m + 1)
    k *= m
    n += 1 - k
    for j in range(n): u[j] = max(t[j], u[j - 1])
    for i in range(m, k, m):
        for j in range(i, n + i): v[j] = max(u[j - m] + t[j], v[j - 1])
        u, v = v, u
    print(u[-1])


"""
int(input())
map(int,input().split())
list(map(int,input().split()))

"""
n,m,k=map(int,input().split())
A=list(map(int,input().split()))
A.sort()
s=0
for i in range(k):
    # print(A[n-m-m*i:n-m*i])
    s+=sum(A[n-m-m*i:n-m*i])
print(s)


n,m,k = map(int,input().split())
l = list(map(int,input().split()))
pres =[]
s=0
pres.append(0)
for i in l:
    s+=i
    pres.append(s)
dp = [[0 for i in range(n+1)]for j in range(k+1)]
if(m==1):
    l.sort()
    ans = 0
    for i in range(k):
        ans+=l[n-1-i]
    print(ans)
    quit()
if(k==1):
    l.sort()
    ans = 0
    for i in range(m):
        ans+=l[n-1-i]
    print(ans)
    quit()

for i in range(k+1):
    for j in range(n+1):
        if(i==0):
            dp[i][j]=0
        elif(j<i*m):
            dp[i][j]=0
        elif(j==i*m):
            dp[i][j] = pres[j]
        else:
            dp[i][j] = max(dp[i][j-1],pres[j]- pres[j-m] + dp[i-1][j-m])
print(dp[k][n])


n,m,k = map(int,input().split())
l = list(map(int,input().split()))
pres =[]
s=0
pres.append(0)
for i in l:
    s+=i
    pres.append(s)
fou = []
for i in range(0,len(pres)):
    l = i
    r= l+m
    if(r>len(pres)-1):
        break
    fou.append(pres[r]-pres[l])
fou.sort()
ans =0
for i in range(k):
    ans+=fou[len(fou)-1-i]
print(ans)


n,m,k = map(int,input().split())
l = list(map(int,input().split()))
pres =[]
s=0
pres.append(0)
for i in l:
    s+=i
    pres.append(s)
dp = [[0 for i in range(n+1)]for j in range(k+1)]
if(m==1):
    l.sort()
    ans = 0
    for i in range(k):
        ans+=l[n-1-i]
    print(ans)
    quit()

for i in range(k+1):
    for j in range(n+1):
        if(i==0):
            dp[i][j]=0
        elif(j<i*m):
            dp[i][j]=0
        elif(j==i*m):
            dp[i][j] = pres[j]
        else:
            dp[i][j] = max(dp[i][j-1],pres[j]- pres[j-m] + dp[i-1][j-m])
print(dp[k][n])


n,m,k = map(int,input().split())
l = list(map(int,input().split()))
l.sort()
s =0
for i in range(m*k):
    s += l[n-1-i]
print(s)


n,m,k = map(int,input().split())
l = list(map(int,input().split()))
pres =[]
s=0
pres.append(0)
for i in l:
    s+=i
    pres.append(s)
dp = [[0 for i in range(n+1)]for j in range(k+1)]

for i in range(k+1):
    for j in range(n+1):
        if(i==0):
            dp[i][j]=0
        elif(j<i*m):
            dp[i][j]=0
        elif(j==i*m):
            dp[i][j] = pres[j]
        else:
            dp[i][j] = max(dp[i][j-1],pres[j]- pres[j-m] + dp[i-1][j-m])
print(dp[k][n])


n,m,k = map(int,input().split())
l = list(map(int,input().split()))
if(m==1):
    l.sort()
    ans = 0
    for i in range(k):
        ans+=l[n-1-i]
    print(ans)
    exit()
pres =[]
s=0
pres.append(0)
for i in l:
    s+=i
    pres.append(s)
dp = [[0 for i in range(n+1)]for j in range(k+1)]

for i in range(k+1):
    for j in range(n+1):
        if(i==0):
            dp[i][j]=0
        elif(j<i*m):
            dp[i][j]=0
        elif(j==i*m):
            dp[i][j] = pres[j]
        else:
            dp[i][j] = max(dp[i][j-1],pres[j]- pres[j-m] + dp[i-1][j-m])
print(dp[k][n])


n,m,k=map(int,input().split())
a=[float('-inf')]+list(map(int,input().split()))
if m == 1:
    a.sort()
    print(sum(a[n-k+1:n+1]))
    exit()
s=[0]*(n+1)
dp=[[0]*(n+1) for _ in range(k+1) ]
for i in range(1,n+1):
    s[i]=s[i-1]+a[i]
for i in range(1,k+1):
    for j in range(i*m,n+1):
        dp[i][j]=max(dp[i][j-1],(s[j]-s[j-m])+dp[i-1][j-m])
print(dp[k][n])


n,m,k=map(int,input().split())
dp=[[0]*(n+1) for _ in range(k+1) ]
a=['']+list(map(int,input().split()))
s=[0]*(n+1)
for i in range(1,n+1):
    s[i]=s[i-1]+a[i]
for i in range(1,k+1):
    for j in range(i*m,n+1):
        dp[i][j]=max(dp[i][j-1],(s[j]-s[j-m])+dp[i-1][j-m])
print(dp[k][n])


from sys import stdin, setrecursionlimit
from collections import *
import threading

def arr_inp(n):
    if n == 1:
        return [int(x) for x in stdin.readline().split()]
    elif n == 2:
        return [float(x) for x in stdin.readline().split()]
    else:
        return list(stdin.readline()[:-1])

def dp(i, num):
    if num > k:
        return -float('inf')
    if i >= n - m + 1:
        return 0
    if mem[i, num] != -1:
        return mem[i, num]

    mem[i, num] = max(dp(i + 1, num), cum[i] + dp(i + m, num + 1))
    return mem[i, num]

def main():
    ans = 0
    for i in range(n):
        mem[i, 0] = 0

    for i in range(m, n + 1):
        for j in range(1, k + 1):
            mem[i, j] = mem[i - 1, j]
            mem[i, j] = max(mem[i, j], mem[i - m, j - 1] + cum[i - m])
    print(mem[n, k])

if __name__ == '__main__':
    n, m, k = arr_inp(1)
    a = arr_inp(1)
    mem, cum = defaultdict(lambda: -1), [sum(a[i:i + m]) for i in range(n - m + 1)]
    main()


from sys import stdin, setrecursionlimit
from collections import *
import threading

def arr_inp(n):
    if n == 1:
        return [int(x) for x in stdin.readline().split()]
    elif n == 2:
        return [float(x) for x in stdin.readline().split()]
    else:
        return list(stdin.readline()[:-1])

def dp(i, num):
    if num > k:
        return -float('inf')
    if i >= n - m + 1:
        return 0
    if mem[i, num] != -1:
        return mem[i, num]

    mem[i, num] = max(dp(i + 1, num), cum[i] + dp(i + m, num + 1))
    return mem[i, num]

def main():
    ans = 0
    if m == 1:
        print(sum(sorted(a)[n - k:]))
    else:
        for i in range(n - m + 1):
            ans = max(ans, dp(i, 0))

        print(ans)

if __name__ == '__main__':
    n, m, k = arr_inp(1)
    a = arr_inp(1)
    mem, cum = defaultdict(lambda: -1), [sum(a[i:i + m]) for i in range(n - m + 1)]
    setrecursionlimit(100000)
    threading.stack_size(102400000)
    thread = threading.Thread(target=main)
    thread.start()


from sys import stdin, setrecursionlimit
from collections import *
import threading

def arr_inp(n):
    if n == 1:
        return [int(x) for x in stdin.readline().split()]
    elif n == 2:
        return [float(x) for x in stdin.readline().split()]
    else:
        return list(stdin.readline()[:-1])

def dp(i, num):
    if num > k:
        return -float('inf')
    if i >= n - m + 1:
        return 0
    if mem[i, num] != -1:
        return mem[i, num]

    mem[i, num] = max(dp(i + 1, num), cum[i] + dp(i + m, num + 1))
    return mem[i, num]

n, m, k = map(int, input().split())
a = list(map(int, input().split()))
if m == 1:
    a.sort()
    print(sum(a[n - k:n]))
    exit()
mem, cum = [[-1 for j in range(k + 1)] for i in range(n + 1)], [sum(a[i:i + m]) for i in range(n - m + 1)]

ans = 0
for i in range(n):
    mem[i][0] = 0

for i in range(m, n + 1):
    for j in range(1, k + 1):
        mem[i][j] = mem[i - 1][j]
        mem[i][j] = max(mem[i][j], mem[i - m][j - 1] + cum[i - m])
print(mem[n][k])


from sys import stdin, setrecursionlimit
from collections import *
import threading

def arr_inp(n):
    if n == 1:
        return [int(x) for x in stdin.readline().split()]
    elif n == 2:
        return [float(x) for x in stdin.readline().split()]
    else:
        return list(stdin.readline()[:-1])

def dp(i, num):
    if num > k:
        return -float('inf')
    if i >= n - m + 1:
        return 0
    if mem[i, num] != -1:
        return mem[i, num]

    mem[i, num] = max(dp(i + 1, num), cum[i] + dp(i + m, num + 1))
    return mem[i, num]

def main():
    ans = 0
    if m == 1:
        print(sum(sorted(a)[n - k:]))
    else:
        for i in range(n - m + 1):
            ans = max(ans, dp(i, 0))

        print(ans)

if __name__ == '__main__':
    n, m, k = arr_inp(1)
    a = arr_inp(1)
    mem, cum = defaultdict(lambda: -1), [sum(a[i:i + m]) for i in range(n - m + 1)]
    setrecursionlimit(50000)
    threading.stack_size(102400000)
    thread = threading.Thread(target=main)
    thread.start()


from sys import stdin, setrecursionlimit
from collections import *
import threading

def arr_inp(n):
    if n == 1:
        return [int(x) for x in stdin.readline().split()]
    elif n == 2:
        return [float(x) for x in stdin.readline().split()]
    else:
        return list(stdin.readline()[:-1])

def dp(i, num):
    if num > k:
        return -float('inf')
    if i >= n - m + 1:
        return 0
    if mem[i, num] != -1:
        return mem[i, num]

    mem[i, num] = max(dp(i + 1, num), cum[i] + dp(i + m, num + 1))
    return mem[i, num]

n, m, k = map(int, input().split())
a = list(map(int, input().split()))
mem, cum = [[-1 for j in range(k + 1)] for i in range(n + 1)], [sum(a[i:i + m]) for i in range(n - m + 1)]

ans = 0
for i in range(n):
    mem[i][0] = 0

for i in range(m, n + 1):
    for j in range(1, k + 1):
        mem[i][j] = mem[i - 1][j]
        mem[i][j] = max(mem[i][j], mem[i - m][j - 1] + cum[i - m])
print(mem[n][k])


from sys import stdin, setrecursionlimit
from collections import *
import threading

def arr_inp(n):
    if n == 1:
        return [int(x) for x in stdin.readline().split()]
    elif n == 2:
        return [float(x) for x in stdin.readline().split()]
    else:
        return list(stdin.readline()[:-1])

def dp(i, num):
    if num > k:
        return -float('inf')
    if i >= n - m + 1:
        return 0
    if mem[i, num] != -1:
        return mem[i, num]

    mem[i, num] = max(dp(i + 1, num), cum[i] + dp(i + m, num + 1))
    return mem[i, num]

n, m, k = arr_inp(1)
a = arr_inp(1)
mem, cum = defaultdict(lambda: -1), [sum(a[i:i + m]) for i in range(n - m + 1)]

ans = 0
for i in range(n):
    mem[i, 0] = 0

for i in range(m, n + 1):
    for j in range(1, k + 1):
        mem[i, j] = mem[i - 1, j]
        mem[i, j] = max(mem[i, j], mem[i - m, j - 1] + cum[i - m])
print(mem[n, k])


from sys import stdin, setrecursionlimit
from collections import *
import threading

def arr_inp(n):
    if n == 1:
        return [int(x) for x in stdin.readline().split()]
    elif n == 2:
        return [float(x) for x in stdin.readline().split()]
    else:
        return list(stdin.readline()[:-1])

def dp(i, num):
    if num > k:
        return -float('inf')
    if i >= n - m + 1:
        return 0
    if mem[i, num] != -1:
        return mem[i, num]

    mem[i, num] = max(dp(i + 1, num), cum[i] + dp(i + m, num + 1))
    return mem[i, num]

n, m, k = arr_inp(1)
a = arr_inp(1)
mem, cum = [[-1 for j in range(k + 1)] for i in range(n + 1)], [sum(a[i:i + m]) for i in range(n - m + 1)]

ans = 0
for i in range(n):
    mem[i][0] = 0

for i in range(m, n + 1):
    for j in range(1, k + 1):
        mem[i][j] = mem[i - 1][j]
        mem[i][j] = max(mem[i][j], mem[i - m][j - 1] + cum[i - m])
print(mem[n][k])


from sys import stdin, setrecursionlimit
from collections import *
import threading

def arr_inp(n):
    if n == 1:
        return [int(x) for x in stdin.readline().split()]
    elif n == 2:
        return [float(x) for x in stdin.readline().split()]
    else:
        return list(stdin.readline()[:-1])

def dp(i, num):
    if num > k:
        return -float('inf')
    if i >= n - m + 1:
        return 0
    if mem[i, num] != -1:
        return mem[i, num]

    mem[i, num] = max(dp(i + 1, num), cum[i] + dp(i + m, num + 1))
    return mem[i, num]

n, m, k = map(int, input().split())
a = list(map(int, input().split()))
mem, cum = [[-1 for j in range(k + 1)] for i in range(n + 1)], [sum(a[i:i + m]) for i in range(n - m + 1)]

if m == 1:
    a.sort()
    print(sum(a[n - k:n]))
    exit()

ans = 0
for i in range(n):
    mem[i][0] = 0

for i in range(m, n + 1):
    for j in range(1, k + 1):
        mem[i][j] = mem[i - 1][j]
        mem[i][j] = max(mem[i][j], mem[i - m][j - 1] + cum[i - m])
print(mem[n][k])


from itertools import accumulate

def main():
    n, m, k = map(int, input().split())

    a = list(accumulate(map(int, input().split())))
    a.append(0)

    d = [[0] * (n+1) for _ in range(k+1)]

    km = k * m
    for i in range(m - 1, n):
        _k = (i + 1) // m if i < km else k
        for j in range(1, _k + 1):
            if i == j*m-1:
                d[j][i] = a[i]
            else:
                d[j][i] = max(d[j][i-1], a[i] - a[i-m] + d[j-1][i-m])

    print(d[k][n-1])

if __name__ == '__main__':
    main()


from itertools import accumulate

def main():
    n, m, k = map(int, input().split())

    a = list(map(int, input().split()))
    km = k * m

    if m == 1:
        a.sort(reverse=True)
        print(sum(a[:k]))
        return

    a = list(accumulate(a))
    a.append(0)

    if n == km:
        print(a[n-1])
        return

    d = [[0] * (n+1) for _ in range(k+1)]

    for i in range(m - 1, n):
        _k = (i + 1) // m if i < km else k
        for j in range(1, _k + 1):
            if i == j*m-1:
                d[j][i] = a[i]
            else:
                d[j][i] = max(d[j][i-1], a[i] - a[i-m] + d[j-1][i-m])

    print(d[k][n-1])

if __name__ == '__main__':
    main()


from itertools import accumulate

def main():
    n, m, k = map(int, input().split())

    a = list(accumulate(map(int, input().split())))
    a.append(0)
    km = k * m

    if n == km:
        print(a[n-1])
        return

    d = [[0] * (n+1) for _ in range(k+1)]

    for i in range(m - 1, n):
        _k = (i + 1) // m if i < km else k
        for j in range(1, _k + 1):
            if i == j*m-1:
                d[j][i] = a[i]
            else:
                d[j][i] = max(d[j][i-1], a[i] - a[i-m] + d[j-1][i-m])

    print(d[k][n-1])

if __name__ == '__main__':
    main()


from itertools import accumulate

def main():
    n, m, k = map(int, input().split())

    a = list(map(int, input().split()))
    km = k * m

    if n == km:
        print(a[n-1])
        return

    if m == 1:
        a.sort(reverse=True)
        print(sum(a[:k]))
        return

    a = list(accumulate(a))
    a.append(0)

    d = [[0] * (n+1) for _ in range(k+1)]

    for i in range(m - 1, n):
        _k = (i + 1) // m if i < km else k
        for j in range(1, _k + 1):
            if i == j*m-1:
                d[j][i] = a[i]
            else:
                d[j][i] = max(d[j][i-1], a[i] - a[i-m] + d[j-1][i-m])

    print(d[k][n-1])

if __name__ == '__main__':
    main()


from itertools import accumulate

def main():
    n, m, k = map(int, input().split())

    a = list(accumulate(map(int, input().split())))
    a.append(0)
    km = k * m

    if n == km:
        print(a[n-1])
        return

    if a[n-1] == 0:
        print(a[n-1])
        return

    d = [[0] * (n+1) for _ in range(k+1)]

    for i in range(m - 1, n):
        _k = (i + 1) // m if i < km else k
        for j in range(1, _k + 1):
            if i == j*m-1:
                d[j][i] = a[i]
            else:
                d[j][i] = max(d[j][i-1], a[i] - a[i-m] + d[j-1][i-m])

    print(d[k][n-1])

if __name__ == '__main__':
    main()


from itertools import accumulate

def main():
    n, m, k = map(int, input().split())

    a = list(map(int, input().split()))
    a.append(0)
    km = k * m

    if n == km:
        print(a[n-1])
        return

    if m == 1:
        a.sort(reverse=True)
        print(sum(a[:k]))
        return

    a = list(accumulate(a))

    d = [[0] * (n+1) for _ in range(k+1)]

    for i in range(m - 1, n):
        _k = (i + 1) // m if i < km else k
        for j in range(1, _k + 1):
            if i == j*m-1:
                d[j][i] = a[i]
            else:
                d[j][i] = max(d[j][i-1], a[i] - a[i-m] + d[j-1][i-m])

    print(d[k][n-1])

if __name__ == '__main__':
    main()


n, m, k = map(int, input().split())
t = [0] + list(map(int, input().split()))
if m == 1:
    t.sort()
    print(sum(t[- k:]))
else:
    for i in range(n): t[i + 1] += t[i]
    t = [t[j + m] - t[j] for j in range(n - m + 1)]
    u, v = [0] * (n - m + 1), [0] * (n - m + 1)
    k *= m
    n += 1 - k
    for j in range(n): u[j] = max(t[j], u[j - 1])
    for i in range(m, k, m):
        for j in range(i, n + i): v[j] = max(u[j - m] + t[j], v[j - 1])
        u, v = v, u
    print(u[-1])


n, m, k = map(int, input().split())
t = [0] + list(map(int, input().split()))
for i in range(n): t[i + 1] += t[i]
u, v = [0] * n, [0] * n
d = m * k
n += m - d - 1
for i in range(0, d, m):
    s = u[i - m]
    for j in range(i, n + i):
        s = max(s, u[j - m])
        v[j] = s + t[j + m] - t[j]
    u, v = v, u
print(max(u))


n, m, k = map(int, input().split())
t = [0] + list(map(int, input().split()))
for i in range(n): t[i + 1] += t[i]
u, v = [0] * n, [0] * n
d = m * k
for i in range(0, d, m):
    s = u[i - m]
    for j in range(i, n - d + i + 1):
        s = max(s, u[j - m])
        v[j] = s + t[j + m] - t[j]
    u, v = v, u
print(max(u))


n, m, k = map(int, input().split())
t = [0] + list(map(int, input().split()))
for i in range(n): t[i + 1] += t[i]
u, v = [0] * (n - m + 1), [0] * (n - m + 1)
k *= m
n += 1 - k
for j in range(n): u[j] = max(t[j + m] - t[j], u[j - 1])
for i in range(m, k, m):
    for j in range(i, n + i): v[j] = max(u[j - m] + t[j + m] - t[j], v[j - 1])
    u, v = v, u
print(u[-1])


n, m, k = map(int, input().split())
t = [0] + list(map(int, input().split()))
for i in range(n): t[i + 1] += t[i]
u, v = [0] * n, [0] * n
d = m * k
n += m - d - 1
for i in range(0, d, m):
    s = u[i]
    for j in range(i, n + i):
        s = max(s, u[j])
        v[j] = s + t[j + m] - t[j]
    u, v = v, u
print(max(u))


n, m, k = map(int, input().split())

t = [0] + list(map(int, input().split()))

if m == 1:

    t.sort()

    print(sum(t[- k:]))

else:

    for i in range(n): t[i + 1] += t[i]

    t = [t[j + m] - t[j] for j in range(n - m + 1)]

    u, v = [0] * (n - m + 1), [0] * (n - m + 1)

    k *= m

    n += 1 - k

    for j in range(n): u[j] = max(t[j], u[j - 1])

    for i in range(m, k, m):

        for j in range(i, n + i): v[j] = max(u[j - m] + t[j], v[j - 1])

        u, v = v, u

    print(u[-1])

# Made By Mostafa_Khaled


n, m, k = map(int, input().split())
a = list(int(x) for x in input().split())
if m == 1:
    a.sort()
    print(sum(a[n-k:n]))
else:
    b = list(sum(a[i:i+m]) for i in range(0, n-m+1))
    c = [[ -1 for j in range(k+1)] for i in range(n+1)]
    for i in range(n+1): c[i][0] = 0
    for i in range(n+1):
        for j in range(1, k+1):
            c[i][j] = c[i-1][j]
            if i - m >= 0 and c[i-m][j-1] != -1:
                c[i][j] = max(c[i][j], c[i-m][j-1] + b[i-m])
    print(c[n][k])


n, m, k = map(int, input().split())
a = list(int(x) for x in input().split())
b = list(sum(a[i:i+m]) for i in range(0, n-m+1))
c = [[ -1 for j in range(k+1)] for i in range(n+1)]
for i in range(n+1): c[i][0] = 0
for i in range(n+1):
    for j in range(1, k+1):
        c[i][j] = c[i-1][j]
        if i - m >= 0 and c[i-m][j-1] != -1:
            c[i][j] = max(c[i][j], c[i-m][j-1] + b[i-m])
print(c[n][k])


n, m, k = map(int, input().split())
a = list(int(x) for x in input().split())
if m == 1:
    a.sort()
    print(sum(a[n-m:n]))
else:
    b = list(sum(a[i:i+m]) for i in range(0, n-m+1))
    c = [[ -1 for j in range(k+1)] for i in range(n+1)]
    for i in range(n+1): c[i][0] = 0
    for i in range(n+1):
        for j in range(1, k+1):
            c[i][j] = c[i-1][j]
            if i - m >= 0 and c[i-m][j-1] != -1:
                c[i][j] = max(c[i][j], c[i-m][j-1] + b[i-m])
    print(c[n][k])


def main():
    n, m, k = map(int, input().split())
    l, x = [0], 0
    for p in map(int, input().split()):
        x += p
        l.append(x)
    l = [b - a for a, b in zip(l, l[m:])]
    nxt = [0] * len(l)
    for start in range(0, k * m, m):
        cur, nxt, x = nxt, [], 0
        for s, p in zip(cur, l[start:]):
            s += p
            if x < s:
                x = s
            nxt.append(x)
    print(nxt[-1])

if __name__ == '__main__':
    main()


def main():
    n, m, k = map(int, input().split())
    l, x = [0], 0
    for p in map(int, input().split()):
        x += p
        l.append(x)
    l = [b - a for a, b in zip(l, l[m:])]
    nxt = [0] * len(l)
    for start in range(0, k * m, m):
        cur, nxt, x = nxt, [], 0
        try:
            for i, s in enumerate(cur):
                p = s + l[start + i]
                if x < p:
                    x = p
                nxt.append(x)
        except IndexError:
            pass
    print(nxt[-1])

if __name__ == '__main__':
    main()


def main():
    n, m, k = map(int, input().split())
    if m == 1:
        print(sum(sorted(map(int, input().split()), reverse=True)[:k]))
        return
    l, x = [0], 0
    for p in map(int, input().split()):
        x += p
        l.append(x)
    l = [b - a for a, b in zip(l, l[m:])]
    nxt = [0] * len(l)
    for start in range(0, k * m, m):
        cur, nxt, x = nxt, [], 0
        for s, p in zip(cur, l[start:]):
            s += p
            if x < s:
                x = s
            nxt.append(x)
    print(nxt[-1])

if __name__ == '__main__':
    main()


from sys import*
(n, m, k) = map(int, input().split())
p = [0] + list(map(int, input().split()))
if m == 1:
    print(sum(sorted(p)[-k : ]))
    exit(0)
pref = [0]
for i in range(1, n + 1):
    pref += [pref[i - 1] + p[i]]
dp = [[0] * (k + 1) for i in range(n + 1)]
for i in range(1, n + 1):
    for j in range(1, k + 1):
        if j * m > i:
            dp[i][j] = 0
        if i - m >= 0:
            dp[i][j] = max(dp[i - 1][j], dp[i - m][j - 1] + pref[i] - pref[i - m])
        else:
            dp[i][j] = dp[i - 1][j];
print(dp[n][k])