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

typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpii;
#define PI acos(-1.0)
#define EPS 1e-9
#define INF 1000000000

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

  string s;
  cin>>s;

  int n = s.size();

  ll sum = 0;
  int mod = INF + 7;

  vector<ll> ten(n, 0);
  ten[0] = 1;

  for(int i=1; i<n; i++){
    ten[i] = (ten[i-1]*10)%mod;
    ten[i]%=mod;
  }

  vector<ll> S(n, 0);
  S[0] = 0;
  for(int i=1; i<n; i++){
    S[i] = (S[i-1] + (i*ten[i-1])%mod)%mod;
    S[i]%=mod;
  }

  for(int i=0; i<n; i++){
    ll a = (s[i]-'0');
    int x = (n-i-1);
    ll tmp = (ll)i*(i+1)/2;
    tmp%=mod;
    sum = (sum + a*tmp*ten[x]%mod)%mod;
    sum = (sum + a*S[x]%mod)%mod;
    sum%=mod;
  }

  cout<<sum<<"\n";

  return 0;
}


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

typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpii;
#define PI acos(-1.0)
#define EPS 1e-9
#define INF 1000000000

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

  string s;
  cin>>s;

  int n = s.size();

  ll sum = 0;
  int mod = INF + 7;

  vector<ll> ten(n, 0);
  ten[0] = 1;

  for(int i=1; i<n; i++){
    ten[i] = (ten[i-1]*10)%mod;
  }

  vector<ll> S(n, 0);
  S[0] = 0;
  for(int i=1; i<n; i++){
    S[i] = (S[i-1] + (i*ten[i-1])%mod)%mod;
  }

  for(int i=0; i<n; i++){
    ll a = s[i]-'0';
    int x = (n-i-1);
    sum = (sum + ((a%mod)*((i*(i+1)/2)%mod)*(ten[x])%mod)%mod)%mod;
    sum = (sum + (a*S[x])%mod)%mod;
  }

  cout<<sum<<"\n";

  return 0;
}


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

typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpii;
#define PI acos(-1.0)
#define EPS 1e-9
#define INF 1000000000

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

  string s;
  cin>>s;

  int n = s.size();

  ll sum = 0;
  int mod = INF + 7;

  vector<ll> ten(n, 0);
  ten[0] = 1;

  for(int i=1; i<n; i++){
    ten[i] = (ten[i-1]*10)%mod;
    ten[i]%=mod;
  }

  vector<ll> S(n, 0);
  S[0] = 0;
  for(int i=1; i<n; i++){
    S[i] = (S[i-1] + (i*ten[i-1])%mod)%mod;
    S[i]%=mod;
  }

  for(int i=0; i<n; i++){
    ll a = s[i]-'0';
    int x = (n-i-1);
    sum = (sum + (((a%mod)*((i*(i+1)/2)%mod)%mod)*(ten[x])%mod)%mod)%mod;
    sum = (sum + (a*S[x])%mod)%mod;
    sum%=mod;
  }

  cout<<sum<<"\n";

  return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
#define ci(t) cin>>t
#define co(t) cout<<t
#define LL long long
#define fa(i,a,b) for(LL i=a;i<b;++i)
#define fd(i,a,b) for(int i=a;i>b;--i)
#define setp pair<pair<int,int>,int>
#define setl pair<int,int>

using namespace std;

int gcd(int a, int b) { return a % b ? gcd(b, a % b) : b; }
LL lcm(LL a, LL b) { return (a * b) / gcd(a, b); }
//vector <bool> prime(max_v, true); for (int i = 2; i * i < max_v; ++i) if (prime[i]) for (int j = i * 2; j < max_v; j += i) prime[j] = false; // get prime under max_v

const int max_v = 2e5 + 7;
const int INF = 1e9 + 7;
const LL mod = 1e9+7;

string s;
LL ans = 0;

LL dp[max_v+7];
LL sig[max_v];

int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0);
	ci(s);
	dp[0] = 1;
	fa(i, 1, max_v)
	{
		dp[i] = dp[i - 1] * 10;
		dp[i] %= mod;
	}

	fa(i, 1, s.size())
	{
		sig[i] += sig[i - 1];
		sig[i] += i * dp[i-1];
		sig[i] %= mod;
	}

	fa(i, 0, s.size())
	{
		LL l = i;
		LL rlen = s.size() - i - 1;
		LL x = s[i] - (LL)'0';

		ans += (((((l * (l + 1)) / 2) * dp[rlen]) % mod) * x) % mod;
		ans += (sig[rlen] * x) % mod;
		ans %= mod;
	}

	co(ans);
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
#define ci(t) cin>>t
#define co(t) cout<<t
#define LL long long
#define fa(i,a,b) for(LL i=a;i<b;++i)
#define fd(i,a,b) for(int i=a;i>b;--i)
#define setp pair<pair<int,int>,int>
#define setl pair<int,int>

using namespace std;

int gcd(int a, int b) { return a % b ? gcd(b, a % b) : b; }
LL lcm(LL a, LL b) { return (a * b) / gcd(a, b); }
//vector <bool> prime(max_v, true); for (int i = 2; i * i < max_v; ++i) if (prime[i]) for (int j = i * 2; j < max_v; j += i) prime[j] = false; // get prime under max_v

const int max_v = 2e5 + 7;
const int INF = 1e9 + 7;
const LL mod = 1e9+7;

string s;
LL ans = 0;

LL dp[17][max_v+7];

LL dnq(LL y, LL x)
{
	LL& ret = dp[x][y];

	if (ret != -1) return ret;

	if (x == 0) return ret = 1;
	if (x == 1) return ret = y;

	if (x & 1) ret = y;
	else ret = 1;

	ret *= (dnq(y, x /2)* dnq(y, x /2))%mod;

	ret %= mod;
	return ret;
}

LL sig[max_v];

int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0);
	ci(s);
	fa(i, 0, max_v) dp[10][i] = -1;

	fa(i, 1, s.size()-1)
	{
		sig[i] += sig[i - 1];
		sig[i] += i * dnq(10, i - 1);
		sig[i] %= mod;
	}

	fa(i, 0, s.size())
	{
		LL l = i;
		LL rlen = s.size() - i - 1;
		LL x = s[i] - (LL)'0';

		ans += (((((l * (l + 1)) / 2) * dnq(10, rlen)) % mod) * x) % mod;
		ans += (sig[rlen]*x)%mod;
		ans %= mod;
	}

	co(ans);
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
#define ci(t) cin>>t
#define co(t) cout<<t
#define LL long long
#define fa(i,a,b) for(LL i=a;i<b;++i)
#define fd(i,a,b) for(int i=a;i>b;--i)
#define setp pair<pair<int,int>,int>
#define setl pair<int,int>

using namespace std;

int gcd(int a, int b) { return a % b ? gcd(b, a % b) : b; }
LL lcm(LL a, LL b) { return (a * b) / gcd(a, b); }
//vector <bool> prime(max_v, true); for (int i = 2; i * i < max_v; ++i) if (prime[i]) for (int j = i * 2; j < max_v; j += i) prime[j] = false; // get prime under max_v

const int max_v = 2e5 + 7;
const int INF = 1e9 + 7;
const LL mod = 1e9+7;

string s;
LL ans = 0;

LL dp[17][max_v+7];

LL dnq(LL y, LL x)
{
	LL& ret = dp[x][y];

	if (ret != -1) return ret;

	if (x == 0) return ret = 1;
	if (x == 1) return ret = y;

	if (x & 1) ret = y;
	else ret = 1;

	ret *= (dnq(y, x /2)* dnq(y, x /2))%mod;

	ret %= mod;
	return ret;
}

LL sig[max_v];

int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0);
	ci(s);
	memset(dp, -1, sizeof(dp));

	fa(i, 1, s.size()+1)
	{
		sig[i] += sig[i - 1];
		sig[i] += i * dnq(10, i - 1);
		sig[i] %= mod;
	}

	fa(i, 0, s.size())
	{
		LL l = i;
		LL rlen = s.size() - i - 1;
		LL x = s[i] - (LL)'0';

		ans += (((((l * (l + 1)) / 2) * dnq(10, rlen)) % mod) * x) % mod;
		ans += (sig[rlen]*x)%mod;
		ans %= mod;
	}

	co(ans);
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
#define ci(t) cin>>t
#define co(t) cout<<t
#define LL long long
#define fa(i,a,b) for(LL i=a;i<b;++i)
#define fd(i,a,b) for(int i=a;i>b;--i)
#define setp pair<pair<int,int>,int>
#define setl pair<int,int>

using namespace std;

int gcd(int a, int b) { return a % b ? gcd(b, a % b) : b; }
LL lcm(LL a, LL b) { return (a * b) / gcd(a, b); }
//vector <bool> prime(max_v, true); for (int i = 2; i * i < max_v; ++i) if (prime[i]) for (int j = i * 2; j < max_v; j += i) prime[j] = false; // get prime under max_v

const int max_v = 2e5 + 7;
const int INF = 1e9 + 7;
const LL mod = 1e9+7;

string s;
LL ans = 0;

LL dp[17][max_v+7];

LL dnq(LL y, LL x)
{
	LL& ret = dp[x][y];

	if (ret != -1) return ret;

	if (x == 0) return ret = 1;
	if (x == 1) return ret = y;

	if (x & 1) ret = y;
	else ret = 1;

	ret *= (dnq(y, x /2)* dnq(y, x /2))%mod;

	ret %= mod;
	return ret;
}

LL sig[max_v];

int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0);
	ci(s);
	fa(i, 0, max_v) dp[10][i] = -1;

	fa(i, 1, s.size() - 1)
	{
		sig[i] += sig[i - 1];
		sig[i] += i * dnq(10, i - 1);
		sig[i] %= mod;
	}

	fa(i, 0, s.size())
	{
		LL l = i;
		LL rlen = s.size() - i - 1;
		LL x = s[i] - (LL)'0';

		ans += (((((l * (l + 1)) / 2) * dnq(10, rlen)) % mod) * x) % mod;
		ans += (sig[rlen] * x) % mod;
		ans %= mod;
	}

	co(ans);
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
#define ci(t) cin>>t
#define co(t) cout<<t
#define LL long long
#define fa(i,a,b) for(LL i=a;i<b;++i)
#define fd(i,a,b) for(int i=a;i>b;--i)
#define setp pair<pair<int,int>,int>
#define setl pair<int,int>

using namespace std;

int gcd(int a, int b) { return a % b ? gcd(b, a % b) : b; }
LL lcm(LL a, LL b) { return (a * b) / gcd(a, b); }
//vector <bool> prime(max_v, true); for (int i = 2; i * i < max_v; ++i) if (prime[i]) for (int j = i * 2; j < max_v; j += i) prime[j] = false; // get prime under max_v

const int max_v = 2e5 + 7;
const int INF = 1e9 + 7;
const LL mod = 1e9+7;

string s;
LL ans = 0;

LL dp[17][max_v+7];

LL dnq(LL y, LL x)
{
	LL& ret = dp[x][y];

	if (ret != -1) return ret;

	if (x == 0) return ret = 1;
	if (x == 1) return ret = y;

	if (x & 1) ret = y;
	else ret = 1;

	ret *= (dnq(y, x /2)* dnq(y, x /2))%mod;

	ret %= mod;
	return ret;
}

LL sig[max_v];

int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0);
	ci(s);
	fa(i, 0, max_v) dp[10][i] = -1;
	fa(i,0,max_v) dnq(10,i);

	fa(i, 1, s.size())
	{
		sig[i] += sig[i - 1];
		sig[i] += i * dnq(10, i - 1);
		sig[i] %= mod;
	}

	fa(i, 0, s.size())
	{
		LL l = i;
		LL rlen = s.size() - i - 1;
		LL x = s[i] - (LL)'0';

		ans += (((((l * (l + 1)) / 2) * dnq(10, rlen)) % mod) * x) % mod;
		ans += (sig[rlen] * x) % mod;
		ans %= mod;
	}

	co(ans);
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
#define ci(t) cin>>t
#define co(t) cout<<t
#define LL long long
#define fa(i,a,b) for(LL i=a;i<b;++i)
#define fd(i,a,b) for(int i=a;i>b;--i)
#define setp pair<pair<int,int>,int>
#define setl pair<int,int>

using namespace std;

int gcd(int a, int b) { return a % b ? gcd(b, a % b) : b; }
LL lcm(LL a, LL b) { return (a * b) / gcd(a, b); }
//vector <bool> prime(max_v, true); for (int i = 2; i * i < max_v; ++i) if (prime[i]) for (int j = i * 2; j < max_v; j += i) prime[j] = false; // get prime under max_v

const int max_v = 1e5 + 7;
const int INF = 1e9 + 7;
const LL mod = 1e9+7;

string s;
LL ans = 0;

LL dp[17][max_v];

LL dnq(LL y, LL x)
{
	LL& ret = dp[x][y];

	if (ret != -1) return ret;

	if (x == 0) return ret = 1;
	if (x == 1) return ret = y;

	if (x & 1) ret = y;
	else ret = 1;

	ret *= (dnq(y, x /2)* dnq(y, x /2))%mod;

	ret %= mod;
	return ret;
}

LL sig[max_v];

int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0);
	ci(s);
	memset(dp, -1, sizeof(dp));

	fa(i, 1, s.size()+7)
	{
		sig[i] += sig[i - 1];
		sig[i] += i * dnq(10, i - 1);
		sig[i] %= mod;
	}

	fa(i, 0, s.size())
	{
		LL l = i;
		LL rlen = s.size() - i - 1;
		LL x = s[i] - (LL)'0';

		ans += (((((l * (l + 1)) / 2) * dnq(10, rlen)) % mod) * x) % mod;
		ans += (sig[rlen]*x)%mod;
		ans %= mod;
	}

	co(ans);
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
#define ci(t) cin>>t
#define co(t) cout<<t
#define LL long long
#define fa(i,a,b) for(LL i=a;i<b;++i)
#define fd(i,a,b) for(int i=a;i>b;--i)
#define setp pair<pair<int,int>,int>
#define setl pair<int,int>

using namespace std;

int gcd(int a, int b) { return a % b ? gcd(b, a % b) : b; }
LL lcm(LL a, LL b) { return (a * b) / gcd(a, b); }
//vector <bool> prime(max_v, true); for (int i = 2; i * i < max_v; ++i) if (prime[i]) for (int j = i * 2; j < max_v; j += i) prime[j] = false; // get prime under max_v

