#include<bits/stdc++.h>

using namespace std;

#define ll long long int
#define tc ll t;cin>>t;while(t--)
#define PI 2*acos(0)
#define mset(pq) memset(pq, 0, sizeof(pq));

ll M=1e9+7;

int sum_digit(int x) { int sum=0; while(x>0){ sum+=x%10; x/=10; } return sum; }
int reverse_num(int n){ int tmp=n, ans=0, r; while(tmp>0){ r=tmp%10; ans=ans*10+r; tmp/=10; } return ans; }
ll factorial(ll n){ ll i, ans=1; for(i=n; i>1; i--){ans*=i;} return ans; }
ll gcd(ll num1, ll num2) { ll a,b,r; a=num1; b=num2; r=a%b; while(r>0){ a=b; b=r; r=a%b; } return b; }
ll lcm(ll num1, ll num2) { return (num1*num2)/gcd(num1, num2); }

void solve()
{
    int n, m, a, b, c, d, x, y, z, p;

    cin >> a >> b;
    x = sum_digit(a);
    y = sum_digit(b);

    cout << max(x, y);
}

int main()
{
    //tc
    solve();
    return 0;
}

/*

*/
// reverse(s.begin(), s.end()); // reversing a string
// getline( cin, s);
/*
vector <int> arr;
for(i=0; i<n; i++)
    arr.push_back(i);
*/

#include <bits/stdc++.h>
#define rep(i,N) for(int i=0; i<(N); i++)
using namespace std;
 
int main() {
  int64_t N;
  cin >> N;
  
  vector<int64_t> a(0);
  for(int64_t i=1; i*i<=N; i++){
    if(i*i == N){
      a.push_back(i);
      continue;
    }
    
    if(N%i == 0){
      a.push_back(i);
      a.push_back(N/i);
    }
  }
  
  sort(a.begin(),a.end());
  int64_t n=a.size();
  rep(i,n) cout << a[i] << endl;
}