#include<bits/stdc++.h>
using namespace std;
#define mp make_pair
#define ll long long int
#define sz(x) (int)(x.size())
#define FOR(i,x,y) for(int i=x;i<=y;++i)
#define FORN(i,x,y) for(int i=x;i>=y;--i)
#define debug(x )cout<<'['<<#x<<" is "<<x<<"]"<<endl;
#define yes cout<<"YES"<<endl;
#define no cout<<"NO"<<endl;
#define endl '\n';
void solve() {
    ll arr[3];
    ll mod=998244353;
    cin>>arr[0]>>arr[1]>>arr[2];
    arr[0]%=mod;
    arr[1]%=mod;
    arr[2]%=mod;
    sort(arr,arr+3);
    ll ans=0;
    ans+=(arr[2]*(arr[2]+1)/2)%mod;
    ans%=mod;
    ans*=(arr[1]*(arr[1]+1)/2)%mod;
    ans%=mod;
    ans*=(arr[0]*(arr[0]+1)/2)%mod;
    cout<<ans%mod<<endl;


}
int main() {
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#ifdef CLION
    freopen("input.in", "r", stdin);
#endif
    // seive();
   // ll t;cin>>t;while(t--) {
        solve();
    //}
    return 0;
}
#include <bits/stdc++.h>          
using namespace std;
using ll = long long;
using ld = long double;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define repp(i, st, en) for (ll i = (ll)st; i < (ll)(en); i++)
#define repm(i, st, en) for (ll i = (ll)st; i >= (ll)(en); i--)
#define all(v) v.begin(), v.end()
void chmax(ll &x, ll y) {x = max(x,y);}
void chmin(ll &x, ll y) {x = min(x,y);}
void Yes() {cout << "Yes" << endl; exit(0);}
void No() {cout << "No" << endl; exit(0);}
template<class in_Cout> void Cout(in_Cout x) {cout << x << endl; exit(0);}
template<class in_vec_cout>
void vec_cout(vector<in_vec_cout> vec) {
    for (in_vec_cout res : vec) {cout << res << " ";}
    cout << endl;
}

const ll inf = 1e18;
const ll mod = 1e9 + 7;

int main() {
    ll a, b, c; cin >> a >> b >> c;
    if (a==b) Cout(c);
    if (b==c) Cout(a);
    if (c==a) Cout(b);
    Cout(0);
}