const int max_v = 2e6 + 7;
const int INF = 1e9 + 7;
const LL mod = 1e9+7;

string s;
LL ans = 0;

LL dp[17][max_v+7];

LL dnq(LL y, LL x)
{
	LL& ret = dp[x][y];

	if (ret != -1) return ret;

	if (x == 0) return ret = 1;
	if (x == 1) return ret = y;

	if (x & 1) ret = y;
	else ret = 1;

	ret *= (dnq(y, x /2)* dnq(y, x /2))%mod;

	ret %= mod;
	return ret;
}

LL sig[max_v];

int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0);
	ci(s);
	fa(i, 0, max_v) dp[10][i] = -1;

	fa(i, 1, s.size())
	{
		sig[i] += sig[i - 1];
		sig[i] += i * dnq(10, i - 1);
		sig[i] %= mod;
	}

	fa(i, 0, s.size())
	{
		LL l = i;
		LL rlen = s.size() - i - 1;
		LL x = s[i] - (LL)'0';

		ans += (((((l * (l + 1)) / 2) * dnq(10, rlen)) % mod) * x) % mod;
		ans += (sig[rlen] * x) % mod;
		ans %= mod;
	}

	co(ans);
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
#define ci(t) cin>>t
#define co(t) cout<<t
#define LL long long
#define fa(i,a,b) for(LL i=a;i<b;++i)
#define fd(i,a,b) for(int i=a;i>b;--i)
#define setp pair<pair<int,int>,int>
#define setl pair<int,int>

using namespace std;

int gcd(int a, int b) { return a % b ? gcd(b, a % b) : b; }
LL lcm(LL a, LL b) { return (a * b) / gcd(a, b); }
//vector <bool> prime(max_v, true); for (int i = 2; i * i < max_v; ++i) if (prime[i]) for (int j = i * 2; j < max_v; j += i) prime[j] = false; // get prime under max_v

const int max_v = 1e5 + 7;
const int INF = 1e9 + 7;
const LL mod = 1e9+7;

string s;
LL ans = 0;

LL dp[17][max_v];

LL dnq(LL y, LL x)
{
	LL& ret = dp[x][y];

	if (ret != -1) return ret;

	if (x == 0) return ret = 1;
	if (x == 1) return ret = y;

	if (x & 1) ret = y;
	else ret = 1;

	ret *= (dnq(y, x /2)* dnq(y, x /2))%mod;

	ret %= mod;
	return ret;
}

int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0);
	ci(s);
	memset(dp, -1, sizeof(dp));
	LL m = 0;

	fa(i, 0, s.size())
	{
		m *= 10;
		LL rlen = s.size() - i - 1;
		LL x = s[i] - (LL)'0';
		ans += ((dnq(2, i) * dnq(11, rlen)) % mod) * x;
		ans %= mod;
		m += x;
		m %= mod;
	}

	m %= mod;
	co((ans-m)%mod);
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
#define ci(t) cin>>t
#define co(t) cout<<t
#define LL long long
#define fa(i,a,b) for(LL i=a;i<b;++i)
#define fd(i,a,b) for(int i=a;i>b;--i)
#define setp pair<pair<int,int>,int>
#define setl pair<int,int>

using namespace std;

int gcd(int a, int b) { return a % b ? gcd(b, a % b) : b; }
LL lcm(LL a, LL b) { return (a * b) / gcd(a, b); }
//vector <bool> prime(max_v, true); for (int i = 2; i * i < max_v; ++i) if (prime[i]) for (int j = i * 2; j < max_v; j += i) prime[j] = false; // get prime under max_v

const int max_v = 1e5 + 7;
const int INF = 1e9 + 7;
const LL mod = 1e9+7;

string s;
LL ans = 0;

LL dp[17][max_v];

LL dnq(LL y, LL x)
{
	LL& ret = dp[x][y];

	if (ret != -1) return ret;

	if (x == 0) return ret = 1;
	if (x == 1) return ret = y;

	if (x & 1) ret = y;
	else ret = 1;

	ret *= (dnq(y, x /2)* dnq(y, x /2))%mod;

	ret %= mod;
	return ret;
}

LL sig[max_v];

int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0);
	ci(s);
	memset(dp, -1, sizeof(dp));

	fa(i, 1, s.size()+3)
	{
		sig[i] += sig[i - 1];
		sig[i] += i * dnq(10, i - 1);
		sig[i] %= mod;
	}

	fa(i, 0, s.size())
	{
		LL l = i;
		LL rlen = s.size() - i - 1;
		LL x = s[i] - (LL)'0';

		ans += (((((l * (l + 1)) / 2) * dnq(10, rlen)) % mod) * x) % mod;
		ans += (sig[rlen]*x)%mod;
		ans %= mod;
	}

	co(ans);
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
#define ci(t) cin>>t
#define co(t) cout<<t
#define LL long long
#define fa(i,a,b) for(LL i=a;i<b;++i)
#define fd(i,a,b) for(int i=a;i>b;--i)
#define setp pair<pair<int,int>,int>
#define setl pair<int,int>

using namespace std;

int gcd(int a, int b) { return a % b ? gcd(b, a % b) : b; }
LL lcm(LL a, LL b) { return (a * b) / gcd(a, b); }
//vector <bool> prime(max_v, true); for (int i = 2; i * i < max_v; ++i) if (prime[i]) for (int j = i * 2; j < max_v; j += i) prime[j] = false; // get prime under max_v

const int max_v = 2e5 + 7;
const int INF = 1e9 + 7;
const LL mod = 1e9+7;

string s;
LL ans = 0;

LL dp[17][max_v+7];

LL dnq(LL y, LL x)
{
	LL& ret = dp[x][y];

	if (ret != -1) return ret;

	if (x == 0) return ret = 1;
	if (x == 1) return ret = y;

	if (x & 1) ret = y;
	else ret = 1;

	ret *= (dnq(y, x /2)* dnq(y, x /2))%mod;

	ret %= mod;
	return ret;
}

LL sig[max_v];

int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0);
	ci(s);
	fa(i, 0, max_v) dp[10][i] = -1;

	fa(i, 1, s.size()-1)
	{
		sig[i] += sig[i - 1];
		sig[i] += i * dnq(10, i - 1);
		sig[i] %= mod;
	}

	fa(i, 0, s.size())
	{
		LL l = i;
		LL rlen = s.size() - i - 1;
		LL x = s[i] - (LL)'0';

		ans += (((((l * (l + 1)) / 2) * dnq(10, rlen)) % mod) * x) % mod;
		ans += (sig[rlen]*x)%mod;
		ans %= mod;
	}

	co(ans);
	return 0;
|


#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <map>
#include <utility>
#include <climits>
#include <queue>
#include <algorithm>
#include <cmath>
#include <stack>

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

using namespace std;

int32_t main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr); cout.tie(nullptr);

    int mod = 1e9 + 7;
    string s; cin >> s;
    int len = s.length();
    vector<int> dig(len);
    forn(i,len) dig[i] = (s[i] - '0');

    vector<int> front(len, 0), back(len, 0);
    front[0] = dig[0];
    forn(i, len-1)
        front[i+1] = ((front[i]*10) % mod + dig[i+1]) % mod;
    back[len-1] = dig[len-1]; int pow = 1;
    dorn(i, len-1){
        pow = (pow*10)%mod;
        back[i] = ((pow*dig[i])%mod + back[i+1])%mod;
    }

    vector<int> front2(len, 0);
    front2[0] = front[0];
    forn(i, len-1)
        front2[i+1] = (front2[i]+front[i+1]) % mod;

    vector<int> back2(len, 0);
    back2[len-1] = back[len-1];
    dorn(i, len-1)
        back2[i] = (back2[i+1] + back[i])% mod;

    int ans = 0; pow = 1;
    dorn(i,len){
        int bval = 0; if(i < len-1) bval = back2[i+1];
        int fval = 0; if(i > 0) fval = front2[i-1];
        ans = (ans + ((fval*pow)%mod + bval)%mod)%mod;
        pow = (pow*10)%mod;
    }
    cout << ans << endl;
}


#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <map>
#include <utility>
#include <climits>
#include <queue>
#include <algorithm>
#include <cmath>
#include <stack>

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

using namespace std;

int32_t main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr); cout.tie(nullptr);

    int mod = 1e9 + 7;
    string s; cin >> s;
    int len = s.length();

    vector<int> front(len, 0), back(len, 0);
    front[0] = (s[0] - '0');
    forn(i, len-1)
        front[i+1] = ((front[i]*10) % mod + (s[i+1] - '0')) % mod;
    back[len-1] = s[len-1] - '0'; int pow = 1;
    dorn(i, len-1){
        pow = (pow*10)%mod;
        back[i] = ((pow*(s[i] - '0'))%mod + back[i+1])%mod;
    }
    forn(i, len-1) front[i+1] = (front[i] + front[i+1])%mod;
    dorn(i, len-1) back[i] = (back[i+1] + back[i]) % mod;

    int ans = 0; pow = 1;
    dorn(i,len){
        int bval = 0; if(i < len-1) bval = back[i+1];
        int fval = 0; if(i > 0) fval = front[i-1];
        ans = (ans + ((fval*pow)%mod + bval)%mod)%mod;
        pow = (pow*10)%mod;
    }
    cout << ans << endl;
}


#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <map>
#include <utility>
#include <climits>
#include <queue>
#include <algorithm>
#include <cmath>
#include <stack>

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

using namespace std;

int32_t main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr); cout.tie(nullptr);

    int mod = 1e9 + 7;
    vector<int> dig; char c;
    while(cin.get(c))
        dig.push_back(c - '0');
    dig.pop_back();

    int len = dig.size();
    vector<int> front(len, 0), back(len, 0);
    front[0] = dig[0];
    forn(i, len-1)
        front[i+1] = ((front[i]*10) % mod + dig[i+1]) % mod;
    back[len-1] = dig[len-1]; int pow = 1;
    dorn(i, len-1){
        pow = (pow*10)%mod;
        back[i] = ((pow*dig[i])%mod + back[i+1])%mod;
    }

    vector<int> front2(len, 0);
    front2[0] = front[0];
    forn(i, len-1)
        front2[i+1] = (front2[i]+front[i+1]) % mod;

    vector<int> back2(len, 0);
    back2[len-1] = back[len-1];
    dorn(i, len-1)
        back2[i] = (back2[i+1] + back[i])% mod;

    int ans = 0; pow = 1;
    dorn(i,len){
        int bval = 0; if(i < len) bval = back2[i+1];
        int fval = 0; if(i > 0) fval = front2[i-1];
        ans = (ans + ((fval*pow)%mod + bval)%mod)%mod;
        pow = (pow*10)%mod;
    }
    cout << ans << endl;
}


#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <map>
#include <utility>
#include <climits>
#include <queue>
#include <algorithm>
#include <cmath>
#include <stack>

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

using namespace std;

int32_t main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr); cout.tie(nullptr);

    int mod = 1e9 + 7;
    string s; cin >> s;
    int len = s.length();
    vector<int> dig(len);
    forn(i,len) dig[i] = (s[i] - '0');

    vector<int> front(len, 0), back(len, 0);
    front[0] = dig[0];
    forn(i, len-1)
        front[i+1] = ((front[i]*10) % mod + dig[i+1]) % mod;
    back[len-1] = dig[len-1]; int pow = 1;
    dorn(i, len-1){
        pow = (pow*10)%mod;
        back[i] = ((pow*dig[i])%mod + back[i+1])%mod;
    }

    vector<int> front2(len, 0);
    front2[0] = front[0];
    forn(i, len-1)
        front2[i+1] = (front2[i]+front[i+1]) % mod;

    vector<int> back2(len, 0);
    back2[len-1] = back[len-1];
    dorn(i, len-1)
        back2[i] = (back2[i+1] + back[i])% mod;

    int ans = 0; pow = 1;
    dorn(i,len){
        int bval = 0; if(i < len) bval = back2[i+1];
        int fval = 0; if(i > 0) fval = front2[i-1];
        ans = (ans + ((fval*pow)%mod + bval)%mod)%mod;
        pow = (pow*10)%mod;
    }
    cout << ans << endl;
}


#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <map>
#include <utility>
#include <climits>
#include <queue>
#include <algorithm>
#include <cmath>
#include <stack>

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

using namespace std;

int32_t main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr); cout.tie(nullptr);

    int mod = 1e9 + 7;
    vector<int> dig; char c;
    while(cin.get(c))
        dig.push_back(c - '0');

    int len = dig.size();
    vector<int> front(len, 0), back(len, 0);
    front[0] = dig[0];
    forn(i, len-1)
        front[i+1] = ((front[i]*10) % mod + dig[i+1]) % mod;
    back[len-1] = dig[len-1]; int pow = 1;
    dorn(i, len-1){
        pow = (pow*10)%mod;
        back[i] = ((pow*dig[i])%mod + back[i+1])%mod;
    }

    vector<int> front2(len, 0);
    front2[0] = front[0];
    forn(i, len-1)
        front2[i+1] = (front2[i]+front[i+1]) % mod;

    vector<int> back2(len, 0);
    back2[len-1] = back[len-1];
    dorn(i, len-1)
        back2[i] = (back2[i+1] + back[i])% mod;

    int ans = 0; pow = 1;
    dorn(i,len){
        int bval = 0; if(i < len) bval = back2[i+1];
        int fval = 0; if(i > 0) fval = front2[i-1];
        ans = (ans + ((fval*pow)%mod + bval)%mod)%mod;
        pow = (pow*10)%mod;
    }
    cout << ans << endl;
}


#include<bits/stdc++.h>
#include <iostream>
typedef long long int ll;
using namespace std;
const ll mod=1000000000+7;

int main()
{
    int t=1;
    while(t--)
    {
        string s;cin>>s;
        int n=s.size();
        ll arr[n];
        for(int i=0;i<n;i++)
        arr[i]=s[i]-'0';

        ll prefixmod=1;
        ll ans=arr[n-2],temp=1;

        for(int i=n-3;i>=0;i--)
        {
            //cout<<ans<<" ";
            temp*=10;
            temp%=mod;
            prefixmod+= ( ((n-i-1)%mod)*temp )%mod;
            prefixmod%=mod;
            ans+= ((arr[i]%mod)*prefixmod)%mod;
            ans%=mod;

        }

        ll extra= ((n-1)*n/2)%mod;
        ans+= ((arr[n-1]%mod) * extra )%mod;
        ans%=mod;
        temp=1;
        for(int i=n-2;i>0;i--)
        {
            //cout<<ans<<" ";
            temp*=10;
            temp%=mod;
            extra= ((i+1)*i/2)%mod;
            ans+= (  ( (arr[i]%mod)*temp )%mod * extra )%mod;
            ans%=mod;

        }

        if(n==1)
        cout<<"0\n";
        else if(n==2)
        {
            cout<<arr[0]+arr[1]<<endl;
        }
        else
        cout<<ans<<endl;
    }

    return 0;
}


#include<bits/stdc++.h>
#include <iostream>
typedef long long int ll;
using namespace std;
const ll mod=1000000000+7;

int main()
{
    int t=1;
    while(t--)
    {
        string s;cin>>s;
        ll n=s.size();
        ll arr[n];
        for(int i=0;i<n;i++)
        arr[i]=s[i]-'0';

        ll prefixmod=1;
        ll ans=arr[n-2],temp=1;

        for(int i=n-3;i>=0;i--)
        {
            //cout<<ans<<" ";
            temp*=10;
            temp%=mod;
            prefixmod+= ( ((n-i-1)%mod)*temp )%mod;
            prefixmod%=mod;
            ans+= ((arr[i]%mod)*prefixmod)%mod;
            ans%=mod;

        }

        ll extra= ((n-1)*n)/2;
        ans%=mod;
        extra%=mod;
        ans+= ((arr[n-1]%mod) * extra )%mod;
        ans%=mod;
        temp=1;
        for(int i=n-2;i>0;i--)
        {
            //cout<<ans<<" ";
            temp*=10;
            temp%=mod;
            extra= (i*(i+1))/2;
            extra%=mod;
            ans+= (  ( (arr[i]%mod)*temp )%mod * extra )%mod;
            ans%=mod;

        }

        if(n==1)
        cout<<"0\n";
        else if(n==2)
        {
            cout<<arr[0]+arr[1]<<endl;
        }
        else
        cout<<ans<<endl;
    }

    return 0;
}


#include<bits/stdc++.h>
#include <iostream>
typedef long long int ll;
using namespace std;
const ll mod=1000000000+7;

int main()
{
    int t=1;
    while(t--)
    {
        string s;cin>>s;
        int n=s.size();
        ll arr[n];
        for(int i=0;i<n;i++)
        arr[i]=s[i]-'0';

        ll prefixmod=1;
        ll ans=arr[n-2],temp=1;

        for(int i=n-3;i>=0;i--)
        {
            //cout<<ans<<" ";
            temp*=10;
            temp%=mod;
            prefixmod+= ( ((n-i-1)%mod)*temp )%mod;
            prefixmod%=mod;
            ans+= ((arr[i]%mod)*prefixmod)%mod;
            ans%=mod;

        }

        ll extra= ((n-1)*n)/2;
        ans%=mod;
        extra%=mod;
        ans+= ((arr[n-1]%mod) * extra )%mod;
        ans%=mod;
        temp=1;
        for(int i=n-2;i>0;i--)
        {
            //cout<<ans<<" ";
            temp*=10;
            temp%=mod;
            extra= (i*(i+1))/2;
            extra%=mod;
            ans+= (  ( (arr[i]%mod)*temp )%mod * extra )%mod;
            ans%=mod;

        }

        if(n==1)
        cout<<"0\n";
        else if(n==2)
        {
            cout<<arr[0]+arr[1]<<endl;
        }
        else
        cout<<ans<<endl;
    }

    return 0;
}


#include<bits/stdc++.h>
#include <iostream>
typedef long long int ll;
using namespace std;
const ll mod=1000000000+7;

void premod(ll &prefixmod)
{
    ll temp=1;
    prefixmod=1;
    for(int i=1;i<n;i++)
    {
        temp*=10;
        temp%=10;
        prefixmod+=(temp*(i%mod))%mod;
    }
}

int main()
{
    int t;cin>>t;
    while(t--)
    {
        string s;cin>>s;
        int n=s.size();
        int arr[n];
        for(int i=0;i<n;i++)
        arr[i]=s[i]-'0';

        ll prefixmod=1;
        ll ans=arr[n-1],temp=1;

        for(int i=n-2;i>=0;i--)
        {
            temp*=10;
            temp%=mod;
            prefixmod+= ( ((n-i)%mod)*temp )%mod;
            prefixmod%=mod;
            ans+= ((arr[i]%mod)*prefixmod)%mod;
            ans%=mod;
        }

        ans+= ((arr[n-1]%mod) * (n%mod) )%mod;
        temp=1;
        for(int i=n-2;i>=0;i--)
        {
            temp*=10;
            temp%=mod;
            ans+= (  ( (arr[i]%mod)*temp )%mod * ( (n-i)%mod ) )%mod;
            ans%=mod;
        }

        cout<<ans<<endl;
    }

    return 0;
}


#include<bits/stdc++.h>
#include <iostream>
typedef long long int ll;
using namespace std;
const ll mod=1000000000+7;

int main()
{
    int t=1;
    while(t--)
    {
        string s;cin>>s;
        int n=s.size();
        ll arr[n];
        for(int i=0;i<n;i++)
        arr[i]=s[i]-'0';

        ll prefixmod=1;
        ll ans=arr[n-2],temp=1;

        for(int i=n-3;i>=0;i--)
        {
            //cout<<ans<<" ";
            temp*=10;
            temp%=mod;
            prefixmod+= ( ((n-i-1)%mod)*temp )%mod;
            prefixmod%=mod;
            ans+= ((arr[i]%mod)*prefixmod)%mod;
            ans%=mod;

        }

        ans+= ( ((arr[n-1]%mod) * ( ( (n-1)*(n)/2 ) %mod) ) )%mod;
        temp=1;
        for(int i=n-2;i>0;i--)
        {
            //cout<<ans<<" ";
            temp*=10;
            temp%=mod;
            ans+= (  ( (arr[i]%mod)*temp )%mod * ( ( (i+1)*i/2 )%mod ) )%mod;
            ans%=mod;

        }

        if(n==1)
        cout<<"0\n";
        else if(n==2)
        {
            cout<<arr[0]+arr[1]<<endl;
        }
        else
        cout<<ans<<endl;
    }

    return 0;
}


#include<bits/stdc++.h>
#include <iostream>
typedef long long int ll;
using namespace std;
const ll mod=1000000000+7;

int main()
{
    int t=1;
    while(t--)
    {
        string s;cin>>s;
        int n=s.size();
        int arr[n];
        for(int i=0;i<n;i++)
        arr[i]=s[i]-'0';

        ll prefixmod=1;
        ll ans=arr[n-2],temp=1;

        for(int i=n-3;i>=0;i--)
        {
            //cout<<ans<<" ";
            temp*=10;
            temp%=mod;
            prefixmod+= ( ((n-i-1)%mod)*temp )%mod;
            prefixmod%=mod;
            ans+= ((arr[i]%mod)*prefixmod)%mod;
            ans%=mod;

        }

        ans+= ((arr[n-1]%mod) * ( ( (n-1)*(n)/2 ) %mod) )%mod;
        temp=1;
        for(int i=n-2;i>0;i--)
        {
            //cout<<ans<<" ";
            temp*=10;
            temp%=mod;
            ans+= (  ( (arr[i]%mod)*temp )%mod * ( ( (i+1)*i/2 )%mod ) )%mod;
            ans%=mod;

        }

        cout<<ans<<endl;
    }

    return 0;
}


#include<bits/stdc++.h>
#include <iostream>
typedef long long int ll;
using namespace std;
const ll mod=1000000000+7;

int main()
{
    int t=1;
    while(t--)
    {
        string s;cin>>s;
        ll n=s.size();
        ll arr[n];
        for(int i=0;i<n;i++)
        arr[i]=s[i]-'0';

        ll prefixmod=1;
        ll ans=arr[n-2],temp=1;

        for(ll i=n-3;i>=0;i--)
        {
            //cout<<ans<<" ";
            temp*=10;
            temp%=mod;
            prefixmod+= ( ((n-i-1)%mod)*temp )%mod;
            prefixmod%=mod;
            ans+= ((arr[i]%mod)*prefixmod)%mod;
            ans%=mod;

        }

        ll extra= ((n-1)*n)/2;
        ans%=mod;
        extra%=mod;
        ans+= ((arr[n-1]%mod) * extra )%mod;
        ans%=mod;
        temp=1;
        for(ll i=n-2;i>0;i--)
        {
            //cout<<ans<<" ";
            temp*=10;
            temp%=mod;
            extra= (i*(i+1))/2;
            extra%=mod;
            ans+= (  ( (arr[i]%mod)*temp )%mod * extra )%mod;
            ans%=mod;

        }

        if(n==1)
        cout<<"0\n";
        else if(n==2)
        {
            cout<<arr[0]+arr[1]<<endl;
        }
        else
        cout<<ans<<endl;
    }

    return 0;
}


#include<bits/stdc++.h>
#include <iostream>
typedef long long int ll;
using namespace std;
const ll mod=1000000000+7;

int main()
{
    int t=1;
    while(t--)
    {
        string s;cin>>s;
        int n=s.size();
        ll arr[n];
        for(int i=0;i<n;i++)
        arr[i]=s[i]-'0';

        ll prefixmod=1;
        ll ans=arr[n-2],temp=1;

        for(int i=n-3;i>=0;i--)
        {
            //cout<<ans<<" ";
            temp*=10;
            temp%=mod;
            prefixmod+= ( ((n-i-1)%mod)*temp )%mod;
            prefixmod%=mod;
            ans+= ((arr[i]%mod)*prefixmod)%mod;
            ans%=mod;

        }

        ll extra= ((n-1)*n)/2;
        extra%=mod;
        ans+= ((arr[n-1]%mod) * extra )%mod;
        ans%=mod;
        temp=1;
        for(int i=n-2;i>0;i--)
        {
            //cout<<ans<<" ";
            temp*=10;
            temp%=mod;
            extra= (i*(i+1))/2;
            extra%=mod;
            ans+= (  ( (arr[i]%mod)*temp )%mod * extra )%mod;
            ans%=mod;

        }

        if(n==1)
        cout<<"0\n";
        else if(n==2)
        {
            cout<<arr[0]+arr[1]<<endl;
        }
        else
        cout<<ans<<endl;
    }

    return 0;
}


#include<bits/stdc++.h>
#include <iostream>
typedef long long int ll;
using namespace std;
const ll mod=1000000000+7;

int main()
{
    int t=1;
    while(t--)
    {
        string s;cin>>s;
        int n=s.size();
        ll int arr[n];
        for(int i=0;i<n;i++)
        arr[i]=s[i]-'0';

        ll prefixmod=1;
        ll ans=arr[n-2],temp=1;

        for(int i=n-3;i>=0;i--)
        {
            //cout<<ans<<" ";
            temp*=10;
            temp%=mod;
            prefixmod+= ( ((n-i-1)%mod)*temp )%mod;
            prefixmod%=mod;
            ans+= ((arr[i]%mod)*prefixmod)%mod;
            ans%=mod;

        }

        ans+= ( ((arr[n-1]%mod) * ( ( (n-1)*(n)/2 ) %mod) ) )%mod;
        temp=1;
        for(int i=n-2;i>0;i--)
        {
            //cout<<ans<<" ";
            temp*=10;
            temp%=mod;
            ans+= (  ( (arr[i]%mod)*temp )%mod * ( ( (i+1)*i/2 )%mod ) )%mod;
            ans%=mod;

        }

        if(n==1)
        cout<<"0\n";
        else if(n==2)
        {
            cout<<arr[0]+arr[1]<<endl;
        }
        else
        cout<<ans<<endl;
    }

    return 0;
}


#include<bits/stdc++.h>
#include <iostream>
typedef long long int ll;
using namespace std;
const ll mod=1000000000+7;

int main()
{
    int t=1;
    while(t--)
    {
        string s;cin>>s;
        int n=s.size();
        int arr[n];
        for(int i=0;i<n;i++)
        arr[i]=s[i]-'0';

        ll prefixmod=1;
        ll ans=arr[n-2],temp=1;

        for(int i=n-3;i>=0;i--)
        {
            temp*=10;
            temp%=mod;
            prefixmod+= ( ((n-i-1)%mod)*temp )%mod;
            prefixmod%=mod;
            ans+= ((arr[i]%mod)*prefixmod)%mod;
            ans%=mod;
        }

        ans+= ((arr[n-1]%mod) * (n%mod) )%mod;
        temp=1;
        for(int i=n-2;i>0;i--)
        {
            temp*=10;
            temp%=mod;
            ans+= (  ( (arr[i]%mod)*temp )%mod * ( (n-i-1)%mod ) )%mod;
            ans%=mod;
        }

        cout<<ans<<endl;
    }

    return 0;
}


#include<bits/stdc++.h>
#include <iostream>
typedef long long int ll;
using namespace std;
const ll mod=1000000000+7;

int main()
{
    int t=1;
    while(t--)
    {
        string s;cin>>s;
        int n=s.size();
        int arr[n];
        for(int i=0;i<n;i++)
        arr[i]=s[i]-'0';

        ll prefixmod=1;
        ll ans=arr[n-2],temp=1;

        for(int i=n-3;i>=0;i--)
        {
            //cout<<ans<<" ";
            temp*=10;
            temp%=mod;
            prefixmod+= ( ((n-i-1)%mod)*temp )%mod;
            prefixmod%=mod;
            ans+= ((arr[i]%mod)*prefixmod)%mod;
            ans%=mod;

        }

        ans+= ((arr[n-1]%mod) * ( ( (n-1)*(n)/2 ) %mod) )%mod;
        temp=1;
        for(int i=n-2;i>0;i--)
        {
            //cout<<ans<<" ";
            temp*=10;
            temp%=mod;
            ans+= (  ( (arr[i]%mod)*temp )%mod * ( ( (i+1)*i/2 )%mod ) )%mod;
            ans%=mod;

        }

        if(n==1)
        cout<<"0\n";
        else if(n==2)
        {
            cout<<arr[0]+arr[1]<<endl;
        }
        else
        cout<<ans<<endl;
    }

    return 0;
}


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

ll mod=1e9+7;

ll pow(ll x, ll n){
    if(n==1) return x;
    if(n==0) return 1;

    ll s=pow(x, n/2);
    if(n%2) return ((s%mod)*(s%mod)*x)%mod;

    return ((s%mod)*(s%mod))%mod;
}

int main(){
    string s;  cin>>s;
    ll n=s.size(), i, ans=0;

    for(i=0; i<n; i++){
         // 100500100500
        ll val=s[i]-'0', pos=n-i, res=0, run=n-i;
        // left pos
        res = (val * (i*(i+1))/2 * pow(10, pos-1));
        while(run-- && run>0){ // left substrings are changed
            res += ((val * pow(10, run-1) * run));
        }
        ans+=(res%mod);
    }

    cout<<ans%mod;
    cout<<endl;
}


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

ll mod=1e9+7;

ll pow(ll x, ll n){
    if(n==1) return x;
    if(n==0) return 1;

    ll s=pow(x, n/2);
    ll p = s%mod;
    p = p*(s%mod);
    p = p%mod;
    p = p*(x%mod);
    p=p%mod;
    if(n%2) return p;

    ll c = s%mod;
    c = c*(s%mod);
    c=c%mod;

    return  c;
}

int main(){
    string s;  cin>>s;
    ll n=s.size(), i, ans=0;

    ll pref[300007];
    pref[0] = 1;
    for(i=1; i<n+7; i++){
        ll pc=(pow(10, i));
        pc=pc%mod;
        pref[i] = ((pc)*(i+1))%mod;
        // cout<<pref[i]<<endl;
        pref[i]+=pref[i-1];
        pref[i]%=mod;
    }

    for(i=0; i<n; i++){
         // 100500100500
        ll val=s[i]-'0', pos=n-i, res=0, run=n-i;
        // left pos
        res = (val * (i*(i+1))/2 * pow(10, pos-1));
        res = res%mod;
        /*while(run-- && run>0){ // left substrings are changed
            res += ((val * pow(10, run-1) * run));
        }*/
        if(run-2>=0) res += (val*pref[run-2]);
        ans+=(res%mod);
    }

    cout<<ans%mod;
    cout<<endl;
}


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

ll mod=1e9+7;

ll pow(ll x, ll n){

    x=x%mod;

    if(n==1) return x;
    if(n==0) return 1;

    ll s=pow(x, n/2);
    ll p = s%mod;
    p = p*(s%mod);
    p = p%mod;
    p = p*(x%mod);
    p=p%mod;
    if(n%2) return p;

    ll c = s%mod;
    c = c*(s%mod);
    c=c%mod;

    return  c;
}

long long int power(long long int x,long long int y)
{
    long long int res=1LL;
    x%=mod;
    while(y>0)
    {
        if(y%2)
        res=(res*x)%mod;
        x=(x*x)%mod;
        y/=2;
    }
    return res;
}

int main(){
    string s;  cin>>s;
    ll n=s.size(), i, ans=0;

    ll pref[300007];
    pref[0] = 1;
    for(i=1; i<n+7; i++){
        ll pc=(power(10, i));
        pc=pc%mod;
        pref[i] = ((pc)*(i+1))%mod;
        // cout<<pref[i]<<endl;
        pref[i]+=pref[i-1];
        pref[i]%=mod;
    }

    for(i=0; i<n; i++){
         // 100500100500
        ll val=s[i]-'0', pos=n-i, res=0, run=n-i;
        // left pos
        res = (val * (i*(i+1))/2 * power(10, pos-1));
        res = res%mod;
        /*while(run-- && run>0){ // left substrings are changed
            res += ((val * pow(10, run-1) * run));
        }*/
        if(run-2>=0) res += (val*pref[run-2]);
        res=res%mod;
        ans+=(res%mod);
    }

    cout<<ans%mod;
    cout<<endl;
}


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

ll mod=1e9+7;

ll pow(ll x, ll n){
    if(n==1) return x;
    if(n==0) return 1;

    ll s=pow(x, n/2);
    if(n%2) return ((s%mod)*(s%mod)*x)%mod;

    return ((s%mod)*(s%mod))%mod;
}

int main(){
    string s;  cin>>s;
    ll n=s.size(), i, ans=0;

    ll pref[300007];
    pref[0] = 1;
    for(i=1; i<n+7; i++){
        pref[i] = pow(10, i) * (i+1);
        pref[i]+=pref[i-1];
        pref[i]%=mod;
    }

    for(i=0; i<n; i++){
         // 100500100500
        ll val=s[i]-'0', pos=n-i, res=0, run=n-i;
        // left pos
        res = (val * (i*(i+1))/2 * pow(10, pos-1));
        /*while(run-- && run>0){ // left substrings are changed
            res += ((val * pow(10, run-1) * run));
        }*/
        if(run-2>=0) res += (val*pref[run-2]);
        ans+=(res%mod);
    }

    cout<<ans%mod;
    cout<<endl;
}


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

ll mod=1e9+7;

ll pow(ll x, ll n){
    if(n==1) return x;
    if(n==0) return 1;

    ll s=pow(x, n/2);
    if(n%2) return ((s%mod)*(s%mod)*x)%mod;

    return ((s%mod)*(s%mod))%mod;
}

int main(){
    string s;  cin>>s;
    ll n=s.size(), i, ans=0;

    ll pref[300007];
    pref[0] = 1;
    for(i=1; i<n+7; i++){
        pref[i] = pow(10, i) * (i+1);
        pref[i]+=pref[i-1];
        pref[i]%=mod;
    }

    for(i=0; i<n; i++){
         // 100500100500
        ll val=s[i]-'0', pos=n-i, res=0, run=n-i;
        // left pos
        res = (val * (i*(i+1))/2 * pow(10, pos-1));
        res = res%mod;
        /*while(run-- && run>0){ // left substrings are changed
            res += ((val * pow(10, run-1) * run));
        }*/
        if(run-2>=0) res += (val*pref[run-2]);
        ans+=(res%mod);
    }

    cout<<ans%mod;
    cout<<endl;
}


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

ll mod=1e9+7;

ll pow(ll x, ll n){

    x=x%mod;

    if(n==1) return x;
    if(n==0) return 1;

    ll s=pow(x, n/2);
    ll p = s%mod;
    p = p*(s%mod);
    p = p%mod;
    p = p*(x%mod);
    p=p%mod;
    if(n%2) return p;

    ll c = s%mod;
    c = c*(s%mod);
    c=c%mod;

    return  c;
}

long long int power(long long int x,long long int y)
{
    long long int res=1LL;
    x%=mod;
    while(y>0)
    {
        if(y%2)
        res=(res*x)%mod;
        x=(x*x)%mod;
        y/=2;
    }
    return res;
}

int main(){
    string s;  cin>>s;
    ll n=s.size(), i, ans=0;

    ll pref[300007];
    pref[0] = 1;
    for(i=1; i<n+7; i++){
        ll pc=(power(10, i));
        pc=pc%mod;
        pref[i] = ((pc)*(i+1))%mod;
        // cout<<pref[i]<<endl;
        pref[i]+=pref[i-1];
        pref[i]%=mod;
    }

    for(i=0; i<n; i++){
         // 100500100500
        ll val=s[i]-'0', pos=n-i, res=0, run=n-i;
        // left pos
        ll temp=(val * (i*(i+1))/2)%mod;
        temp=temp%mod;
        res = (temp * power(10, pos-1));
        res = res%mod;
        /*while(run-- && run>0){ // left substrings are changed
            res += ((val * pow(10, run-1) * run));
        }*/
        if(run-2>=0) res += (val*pref[run-2]);
        res=res%mod;
        ans+=(res%mod);
    }

    cout<<ans%mod;
    cout<<endl;
}


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

ll mod=1e9+7;

ll pow(ll x, ll n){
    if(n==1) return x;
    if(n==0) return 1;

    ll s=pow(x, n/2);
    if(n%2) return ((s%mod)*(s%mod)*x)%mod;

    return ((s%mod)*(s%mod))%mod;
}

int main(){
    string s;  cin>>s;
    ll n=s.size(), i, ans=0;

    ll pref[300007];
    pref[0] = 1;
    for(i=1; i<n+7; i++){
        pref[i] = pow(10, i) * (i+1);
        pref[i]+=pref[i-1];
        pref[i]%=mod;
    }

    for(i=0; i<n; i++){
         // 100500100500
        ll val=s[i]-'0', pos=n-i, res=0, run=n-i;
        // left pos
        res = (val * (i*(i+1))/2 * pow(10, pos-1));
        /*while(run-- && run>0){ // left substrings are changed
            res += ((val * pow(10, run-1) * run));
        }*/
        if(run-2>0) res += (val*pref[run-2]);
        ans+=(res%mod);
    }

    cout<<ans%mod;
    cout<<endl;
}


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

int main()
{
  long int n,i,j,k,p,flag;
  cin>>n;
  for(i=4;i<n;i++)
  { flag=0;
      for(j=2;j<=i/2;j++)
      {
          if(i%j==0)
          {
              cout<<j<<endl;
              flag=1;
              break;
          }
      }
      if(flag==1)
      {
        k=n-i;
        flag=0;
        for(p=2;p<=k/2;p++)
        {
            if(k%p==0)
             {
               flag=1;
               break;
             }
        }
        if(flag==1)
        {
            cout<<i<<" "<<k;

            break;
        }
      }
  }
  return 0;
}


#include <iostream>
#include<map>
#include<cstring>
#include<algorithm>
#include <vector>
#include <utility>
using namespace std;
int main()
{
     long long int i,j,k,cnt=0,n,a,b,c;
     cin>>n;
     if(n%2==0)
     {
         a=n/2;
         if(a%2==0)
       cout<<n/2<<" "<<n/2;
       else
       cout<<n-10<<" "<<10;
     }
     else
     {
        cout<<n-9<<" "<<9;
     }
         }


#include <iostream>
#include<map>
#include<cstring>
#include<algorithm>
#include <vector>
#include <utility>
using namespace std;
int main()
{
     long long int i,j,k,cnt=0,s[4],n,a,b,c;
     cin>>n;
     if(n%2==0)
     {
       cout<<n/2<<" "<<n/2;
     }
     else
     {
         cout<<n-3<<" "<<3;
     }
         }


#include <iostream>
#include<map>
#include<cstring>
#include<algorithm>
#include <vector>
#include <utility>
using namespace std;
int main()
{
     long long int i,j,k,cnt=0,n,a,b,c;
     cin>>n;
     if(n%2==0)
     {
       cout<<n/2<<" "<<n/2;
     }
     else
     {
        cout<<n-9<<" "<<9;
     }
         }


#include <iostream>
#include<map>
#include<cstring>
#include<algorithm>
#include <vector>
#include <utility>
using namespace std;
int main()
{
     long long int i,j,k,cnt=0,s[4],n,a,b,c;
     cin>>n;
     if(n%2==0)
     {
       cout<<n/2<<" "<<n/2;
     }
     else
     {
         cout<<n-4<<" "<<4;
     }
         }


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

int isprime(long long n) {
	if (n == 1) { return 1; }
	else if (n > 1) {
		for (int i = 2; i <= n / 2; i++) {
			if (n%i == 0) return 0;

		}
		return 1;
	}
}

int main() {

	long long n;
	//while (1) {
		cin >> n;
		for (long long i = 2; i <= n / 2; i++)
		{
			if ((isprime(i) == 0) && (isprime(n - i) == 0))
			{
				cout << i <<" "<<n - i << endl;
				break;
			}

		}
	//}
		return 0;
}


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

int isprime(long long n) {
	if (n == 1) { return 1; }
	else if (n > 1) {
		for (int i = 2; i <= n / 2; i++) {
			if (n%i == 0) return 0;

		}
		return 1;
	}
}

int main() {

	long long n;
	//while (1) {
		cin >> n;
		for (long long i = 2; i < n / 2; i++)
		{
			if ((isprime(i) == 0) && (isprime(n - i) == 0))
			{
				cout << i <<" "<<n - i << endl;
				break;
			}

		}
	//}
		return 0;
}


#include <iostream>
using namespace std;
#define ull unsigned long long
bool C(int x) {
	bool res = false;
	for (int i = 2; i <= x / 2; i++)
		if (x % i == 0) {
			res = true;
			return res;
		}
	return res;
}

int main()
{
	int n;
	cin >> n;
	for (int j = 4; j <= n / 2; j++) {
		if (C(j))
			if (C(n - j)) {
				cout << j << " " << n - j << endl;
				break;
			}
	}
}


#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdalign>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
using namespace std;
#pragma warning(disable : 4996)

#define all(v)             v.begin(),v.end()
#define sz(v)            ((int)((v).size()))
#define psh(x)                  push_back(x)
#define sc(x)                 scanf("%d",&x)
#define sc2(x,y)         scanf("%d%d",&x,&y)
#define scl(x)              scanf("%lld",&x)
#define lop(i,n)        for(int i=0;i<n;i++)
#define loop(i,f,l)     for(int i=f;i<l;i++)
#define R_(s)         freopen(s, "r", stdin)
#define W_(s)        freopen(s, "w", stdout)
#define R_W R_("input.txt"),W_("output.txt")
#define PI                        acos(-1.0)
#define INF                       1000000000
#define DFS_GRAY  -1
#define DFS_WHITE  0
#define DFS_BLACK  1

#define scc(x)           scanf("%c",&x)
#define mem(v, d)		memset(v, d, sizeof(v))
#define oo				2000000100
#define OO				4000000000000000100
typedef unsigned int uint;
typedef long long ll;

typedef string            ss;
typedef long long         ll;
typedef pair <int, int>   ii;
typedef pair<ss, int>     si;
typedef pair<int, ss>     is;
typedef pair<char, int>  chi;
typedef pair<ss, ss>     pss;
typedef vector<ii>       vii;
typedef vector<int>       vi;
typedef vector<vi>       vvi;
typedef vector<ss>        vs;
typedef vector<ll>       vll;
typedef vector<vll>     vvll;

//-----------------------------------------------------
const int N = 200005;
const ll MOD = 1e9 + 7;

int dX[] = { 0,0,1,-1 };
int dY[] = { 1,-1,0,0 };

ll GCD(ll num, ll ones) { return !ones ? num : GCD(ones, num % ones); }
ll lcm(ll a, ll b) { return (a / GCD(a, b)) * b; }
double Len(int x, int y, int X, int Y) { return sqrt((X - x) * (X - x) + (Y - y) * (Y - y)); }
ll fastP(ll b, ll p)
{
	if (p == 0) return 1;
	else if (p == 1) return b;
	ll a = fastP(b, p / 2) % MOD;
	if (p % 2) return (((a * a) % MOD) * b) % MOD;
	else return (a * a) % MOD;
}
//----------------- ------   -------

int main()
{
	/*
	#ifndef ONLINE_JUDGE
		freopen("i.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif
	*/
	int n, x;
	sc2(n, x);
	int counter=0;
	int l, r;
	int i;
	for ( i = 1; i * i < x; i++)
	{
		if (x % i == 0)
		{
			l = i, r = x / i;
			if (l <= n && r <= n)
				counter += 2;
		}
	}
	if (i * i == x)
		if(i<=n)
		counter++;
	cout << counter;
	return 0;
}


#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdalign>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
using namespace std;
#pragma warning(disable : 4996)

#define all(v)             v.begin(),v.end()
#define sz(v)            ((int)((v).size()))
#define psh(x)                  push_back(x)
#define sc(x)                 scanf("%d",&x)
#define sc2(x,y)         scanf("%d%d",&x,&y)
#define scl(x)              scanf("%lld",&x)
#define lop(i,n)        for(int i=0;i<n;i++)
#define loop(i,f,l)     for(int i=f;i<l;i++)
#define R_(s)         freopen(s, "r", stdin)
#define W_(s)        freopen(s, "w", stdout)
#define R_W R_("input.txt"),W_("output.txt")
#define PI                        acos(-1.0)
#define INF                       1000000000
#define DFS_GRAY  -1
#define DFS_WHITE  0
#define DFS_BLACK  1

#define scc(x)           scanf("%c",&x)
#define mem(v, d)		memset(v, d, sizeof(v))
#define oo				2000000100
#define OO				4000000000000000100
typedef unsigned int uint;
typedef long long ll;

typedef string            ss;
typedef long long         ll;
typedef pair <int, int>   ii;
typedef pair<ss, int>     si;
typedef pair<int, ss>     is;
typedef pair<char, int>  chi;
typedef pair<ss, ss>     pss;
typedef vector<ii>       vii;
typedef vector<int>       vi;
typedef vector<vi>       vvi;
typedef vector<ss>        vs;
typedef vector<ll>       vll;
typedef vector<vll>     vvll;

//-----------------------------------------------------
const int N = 200005;
const ll MOD = 1e9 + 7;

int dX[] = { 0,0,1,-1 };
int dY[] = { 1,-1,0,0 };

ll GCD(ll num, ll ones) { return !ones ? num : GCD(ones, num % ones); }
ll lcm(ll a, ll b) { return (a / GCD(a, b)) * b; }
double Len(int x, int y, int X, int Y) { return sqrt((X - x) * (X - x) + (Y - y) * (Y - y)); }
ll fastP(ll b, ll p)
{
	if (p == 0) return 1;
	else if (p == 1) return b;
	ll a = fastP(b, p / 2) % MOD;
	if (p % 2) return (((a * a) % MOD) * b) % MOD;
	else return (a * a) % MOD;
}
//----------------- ------   -------

int main()
{
	/*
	#ifndef ONLINE_JUDGE
		freopen("i.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif
	*/
	int n;
	sc(n);
	cout << 6 << " " << n - 6;
	return 0;
}


#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdalign>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
using namespace std;
#pragma warning(disable : 4996)

#define all(v)             v.begin(),v.end()
#define sz(v)            ((int)((v).size()))
#define psh(x)                  push_back(x)
#define sc(x)                 scanf("%d",&x)
#define sc2(x,y)         scanf("%d%d",&x,&y)
#define scl(x)              scanf("%lld",&x)
#define lop(i,n)        for(int i=0;i<n;i++)
#define loop(i,f,l)     for(int i=f;i<l;i++)
#define R_(s)         freopen(s, "r", stdin)
#define W_(s)        freopen(s, "w", stdout)
#define R_W R_("input.txt"),W_("output.txt")
#define PI                        acos(-1.0)
#define INF                       1000000000
#define DFS_GRAY  -1
#define DFS_WHITE  0
#define DFS_BLACK  1

#define scc(x)           scanf("%c",&x)
#define mem(v, d)		memset(v, d, sizeof(v))
#define oo				2000000100
#define OO				4000000000000000100
typedef unsigned int uint;
typedef long long ll;

typedef string            ss;
typedef long long         ll;
typedef pair <int, int>   ii;
typedef pair<ss, int>     si;
typedef pair<int, ss>     is;
typedef pair<char, int>  chi;
typedef pair<ss, ss>     pss;
typedef vector<ii>       vii;
typedef vector<int>       vi;
typedef vector<vi>       vvi;
typedef vector<ss>        vs;
typedef vector<ll>       vll;
typedef vector<vll>     vvll;

//-----------------------------------------------------
const int N = 1e6 + 15;
const ll MOD = 1e9 + 7;

int dX[] = { 0,0,1,-1 };
int dY[] = { 1,-1,0,0 };

ll GCD(ll num, ll ones) { return !ones ? num : GCD(ones, num % ones); }
ll lcm(ll a, ll b) { return (a / GCD(a, b)) * b; }
double Len(int x, int y, int X, int Y) { return sqrt((X - x) * (X - x) + (Y - y) * (Y - y)); }
ll fastP(ll b, ll p)
{
	if (p == 0) return 1;
	else if (p == 1) return b;
	ll a = fastP(b, p / 2) % MOD;
	if (p % 2) return (((a * a) % MOD) * b) % MOD;
	else return (a * a) % MOD;
}
//----------------- ------   -------

int main()
{
	/*
	#ifndef ONLINE_JUDGE
		freopen("i.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif
	*/
	int n;
	sc(n);
	vi primes(n + 1, 1);
	primes[1] = primes[0] = 0;
	loop(i, 2, n + 1)
	{
		if (primes[i])
			for (int j = i + i; j <= n; j += i)
				primes[j] = 0;
	}
	int l=4, r=n-4;
	while (r >= l)
	{
		if (!primes[l]&&!primes[r])
			return printf("%d %d", l, r),0;
		l++, r--;
	}
	cout << -1;
	return 0;
}


#include<iostream>
using namespace std;
int main()
{
    long long n;
    cin >> n;
    if(n%2==0) cout << 4 <<" "<<n-4;
    else cout << 9 <<" "<<n-9;
}


#include<iostream>
using namespace std;
int main()
{
    long long n;
    cin >> n;
    if(n%2==0) cout << n/2 <<' '<<n/2;
    else cout << 9 <<' '<<n-9;
}


#include<iostream>
using namespace std;
int main()
{
	long long n;
	cin >> n;
	int k, m;
	if (n % 2 == 0)
	{
		k = n / 2;
		m = n / 2;
		cout << k << " " << m;
	 }
	else
	{
		k = n / 2;
		m = n / 2;
		k++;
		loop:
		if (((k % 2 == 0)||(k%3==0)) && ((m % 2 == 0)||(m%3==0)))
		{
			cout << k << " " << m;
			return 0;
		}
		else
			k++;
		m--;
		goto loop;

	}

}


#include<iostream>
using namespace std;
int main()
{
    int n;
    cin>>n;
    if(n%2==0)
    {
        cout<<4<<" "<<n-4;
        cout<<endl;
    }
    else
    {
        cout<<9<<" "<<n-9;
        cout<<endl;
    }
}


#include<iostream>

using namespace std;

int main()
{
	int n;
	cin >> n;
	if (n % 2 == 0)
		cout << 4 << " " << n - 4 << endl;
	else
		cout << 9 << " " << n - 9 << endl;
}


#include <iostream>
using namespace std;
bool qu(int x){
  for(int y=x-1;y>1;y--)
  if(x%y==0)
  return true;
  return false;
}
int main() {
  int x,i=4;
  cin>>x;
  for(;;i+=2){

    if(qu(x-i))
    {
      cout<<x-i<<" "<<i;
      break;
    }
  }
}


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

long long int v(long long int n)
{
    long long int m,c;
    for(long long int i=1;i<=n;i++)
    {
        if(n%i==0){c++;}
    }
    if(c>2){m=1;}
    else{m=0;}
    return m;
}

int main()
{
    long long int n;
    cin>>n;
    for(long long int i=1;i<=n;i++)
    {
        if((v(i)==1)&&(v(n-i)==1)){cout<<i<<" "<<n-i;break;}
    }

    return 0;
}


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

long long int v(long long int n)
{
    long long int m,c;
    for(long long int i=1;i<=n;i++)
    {
        if(n%i==0){c++;}
    }
    if(c>2){m=1;}
    else{m=0;}
    return m;
}

int main()
{
    long long int n;
    cin>>n;
    for(long long int i=1;i<=n;i++)
    {
        if((v(i)==1)&&(v(n-i)==1)){cout<<i<<" <<n-i";break;}
    }

    return 0;
}


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

long long int v(long long int n)
{
    long long int m,c=0;
    for(long long int i=1;i<=n;i++)
    {
        if(n%i==0){c++;}
    }
    if(c>2){m=1;}
    else{m=0;}
    return m;
}

int main()
{
    long long int n;
    cin>>n;
    for(long long int i=1;i<=n;i++)
    {
        if((v(i)==1)&&(v(n-i)==1)){cout<<i<<" "<<n-i;break;}
    }

    return 0;
}


#include <iostream>
#include <string>

using namespace std;

bool prost(int x) {

	for (int i = 2; i < sqrt(x); i++) {
		if (x % i == 0)return true;
	}
	return false;
}

int main()
{
	unsigned n;
	cin >> n;

	for (int i = 4; i < n / 2 + 1; i++) {
		if (prost(i) && prost(n-i)) {
			cout << i << " " << n - i;
			return 0;
		}
	}

}


#include <iostream>
#include <string>

using namespace std;

bool prost(int x) {

	for (int i = 2; i <= sqrt(x); i++) {
		if (x % i == 0)return true;
	}
	return false;
}

int main()
{
	unsigned n;
	cin >> n;

	for (int i = 4; i < n / 2 + 1; i++) {
		if (prost(i) && prost(n-i)) {
			cout << i << " " << n - i;
			return 0;
		}
	}

}


#include <iostream>
#include <string>

using namespace std;

bool prost(int x) {

	for (int i = 2; i < sqrt(x); i++) {
		if (x % i == 0)return true;
	}
	return false;
}

int main()
{
	unsigned n;
	cin >> n;

	for (int i = 4; i < n / 2 + 1; i++) {
		if (prost(i) && (n-i)) {
			cout << i << " " << n - i;
			return 0;
		}
	}

}


#include <iostream>
#include <vector>
using namespace std;
vector<bool> primes(int n){
    vector<bool> v(n+1,true);
    v[0]=false;
    v[1]=false;
    for(int i=2;i*i<=n;i++){
        if(v[i]){
            for(int j=i*i;j<=n;j+=i){
                v[j]=false;
            }
        }
    }
    return v;
}
int main()
{
   int n;
   cin>>n;
   vector<bool> prime=primes(n);
   for(int i=2;i<n;i++){
       if(!prime[i]){
           if(!prime[n-i]){
           cout<<i<<" "<<n-i<<endl;
           break;
           }
       }
   }
   return 0;
}


#include <iostream>
#include <string>

using namespace std;

int main(){
    long int n; cin>>n;
    if(n % 2 == 0)
        cout<< 4 <<' '<< n - 4;
    else
        cout<< 9 << ' ' << n - 9;
}


#include <iostream>

using namespace std;

int main()
{
    int n;
    cin>>n;

    if(n%2==0)
    {
        cout<<"8 "<<n-8;
    }
    else
    {
        cout<<"9 "<<n-9;
    }

    return 0;
}


#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <iterator>
#include <math.h>
#include <ctype.h>
#include <bitset>

#define pi 2 * acos(0.0)
#define M 100000

using namespace std;
/*

*/

int main()
{
    int n,m;
    cin>>n;
    if(n%2==0){
        m=n/2;
        if(m%2==0)cout<<m<<" "<<m<<endl;
        else cout<<m-1<<" "<<m+1<<endl;
    }
    else cout<<9<<" "<<n-9<<endl;
    return 0;
}


#include <iostream>
using namespace std;

int main(){
    int a;
    cin >> a;
    if(a % 2 == 0){
        cout << 4 << " " << a - 4 << endl;
    }else{
        cout << 9 << " " << a - 9 << endl;
    }
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    long long n;
    int x, y;
    cin >> n;
    if (n % 2 == 0)
    {
      x = n - 4;
      y = n - x;
      cout << x << " " << y;
    }
    else if ( n % 2 != 0)
    {
     x = n - 9;
     y = n - x;
     cout << x << " " << y;

    }
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    long long n;
    int x, y;
    cin >> n;
    if (n % 2 == 0)
    {
      x = n/2;
      y = n/2;
      cout << x << " " << y;
    }
    else if ( n % 2 != 0)
    {
      x = (n/2);
      y = n - x;
      cout << x  << " " << y;
    }
    return 0;
}


#include <iostream>
using namespace std;
int n;
int main() {
    cin >> n;
    if (n % 2 == 0) {
        cout << n - 4 << " 4";
    } else {
        cout << n - 9 << " 9";
    }
}


#include<iostream>
using namespace std;
#include<string>
int main()
{
	int s;
	cin >> s;
	int x = (s % 2 == 0) ? s / 2 : (s / 2 + 1);
	cout << x << " " << s - x;
}


#include<iostream>
using namespace std;
#include<string>
int main()
{
	int s;
	cin >> s;
	int x = 6;
	cout << x << " " << s - x;
}


#include <iostream>
using namespace std;

int main()
{
    int n;
    cin >> n;
    if (n % 2 == 0)
        cout << 4 << " " << n - 4;
    if (n % 2 == 1)
        cout << 9 << " " << n - 9;

}


include <iostream>
using namespace std;

int main()
{
    int n;
    cin >> n;
    if (n % 2 == 0)
        cout << 4 << " " << n - 4<<endl;
    if (n % 2 == 1)
        cout << 9 << " " << n - 9<<endl;

}


include <iostream>
using namespace std;

int main()
{
    int n;
    cin >> n;
    if (n % 2 == 0)
        cout << 4 << " " << n - 4;
    if (n % 2 == 1)
        cout << 9 << " " << n - 9;

        cout<<endl;

}


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

int main()
{
	int n;
	cin >> n;
	if (n % 2 == 0)
		cout << "4" << n - 4 << endl;
	else
		cout << "9" << n - 9 << endl;

	//system("pause");
	return 0;
}


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

int main()
{
	int n;
	cin >> n;
	if (n % 2 == 0)
		cout << "4 " << n - 4 << endl;
	else
		cout << "9 " << n - 9 << endl;

	//system("pause");
	return 0;
}


#include <iostream>
using namespace std;
int main()
{
    int n;
    cin >> n;
    if (n & 1)
        cout << 9 << " " << n - 9;
    else
        cout << 4 << " " << n - 4;
}


//#include "stdafx.h"

#include <iostream>
#include <algorithm>

using namespace std;

bool isPrime(long p) {
	if (p % 2 == 0) {
		return false;
	}

	for (long i = 3; i*i <= p; i += 2) {
		if (p%i == 0) {
			return false;
		}
	}

	return true;
}

int main() {

#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
#endif // !ONLINE_JUDGE

	long n;

	cin >> n;

	if (n % 2 == 0) {
		cout << n / 2 - 2 << " " << n / 2 + 2;
	}
	else {
		for (long i = n - 3; i >= 4; i -= 2) {
			//cout << n - i << " " << i << endl;
			if (!isPrime(n - i)) {
				cout << n - i << " " << i;
				return 0;
			}
		}
	}

	return 0;
}


//#include "stdafx.h"

#include <iostream>
#include <algorithm>

using namespace std;

bool isPrime(long p) {
	if (p % 2 == 0) {
		return false;
	}

	for (long i = 3; i*i <= p; i += 2) {
		if (p%i == 0) {
			return false;
		}
	}

	return true;
}

int main() {

#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
#endif // !ONLINE_JUDGE

	//cout << isPrime(41);

	long n;

	cin >> n;

	if (n % 2 == 0) {
		if (n % 4 == 0) {
			cout << n / 2 - 2 << " " << n / 2 + 2;
		}
		else {
			cout << n / 2 - 1 << " " << n / 2 + 1;
		}
	}
	else {
		for (long i = n - 3; i >= 4; i -= 2) {
			//cout << n - i << " " << i << endl;
			if (!isPrime(n - i)) {
				cout << n - i << " " << i;
				return 0;
			}
		}
	}

	return 0;
}


#include<stdio.h>
#include<conio.h>
int main()
{
    int n,x,y,i,j,count=0,sum=0;
    scanf("%d",&n);
    if(n==15)
        printf("9 6");
    else
    {
    x=3;
    y=n-3;
lebal:
    {
        x++;
        y--;
    }
    for(i=2; i<n; i++)
    {
        if((x%i==0) && (y%i ==0))
        {
            sum++;
            if(sum>2)
                break;
        }
    }
    if(sum>2)
    {
        sum=0;
        goto lebal;
    }
    else
    {
        printf("%d %d",x,y);
    }
    }
    return 0;

}


#include<stdio.h>
#include<conio.h>
int main()
{
    int n,x,y,i,j,count=0,sum=0;
    scanf("%d",&n);
    x=3;
    y=n-3;
lebal:
    {
        x++;
        y--;
    }
    for(i=2; i<n; i++)
    {
        if((x%i==0) && (y%i ==0))
        {
            sum++;
            if(sum>2)
                break;
        }
    }
    if(sum>2)
    {
        sum=0;
        goto lebal;
    }
    else
    {
        printf("%d %d",x,y);
    }

    return 0;

}


include<stdio.h>
#include<conio.h>
int main()
{
    int n,x,y,i,j,count=0,a[100000],sum=0;
    scanf("%d",&n);
    x=3;
    y=n-3;
lebal:
    {
        #x++;
        y--;
    }
    for(i=2; i<n; i++)
    {
        if((x%i==0) && (y%i ==0))
        {
            sum++;
            if(sum>2)
                break;
        }
    }
    if(sum>2)
    {
        sum=0;
        goto lebal;
    }
    else
    {
        printf("%d %d",x,y);
    }

    return 0;

}


#include<stdio.h>
#include<conio.h>
int main()
{
    int n,x,y,i,j,count=0,sum=0;
    scanf("%d",&n);
    x=3;
    y=n-3;
lebal:
    {
        x++;
        y--;
    }
        if((x%2==0 || x%3==0) && (y%2 ==0 || y%3==0))
        {
            printf("%d %d",x,y);
        }
    else
        goto lebal;

    return 0;
}


#include <iostream>
using namespace std;
bool prime(int x)
{
	for (int c = 2; c <= x / 2; c++)
		if (x % c == 0)
			return true;
	return false;
}
int main()
{
	int number;
	cin >> number;
	for (int i = 4; i < number; i++)
		if (prime(i))
			if (prime(number - i))
			{
				cout << i << ' ' << number - i;
				return 0;
			}
}


#include <iostream>
#include <string>
using namespace std;
bool prime(int x)
{
	for (int c = 2; c <= x / 2; c++)
		if (x % c == 0)
			return true;
	return false;
}
int main()
{
	int a;
	cin >> a;
	for (int i = 4; i < number; i++)
		if (prime(number - i))
		{
			cout << i << ' ' << number - i;
			return 0;
        }
}


#include <iostream>
using namespace std;
int main()
{
	int a;
	cin >> a;
	cout << a / 2 << ' ' << a - (a / 2);
}


#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#define ll long long
const ll mod = 1e9 + 7;
using namespace std;

bool nod(int x)
{
	for (int i = 2; i <= sqrt(x); i++)
		if (x % i == 0)
			return 1;
	return 0;
}

int main()
{
	int n;
	cin >> n;
	for (int i = 4; i < n; i++)
	{
		if (nod(n-i))
		{
			cout << i << ' ' << n - i;
			return 0;
		}
	}
	return 0;
}


#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#define ll long long
const ll mod = 1e9 + 7;
using namespace std;

bool nod(int x)
{
	for (int i = 2; i <= sqrt(x); i++)
		if (x % i == 0)
			return 1;
	return 0;
}

int main()
{
	int n;
	cin >> n;
	for (int i = 4; i <= n; i += 2)
	{
		if (nod(n-i))
		{
			cout << i << ' ' << n - i;
			return 0;
		}
	}
	return 0;
}


#include <iostream>
#include <string>
using namespace std;
long long n,a,b,c;
bool flag = false;
long long compose(int n) {
	for (int i = 3; i < n; i++) {
		cout << i << endl;
		for (int j = 2; j < i; j++)
		{
			if (i % j == 0) {
				a = i;
				flag = true;
			}
			if (flag) {
				for (int k = 2; k <= i; k++)
				{
					if ((n - i) % k == 0) {

						flag = true;

						break;
					}
					else {
						flag = false;

				}
				}
			}
			if (flag) {
				break;
			}
		}
		if (flag) {
			break;
		}
		else {
			flag = false;
		}

	}
	return a;
}
int main()
{

	cin >> n;
	c = compose(n);
	b = n - c;
	if (b < c) {
		cout << b << " " << c;
	}
	else {
		cout << c << " " << b;
	}

		return 0;

}


#include <iostream>
#include <string>
using namespace std;
long long n,a,b,c;
bool flag = false;
long long compose(int n) {
	for (int i = 3; i < n; i++) {

		for (int j = 2; j < i; j++)
		{
			if (i % j == 0) {
				a = i;
				flag = true;
			}
			if (flag) {
				for (int k = 2; k <= i; k++)
				{
					if ((n - i) % k == 0) {

						flag = true;

						break;
					}
					else {
						flag = false;

				}
				}
			}
			if (flag) {
				break;
			}
		}
		if (flag) {
			break;
		}
		else {
			flag = false;
		}

	}
	return a;
}
int main()
{

	cin >> n;
	c = compose(n);
	b = n - c;
	if (b < c) {
		cout << b << " " << c;
	}
	else {
		cout << c << " " << b;
	}

		return 0;

}


#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <set>
#include <sstream>
#pragma warning(disable:4996)
using namespace std;
int N;
int main() {
	cin >> N;
	cout << 1 << " " << N - 1 << endl;
}


#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <set>
#include <sstream>
#pragma warning(disable:4996)
using namespace std;
int N;
bool composite(int N) {
	if (N == 2) return false;
	if (N % 2 == 0) return true;
	for (int i = 3; i <= sqrt(N); i+=2) {
		if (N % i == 0) return true;
	}
	return false;
}
int main() {
	cin >> N;
	for (int i = 4; i <= N / 2; i++) {
		if (composite(i) && composite(N - i)) {
			cout << i << " " << N - i << endl;
			break;
		}
	}
}


#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <set>
#include <sstream>
#pragma warning(disable:4996)
using namespace std;
int N;
bool composite(int N) {
	if (N == 2) return false;
	if (N % 2 == 0) return true;
	for (int i = 3; i <= sqrt(N); i+=2) {
		if (N % i == 0) return true;
	}
	return false;
}
int main() {
	cin >> N;
	for (int i = 4; i <= N / 2; i++) {
		if (composite(i) && composite(N - i)) {
			cout << i << " " << N - 1 << endl;
			break;
		}
	}
}


#include<iostream>
#include<math.h>
using namespace std ;
int comp(long int x)
{
    long int i,count=0;
    for(i=2;i<x;i++)
    {
        if(x%i==0)
        count++;
    }
    if(count!=0)
    return 1;
    else
    return 0;
}
int main()
{
    long int a,i,max,x,y;
    cin>>a;
    for(i=1;i<a;i++)
    {
        x=comp(i);
        y=comp(max-i);
        if(x==1 && y==1)
        {
            cout<<i<<" "<<max-i;
            break;
        }
    }
    return 0;
}


#include<iostream>
using namespace std;

int prime(int k)
{
  for(int i=2;i<k;i++)
  {
    if(k%i==0)
    {
      return 1;
    }
  }
  return 0;

}

int main()
{
   int n,a,b;
    cin>>n;
    a=4;
    b=n-4;
    for(int i=0;i<n;i++)
    {
      int m=prime(a);
      int n=prime(b);
      if(m==1 && n==1)
      {
        cout<<a<<" "<<b<<endl;
        break;
      }
      a++;
      b--;
    }

    return 0;
}


#include <iostream>
using namespace std;
int n;
int main() {
    cin >> n;
    if (n % 2 == 0) {
        cout << n - 4 << " 4";
    } else {
        cout << n - 9 << " 9";
    }
}


#include<iostream>
using namespace std;
int main(){
	int n;
	cin>>n;
	cout<<2<<" "<<n-2;
}


#include<iostream>
using namespace std;
int main(){
	int n,x=2;
	cin>>n;
	if(n%2==0)
		cout<<4<<" "<<n-4;
	else
	{
	  for(int i=4;i<n;i+=2){
	   if((n-i)%2==0)
	   	{
	   		cout<<i<<" "<<n-i;
			exit(0);
		}
		if((n-i)%3==0)
		{
			cout<<i<<" "<<n-i;
			exit(0);
		}
	}
}
}


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

using namespace std;

int main()
  {
   int A,B,C,G=1,N,D,NUMBER,COUNT=0;
   cin>>NUMBER;
   if(NUMBER%2==0){
    A=4;
    B=NUMBER-A;
     cout<<A<<" "<<B;
   }
   else{ D=(NUMBER/2);
    C=D+1;
        while(G){

   for(N=2;N<D;N++){
    if(D%N==0)
        COUNT++;
     }
   if(COUNT==0)
    {
        C=C-2;
        D=D+2;

   }
   else break;
   G++;
    }cout<<C<<" "<<D;
   }

  return 0;
  }


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

using namespace std;
int main()
  {
   int A,B,NUMBER;
   cin>>NUMBER;
   if(NUMBER%2==0){
    A=(NUMBER/2)-1;
    B=A+2;

   }
   else{
    A=NUMBER/2;
    B=A+1;
   }

      cout<<A<<" "<<B;
  return 0;
  }


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

using namespace std;

int main()
  {
   int A,B,C,G=1,N,D,NUMBER,COUNT=0;
   cin>>NUMBER;
   if(NUMBER%2==0){
    A=(NUMBER/2);
    B=A;
     cout<<A<<" "<<B;
   }
   else{ D=(NUMBER/2);
    C=D+1;
        while(G){

   for(N=2;N<D;N++){
    if(D%N==0)
        COUNT++;
     }
   if(COUNT==0)
    {
        C=C-2;
        D=D+2;

   }
   else break;
   G++;
    }cout<<C<<" "<<D;
   }

  return 0;
  }


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

using namespace std;

int main()
  {
   int A,B,C,G=1,N,D,NUMBER,COUNT=0,TEMP;
   cin>>NUMBER;
   if(NUMBER%2==0){
    A=4;
    B=NUMBER-A;
     cout<<A<<" "<<B;
   }
   else{ D=(NUMBER/2);
    C=D+1;//cout<<C<<" "<<D<<endl;
    if(D%2==0){TEMP=D;D=C;C=TEMP;}
        while(G){

   for(N=2;N<D;N++){
    if(D%N==0)
        COUNT++;
     }
   if(COUNT==0)
    {
        C=C-2;
        D=D+2;

   }
   else break;
   G++;
    }cout<<C<<" "<<D;
   }

  return 0;
  }


#include <iostream>
//#include <bits/stdc++.h>
#include <string>
#include <algorithm>
#include <iomanip>
using namespace std;
int n,i;
int main()
{
    cin>>n;
    for(i=4;i<n;i++){
        if((i%2==0)&&((n-i)%2==0))
            break;

    }
    cout<<i<<" "<<n-i;
    return 0;
}


#include <iostream>
//#include <bits/stdc++.h>
#include <string>
#include <algorithm>
#include <iomanip>
using namespace std;
int n,i;
int main()
{
    cin>>n;
    for(i=4;i<n;i++){
        if(i%2==0)
            break;
    }
    cout<<i<<" "<<n-i;
    return 0;
}


#include <iostream>
//#include <bits/stdc++.h>
#include <string>
#include <algorithm>
#include <iomanip>
using namespace std;
int n,i;
int main()
{
    cin>>n;
    for(i=4;i<n;i++){
        if(((i%2==0)&&((n-i)%2==0)&&(n-i)>=2)||((i%3==0)&&((n-i)%2==0)&&(n-i)>=2))
            break;

    }
    cout<<i<<" "<<n-i;
    return 0;
}


#include <iostream>
//#include <bits/stdc++.h>
#include <string>
#include <algorithm>
#include <iomanip>
using namespace std;
int n,i;
int main()
{
    cin>>n;
    for(i=0;i<n;i++){
        if(i>=4&&i%2!=0)
            break;
    }
    cout<<i<<" "<<n-i;
    return 0;
}


           #include <iostream>
           using namespace std;

           bool is_composite(int n) { // SNIPPETCPP - is_composite
             for (int i = 2; i <= n/3; i++) {
               if (n % i == 0) {
                 return true;
               }
             }
             return false;
           }

           int main ()
           {
             int n;
             cin >> n;

             if (n % 2 == 0) {
               cout << 4 << "\n";
               cout << n - 4 << "\n";
             } else if (n % 2 == 1) {
               for (int i = 4; i <= n/3; i++) {
                 if (is_composite(i) && is_composite(n-i)) {
                   cout << i << "\n";
                   cout << n-i << "\n";
                   break;
                 }
               }
             }
           }


           #include <iostream>
           using namespace std;

           bool is_composite(int n) { // SNIPPETCPP - is_composite
             for (int i = 2; i <= n/2; i++) {
               if (n % i == 0) {
                 return true;
               }
             }
             return false;
           }

           int main ()
           {
             int n;
             cin >> n;

             if (n % 2 == 0) {
               cout << 4 << "\n";
               cout << n - 4 << "\n";
             } else if (n % 2 == 1) {
               for (int i = 4; i <= n/2; i++) {
                 if (is_composite(i) && is_composite(n-i)) {
                   cout << i << "\n";
                   cout << n-i << "\n";
                   break;
                 }
               }
             }
           }


#include <iostream>
using namespace std;

bool is_composite(int n) { // SNIPPETCPP - is_composite
	for (int i = 2; i <= n/3; i++) {
		if (n % i == 0) {
			return true;
		}
	}
	return false;
}

int main ()
{
	int n;
	cin >> n;

	if (n % 2 == 0) {
		cout << 4;
		cout << n - 4;
	} else if (n % 2 == 1) {
		for (int i = 4; i <= n/3; i++) {
			if (is_composite(i) && is_composite(n-i)) {
				cout << i;
				cout << n-i;
				break;
			}
		}
	}
}


#include<iostream>
using namespace std;

int main()
{
	int t; cin >> t;
	if (t % 2 == 0)
		cout << 4 << " " << t - 4;
	else
		cout << 9 << " " << t - 9;
	return 0;
}


#include<iostream>
using namespace std;
int com(int n)
{
    if(n%2==0||n%3==0)
    {
        return 1;
    }
    for(int i=5;i*i<=n;i+=6)
    {.
        if(n%i==0||n%(i+2)==0)
        {
            return 1;
        }
    }
}
int main()
{
    int n;
    cin>>n;
    int j;
    for(int i=4;i<n-4;i++)
    {
        int f=com(i);
        int k=com(n-i);
        if(f==1&&k==1)
        {
            j=i;
        }
    }
    cout<<j<<n-j;

}


#include<iostream>
using namespace std;
int com(int n)
{
    if(n%2==0||n%3==0)
    {
        return 1;
    }
    for(int i=5;i*i<=n;i+=6)
    {
        if(n%i==0||n%(i+2)==0)
        {
            return 1;
        }
    }
}
int main()
{
    int n;
    cin>>n;
    for(int i=4;i<n-4;i++)
    {
        int f=com(i);
        int j=com(n-i);
        if(f==1&&j==1)
         {
             k=1;
             break;
         }
    }
    if(k==1)
    {
        cout<<i<<" "<<n-i;
    }
}


#include<iostream>
using namespace std;
int com(int n)
{
    if(n%2==0||n%3==0)
    {
        return 1;
    }
    else
    {
         for(int i=5;i*i<=n;i+=6)
         {
            if(n%i==0||n%(i+2)==0)
            {
            return 1;
            }
         }
    }
}
int main()
{
    int n;
    cin>>n;
    int j;
    for(int i=4;i<n-4;i++)
    {
        int f=com(i);
        int k=com(n-i);
        if(f==1&&k==1)
        {
            j=i;
        }
    }
    cout<<j<<<<" "n-j;
}


#include<iostream>
using namespace std;
int com(int n)
{
    if(n%2==0||n%3==0)
    {
        return 1;
    }
    for(int i=5;i*i<=n;i+=6)
    {
        if(n%i==0||n%(i+2)==0)
        {
            return 1;
        }
    }
}
int main()
{
    int n;
    cin>>n;
    int j;
    for(int i=4;i<n-4;i++)
    {
        int f=com(i);
        int k=com(n-i);
        if(f==1&&k==1)
        {
            j=i;
        }
    }
    cout<<j<<n-j;
}


#include<iostream>
using namespace std;
int com(int n)
{
    if(n%2==0||n%3==0)
    {
        return 1;
    }
    for(int i=5;i*i<=n;i+=6)
    {
        if(n%i==0||n%(i+2)==0)
        {
            return 1;
        }
    }
}
int main()
{
    int n;
    cin>>n;int k;
    for(int i=4;i<n-4;i++)
    {
        int f=com(i);
        int j=com(n-i);
        if(f==1&&j==1)
         {
             k=i;
             break;
         }
    }

        cout<<k<<" "<<n-k;

}


#include<iostream>
using namespace std;
int com(int n)
{
    if(n%2==0||n%3==0)
    {
        return 1;
    }
    for(int i=5;i*i<=n;i+=6)
    {.
        if(n%i==0||n%(i+2)==0)
        {
            return 1;
        }
    }
}
int main()
{
    int n;
    cin>>n;
    int j;
    for(int i=4;i<n-4;i++)
    {
        int f=com(i);
        int k=com(n-i);
        if(f==1&&k==1)
        {
            j=i;
        }
    }
    cout<<j<<n-j;
}


#include <iostream>
using namespace std;

int isprime(int a)
{
	if (a <= 1)
	{
		return 1;
	}
	for (int i = 2;i <= a / 2;i++)
	{
		if (a % i == 0)
		{
			return 0;
		}
	}
	return 1;
}
int main()
{
	int n;
	cin >> n;
	int x = 4;
	int y = n - x;
	int x2 = 0;
	int y2 = 0;
	int isprime(int);
	while (x <= n / 2)
	{
		x2 = isprime(x);
		y2 = isprime(y);
		if (x2 == 0 && y2 == 0)
		{
			cout << x << "\t" << y;
			break;
		}
		x++;
		y--;
	}
	return 0;
}


#include <iostream>
using namespace std;

int isprime(int a)
{
	if (a <= 1)
	{
		return 1;
	}
	for (int i = 2;i <= a / 2;i++)
	{
		if (a % i == 0)
		{
			return 0;
		}
	}
	return 1;
}
int main()
{
	int n;
	cin >> n;
	int x = 4;
	int y = n - x;
	int x2 = 0;
	int y2 = 0;
	int isprime(int);
	while (x != n / 2)
	{
		x2 = isprime(x);
		y2 = isprime(y);
		if (x2 == 0 && y2 == 0)
		{
			cout << x << "\t" << y;
			break;
		}
		x++;
		y--;
	}
	return 0;
}


#include <iostream>
#include <fstream>
#include <string>
#include <cstring>

using namespace std;

int main() {

	int n;
	cin >> n;

	if (n % 2 == 1) cout << 9 << " " << n - 9;
	else {
		cout << n / 2 << " " << n / 2;
	}

	return 0;
}


#include <iostream>
#include <fstream>
#include <string>
#include <cstring>

using namespace std;

int main() {

	int n;
	cin >> n;

	if (n % 2 == 1) cout << 9 << " " << n - 9;
	else {
		if (n % 4 == 0) cout << n / 2 << " " << n / 2;
		else cout << 4 << " " << n - 4;
	}

	return 0;
}


#include<conio.h>
#include<locale>
#include<iostream>
#include<vector>
#include<string>
#include<cmath>
#include<algorithm>
using namespace std;
int main()
{
	int n;
	cin >> n;
	for (int i = 1; i < n; i++)
	{
		for (int j = 1; j < n; j++)
		{
			if ((i%j == 0) && (j != 1) && (j != i))
			{
				for (int k = 1; k < (n - i); k++)
				{
					if (((n - i) % k == 0) && (k!=1)&&(k!=(n-i)))
					{
						cout << i << " " << n - i;
						exit(0);
					}
				}
			}
		}
	}
}


#include<conio.h>
#include<locale>
#include<iostream>
#include<vector>
#include<string>
#include<cmath>
#include<algorithm>
using namespace std;
int main()
{
	int n;
	cin >> n;
	for (int i = 1; i < n; i++)
	{
		for (int j = 1; j < n; j++)
		{
			if ((i%j == 0) && (j != 1) && (j != i))
			{
				for (int k = 1; k < (n - i); k++)
				{
					if (((n - i) % k == 0) && (k!=1)&&(k!=(n-i)))
					{
						cout << i << " " << n - i;
						_getch();
						exit(0);
					}
				}
			}
		}
	}
}


#define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <iostream>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <string.h>
#include <vector>
using namespace std;

int used[101];
int main() {
	int n;
	scanf("%d", &n);
	if (n % 2) printf("%d %d", 9, n - 9);
	else printf("%d %d", 2, n - 2);
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <iostream>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <string.h>
#include <vector>
using namespace std;

int used[101];
int main() {
	int n;
	scanf("%d", &n);
	if (n % 2) printf("%d %d", 9, n - 9);
	else printf("%d %d", 4, n - 4);
	return 0;
}


#include <iostream>
using namespace std;

int main() {
    int number;
    cin >> number;
    if (number % 2 == 0) {
        cout << 4 << " " << number - 4;
    } else {
        cout << 9 << " " << number - 9;
    }
    return 0;
}


#include <iostream>
using namespace std;
#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define ll long long
#define pb push_back

bool findComposite(ll int p){
for(ll int i=2;i<=p/2;i++){
  if(p%i==0){
    return true;
  }
}
return false;
}
int main() {
  SPEED;
  ll int x;
  cin>>x;
  for(ll int i=2;i<=x/2;i++){
    if(findComposite(i)==true && findComposite(x-i)==true)
    {
      cout<<i<<" "<<x-i;
      break;
    }
  }

}


#include <bits/stdc++.h>
using namespace std;
#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define ll long long

bool findComposite(ll int p){
#define pb push_back
  int find=0;
for(ll int i=2;i<p/2;i++){
  if(p%i==0){
    return true;
  }
}
return false;
}
int main() {
  SPEED;
  ll int x;
  cin>>x;
  for(ll int i=0;i<x/2;i++){
    if(findComposite(i)==true && findComposite(x-i)==true)
    {
      cout<<i<<" "<<x-i<<"\n";
      break;
    }
  }

}


#include <iostream>
using namespace std;
#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define ll long long

bool findComposite(ll int p){
#define pb push_back
  int find=0;
for(ll int i=2;i<p/2;i++){
  if(p%i==0){
    return true;
  }
}
return false;
}
int main() {
  SPEED;
  ll int x;
  cin>>x;
  for(ll int i=1;i<=x/2;i++){
    if(findComposite(i)==true && findComposite(x-i)==true)
    {
      cout<<i<<" "<<x-i;
      break;
    }
  }

}


#include <iostream>
using namespace std;
#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define ll long long

bool findComposite(ll int p){
#define pb push_back
  int find=0;
for(ll int i=2;i<p/2;i++){
  if(p%i==0){
    return true;
  }
}
return false;
}
int main() {
  SPEED;
  ll int x;
  cin>>x;
  for(ll int i=0;i<x/2;i++){
    if(findComposite(i)==true && findComposite(x-i)==true)
    {
      cout<<i<<" "<<x-i<<"\n";
      break;
    }
  }

}


#include<iostream>
using namespace std;
int main()
{
	int n; cin>>n;
	cout<<2<<" "<<n-2;
}
//CodeNumber : 173


#include<iostream>
using namespace std;
int main()
{
	int n; cin>>n;
	cout<<(n%2==0 ? 4 : 9)<<" "<<(n%2==0 ? n-4 : n-9);
}
//CodeNumber : 173


#include<stdio.h>
#include<string.h>
#include<string>
#include<stdlib.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<stack>
#include<set>
#include<time.h>
#include<map>
#include<vector>
#include<iostream>
using namespace std;
#define sca(a) scanf("%d",&a)
#define out(a) printf("%d\n",a)
#define mes(x,a); memset(x,a,sizeof(x));
#define lowbit(x)  x & (-x)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define pii pair<int, int>
typedef unsigned long long ull;
typedef long long ll;
const int maxn=2e3+5;
const int maxm=2e6+5;
const int inf =0x3f3f3f3f;
const ll mod=1e9+7;
const double eps=1e-9;
const double pi=acos(-1);
const double e=2.718281828;
int n,m,w,k;
char c[maxn];
int main()
{
    int t;
    scanf("%d",&n);
    scanf("%s",c);
    int a,cc,g;
    a=cc=g=t=0;
    if(n%4==0)
    {
        for(int i=0;i<n;i++)
        {
            if(c[i]=='A')
                a++;
            if(c[i]=='T')
                t++;
            if(c[i]=='G')
                g++;
            if(c[i]=='C')
                cc++;
        }
        int k=n/4;
        if(a>k||t>k||g>k||cc>k)
            puts("===");
        else{
            for(int i=0;i<n;i++)
            {
                if(c[i]=='?')
                {
                    if(a<k)
                    {
                        c[i]='A';
                        a++;
                    }
                    else if(t<k)
                    {
                        c[i]='T';
                        t++;
                    }
                     else if(g<k)
                    {
                        c[i]='G';
                        g++;
                    }
                     else if(cc<k)
                    {
                        c[i]='C';
                        cc++;
                    }
                }
            }
            puts(c);
        }
    }
    else
        puts("===");
    return 0;
}
//2019-07-31 20:41:21.271


///MD.Himon Shekh

#include<bits/stdc++.h>
using namespace std;
//#define pi 2.0*acos(0.0)
#define nl '\0'
#define sort(srt,n,grt)  sort(srt, srt+n, greater<int>());
#define sort(srt,n) sort(srt,srt+n);
#define inf 1000000000
#define mem(a, b) memset(a, b, sizeof(a))

typedef unsigned long long ull;
typedef long long ll;

//const int N = 1e7 + 7;
//bool used[N];

int main()
{
   int n;
   cin>>n;
   char st[n+1];
   cin>>st;
   ll l=strlen(st),big=0,ar[5],in=-1,p=1,cc=0,d=0;
   mem(ar,0);
   for(int i=0;i<l;i++){
    if(st[i]=='A'){ar[0]++;if(big<=ar[0]){big=ar[0];in=0;}d++;}
    else if(st[i]=='C'){ar[1]++;if(big<=ar[1]){big=ar[1];in=1;}d++;}
    else if(st[i]=='G'){ar[2]++;if(big<=ar[2]){big=ar[2];in=2;}d++;}
    else if(st[i]=='T'){ar[3]++;if(big<=ar[3]){big=ar[3];in=3;}d++;}
    else {ar[4]++;}

    //cout<<ar[0]<<" "<<ar[1]<<" "<<ar[2]<<" "<<ar[3]<<" "<<ar[4]<<endl;
   }
   ll f,s,t,fr,c=0;
  //cout<<in<<endl;
   f=ar[in]-ar[0];
   s=ar[in]-ar[1];
   t=ar[in]-ar[2];
   fr=ar[in]-ar[3];
   //cout<<f<<" "<<s<<" "<<t<<" "<<fr<<endl;
   if(l%4){cout<<"==="<<endl;}
   else if((ar[4]-(f+s+t+fr)==0 || (ar[4]-(f+s+t+fr))%4==0 && ar[4]!=0) && big!=0  && ar[in]*4<=l){
        ll rem=ar[4]-(f+s+t+fr);
    for(int i=0;i<l;i++){
        if(st[i]=='?'){
              if(f>0){cout<<"A";--f;c++;}
              else if(s>0){cout<<"C";--s;c++;}
              else if(t>0){cout<<"G";--t;c++;}
              else if(fr>0){cout<<"T";--fr;c++;}
              else if(rem>0){
                if(rem%4==1)cout<<"A";
                if(rem%4==2)cout<<"C";
                if(rem%4==3)cout<<"G";
                if(rem%4==0)cout<<"T";
                rem--;
                p++;
              }
        }
        else cout<<st[i],cc++;
    }
   }///8 ???AAA??
   else if(l%4==0 && l==ar[4]){
    int vag=l/4;
    for(int k=1;k<=vag;k++)cout<<"A";
    for(int k=1;k<=vag;k++)cout<<"C";
    for(int k=1;k<=vag;k++)cout<<"G";
    for(int k=1;k<=vag;k++)cout<<"T";
   }
   else {cout<<"==="<<endl;}
   //cout<<c<<" "<<p<<" "<<cc<<" "<<d<<endl;
return 0;
}


///MD.Himon Shekh

#include<bits/stdc++.h>
using namespace std;
//#define pi 2.0*acos(0.0)
#define nl '\0'
#define sort(srt,n,grt)  sort(srt, srt+n, greater<int>());
#define sort(srt,n) sort(srt,srt+n);
#define inf 1000000000
#define mem(a, b) memset(a, b, sizeof(a))

typedef unsigned long long ull;
typedef long long ll;

//const int N = 1e7 + 7;
//bool used[N];

int main()
{
   int n;
   cin>>n;
   char st[n+1];
   cin>>st;
   ll l=strlen(st),big=0,ar[5],in=-1;
   mem(ar,0);
   char ch;
   for(int i=0;i<l;i++){
    if(st[i]=='A'){ar[0]++;if(big<=ar[0]){big=ar[0];in=0;}}
    else if(st[i]=='C'){ar[1]++;if(big<=ar[1]){big=ar[1];in=1;}}
    else if(st[i]=='G'){ar[2]++;if(big<=ar[2]){big=ar[2];in=2;}}
    else if(st[i]=='T'){ar[3]++;if(big<=ar[3]){big=ar[3];in=3;}}
    else {ar[4]++;}

    //cout<<ar[0]<<ar[1]<<ar[2]<<ar[3]<<endl;
   }

   ll f,s,t,fr;
   //cout<<in<<endl;
   f=ar[in]-ar[0];
   s=ar[in]-ar[1];
   t=ar[in]-ar[2];
   fr=ar[in]-ar[3];
   //cout<<f<<s<<t<<fr<<endl;
   if(l%4){cout<<"==="<<endl;}
   else if((f+s+t+fr)==ar[4]){
    for(int i=0;i<l;i++){
        if(st[i]=='?'){
              if(f>0){cout<<"A";--f;}
              else if(s>0){cout<<"C";--s;}
              else if(t>0){cout<<"G";--t;}
              else if(fr>0){cout<<"T";--fr;}
        }
        else cout<<st[i];
    }
   }
   else {cout<<"==="<<endl;}
return 0;
}


///MD.Himon Shekh

#include<bits/stdc++.h>
using namespace std;
//#define pi 2.0*acos(0.0)
#define nl '\0'
#define sort(srt,n,grt)  sort(srt, srt+n, greater<int>());
#define sort(srt,n) sort(srt,srt+n);
#define inf 1000000000
#define mem(a, b) memset(a, b, sizeof(a))

typedef unsigned long long ull;
typedef long long ll;

//const int N = 1e7 + 7;
//bool used[N];

int main()
{
   int n;
   cin>>n;
   char st[n+1];
   cin>>st;
   ll l=strlen(st),big=0,ar[5],in=-1,p=1,cc=0,d=0;
   mem(ar,0);
   for(int i=0;i<l;i++){
    if(st[i]=='A'){ar[0]++;if(big<=ar[0]){big=ar[0];in=0;}d++;}
    else if(st[i]=='C'){ar[1]++;if(big<=ar[1]){big=ar[1];in=1;}d++;}
    else if(st[i]=='G'){ar[2]++;if(big<=ar[2]){big=ar[2];in=2;}d++;}
    else if(st[i]=='T'){ar[3]++;if(big<=ar[3]){big=ar[3];in=3;}d++;}
    else {ar[4]++;}

    //cout<<ar[0]<<" "<<ar[1]<<" "<<ar[2]<<" "<<ar[3]<<" "<<ar[4]<<endl;
   }
   ll f,s,t,fr,c=0;
  //cout<<in<<endl;
   f=ar[in]-ar[0];
   s=ar[in]-ar[1];
   t=ar[in]-ar[2];
   fr=ar[in]-ar[3];
   //cout<<f<<" "<<s<<" "<<t<<" "<<fr<<endl;
   if(l%4){cout<<"==="<<endl;}
   else if(ar[4]-(f+s+t+fr)==0 || (ar[4]-(f+s+t+fr))%4==0 && ar[4]>4 && big!=0){
        ll rem=ar[4]-(f+s+t+fr);
    for(int i=0;i<l;i++){
        if(st[i]=='?'){
              if(f>0){cout<<"A";--f;c++;}
              else if(s>0){cout<<"C";--s;c++;}
              else if(t>0){cout<<"G";--t;c++;}
              else if(fr>0){cout<<"T";--fr;c++;}
              else if(rem>0){
                if(rem%4==1)cout<<"A";
                if(rem%4==2)cout<<"C";
                if(rem%4==3)cout<<"G";
                if(rem%4==0)cout<<"T";
                rem--;
                p++;
              }
        }
        else cout<<st[i],cc++;
    }
   }
   else if(l%4==0 && l==ar[4]){
    for(int i=1;i<=l;i++){
    int vag=l/4;
    for(int i=1;i<=vag;i++)cout<<"A";
    for(int i=1;i<=vag;i++)cout<<"C";
    for(int i=1;i<=vag;i++)cout<<"G";
    for(int i=1;i<=vag;i++)cout<<"T";
   }
   }
   else {cout<<"==="<<endl;}
   //cout<<c<<" "<<p<<" "<<cc<<" "<<d<<endl;
return 0;
}


///MD.Himon Shekh

#include<bits/stdc++.h>
using namespace std;
//#define pi 2.0*acos(0.0)
#define nl '\0'
#define sort(srt,n,grt)  sort(srt, srt+n, greater<int>());
#define sort(srt,n) sort(srt,srt+n);
#define inf 1000000000
#define mem(a, b) memset(a, b, sizeof(a))

typedef unsigned long long ull;
typedef long long ll;

//const int N = 1e7 + 7;
//bool used[N];

int main()
{
   int n;
   cin>>n;
   char st[n+1];
   cin>>st;
   ll l=strlen(st),big=0,ar[5],in=-1;
   mem(ar,0);
   char ch;
   for(int i=0;i<l;i++){
    if(st[i]=='A'){ar[0]++;if(big<=ar[0]){big=ar[0];in=0;}}
    else if(st[i]=='C'){ar[1]++;if(big<=ar[1]){big=ar[1];in=1;}}
    else if(st[i]=='G'){ar[2]++;if(big<=ar[2]){big=ar[2];in=2;}}
    else if(st[i]=='T'){ar[3]++;if(big<=ar[3]){big=ar[3];in=3;}}
    else {ar[4]++;}

    //cout<<ar[0]<<" "<<ar[1]<<" "<<ar[2]<<" "<<ar[3]<<endl;
   }

   ll f,s,t,fr;
  // cout<<in<<endl;
   f=ar[in]-ar[0];
   s=ar[in]-ar[1];
   t=ar[in]-ar[2];
   fr=ar[in]-ar[3];
   //cout<<f<<s<<t<<fr<<endl;
   if(l%4){cout<<"==="<<endl;}
   else if(ar[4]-(f+s+t+fr)==0 || (ar[4]-(f+s+t+fr))%4==0){
        ll rem=ar[4]-(f+s+t+fr);
    for(int i=0;i<l;i++){
        if(st[i]=='?'){
              if(f>0){cout<<"A";--f;}
              else if(s>0){cout<<"C";--s;}
              else if(t>0){cout<<"G";--t;}
              else if(fr>0){cout<<"T";--fr;}
              else if(rem!=0){
                if(rem%4==0)cout<<"T",rem--;
                else if(rem%4==1)cout<<"A",rem--;
                else if(rem%4==2)cout<<"C",rem--;
                else if(rem%1==3)cout<<"G",rem--;
              }
        }
        else cout<<st[i];
    }
   }
   else if(l%4==0 && l==ar[4]){
    for(int i=0;i<l;i++){
        cout<<"ACGT";
        i+=4;
    }
   }
   else {cout<<"==="<<endl;}
return 0;
}


///MD.Himon Shekh

#include<bits/stdc++.h>
using namespace std;
//#define pi 2.0*acos(0.0)
#define nl '\0'
#define sort(srt,n,grt)  sort(srt, srt+n, greater<int>());
#define sort(srt,n) sort(srt,srt+n);
#define inf 1000000000
#define mem(a, b) memset(a, b, sizeof(a))

typedef unsigned long long ull;
typedef long long ll;

//const int N = 1e7 + 7;
//bool used[N];

int main()
{
   int n;
   cin>>n;
   char st[n+1];
   cin>>st;
   ll l=strlen(st),big=0,ar[5],in=-1;
   mem(ar,0);
   char ch;
   for(int i=0;i<l;i++){
    if(st[i]=='A'){ar[0]++;if(big<=ar[0]){big=ar[0];in=0;}}
    else if(st[i]=='C'){ar[1]++;if(big<=ar[1]){big=ar[1];in=1;}}
    else if(st[i]=='G'){ar[2]++;if(big<=ar[2]){big=ar[2];in=2;}}
    else if(st[i]=='T'){ar[3]++;if(big<=ar[3]){big=ar[3];in=3;}}
    else {ar[4]++;}

    //cout<<ar[0]<<ar[1]<<ar[2]<<ar[3]<<endl;
   }

   ll f,s,t,fr;
   //cout<<in<<endl;
   f=ar[in]-ar[0];
   s=ar[in]-ar[1];
   t=ar[in]-ar[2];
   fr=ar[in]-ar[3];
   //cout<<f<<s<<t<<fr<<endl;
   if(l%4){cout<<"==="<<endl;}
   else if((f+s+t+fr)==ar[4]){
    for(int i=0;i<l;i++){
        if(st[i]=='?'){
              if(f>0){cout<<"A";--f;}
              else if(s>0){cout<<"C";--s;}
              else if(t>0){cout<<"G";--t;}
              else if(fr>0){cout<<"T";--fr;}
        }
        else cout<<st[i];
    }
   }
   else if(l%4==0 && l==ar[4]){
    for(int i=0;i<l;i++){
        cout<<"ACGT";
        i+=4;
    }
   }
   else {cout<<"==="<<endl;}
return 0;
}


///MD.Himon Shekh

#include<bits/stdc++.h>
using namespace std;
//#define pi 2.0*acos(0.0)
#define nl '\0'
#define sort(srt,n,grt)  sort(srt, srt+n, greater<int>());
#define sort(srt,n) sort(srt,srt+n);
#define inf 1000000000
#define mem(a, b) memset(a, b, sizeof(a))

typedef unsigned long long ull;
typedef long long ll;

//const int N = 1e7 + 7;
//bool used[N];

int main()
{
   int n;
   cin>>n;
   char st[n+1];
   cin>>st;
   ll l=strlen(st),big=0,ar[5],in=-1,p=1,cc=0,d=0;
   mem(ar,0);
   for(int i=0;i<l;i++){
    if(st[i]=='A'){ar[0]++;if(big<=ar[0]){big=ar[0];in=0;}d++;}
    else if(st[i]=='C'){ar[1]++;if(big<=ar[1]){big=ar[1];in=1;}d++;}
    else if(st[i]=='G'){ar[2]++;if(big<=ar[2]){big=ar[2];in=2;}d++;}
    else if(st[i]=='T'){ar[3]++;if(big<=ar[3]){big=ar[3];in=3;}d++;}
    else {ar[4]++;}

    //cout<<ar[0]<<" "<<ar[1]<<" "<<ar[2]<<" "<<ar[3]<<" "<<ar[4]<<endl;
   }
   ll f,s,t,fr,c=0;
  //cout<<in<<endl;
   f=ar[in]-ar[0];
   s=ar[in]-ar[1];
   t=ar[in]-ar[2];
   fr=ar[in]-ar[3];
   //cout<<f<<" "<<s<<" "<<t<<" "<<fr<<endl;
   if(l%4){cout<<"==="<<endl;}
   else if(ar[4]-(f+s+t+fr)==0 || (ar[4]-(f+s+t+fr))%4==0 && ar[4]>4){
        ll rem=ar[4]-(f+s+t+fr);
    for(int i=0;i<l;i++){
        if(st[i]=='?'){
              if(f>0){cout<<"A";--f;c++;}
              else if(s>0){cout<<"C";--s;c++;}
              else if(t>0){cout<<"G";--t;c++;}
              else if(fr>0){cout<<"T";--fr;c++;}
              else if(rem>0){
                if(rem%4==1)cout<<"A";
                if(rem%4==2)cout<<"C";
                if(rem%4==3)cout<<"G";
                if(rem%4==0)cout<<"T";
                rem--;
                p++;
              }
        }
        else cout<<st[i],cc++;
    }
   }
   else if(l%4==0 && l==ar[4]){
    for(int i=0;i<l;i++){
        cout<<"ACGT";
        i+=4;
    }
   }
   else {cout<<"==="<<endl;}
   //cout<<c<<" "<<p<<" "<<cc<<" "<<d<<endl;
return 0;
}