#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
template <class T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
mt19937/*_64*/ rng(chrono::steady_clock::now().time_since_epoch().count());
#define printArr(arr, n) cerr << #arr << " = ["; for(int i=0; i<(n); i++){if (i) cerr << ", "; cerr << arr[i];} cerr << "]\n"
template<class A> ostream& operator<<(ostream &cout, vector<A> const &v) {cout << "["; for(int i = 0; i < v.size(); i++) {if (i) cout << ", "; cout << v[i];} return cout << "]";};
template<class A, class B> ostream& operator<<(ostream &cout, const pair<A,B> &x) {return cout << "(" <<x.first << ", " << x.second << ")";};
void _print() {cerr << "]\n";}
template <class T, class... V> void _print(T t, V... v) {cerr << t; if (sizeof...(v)) cerr << ", "; _print(v...);}
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#define fi first
#define se second
#define SZ(x) (int)((x).size())
#define pii pair<int,int>
template<int modd> struct modint {
	static const int mod = modd;
	int v; explicit operator int() const { return v;}
	modint() : v(0) {}
	modint(ll x) : v(int(x%mod)) {if (v < 0) v += mod;}
	friend bool operator==(const modint& a, const modint& b) {return a.v == b.v;}
	friend bool operator!=(const modint& a, const modint& b) {return a.v != b.v;}
	friend bool operator<(const modint& a, const modint& b) {return a.v < b.v;}
	modint& operator+=(const modint& a) {if ((v += a.v) >= mod) v -= mod; return *this;}
	modint& operator-=(const modint& a) {if ((v -= a.v) < 0) v += mod; return *this;}
	modint& operator*=(const modint& a) {v = int((ll)v*a.v%mod); return *this;}
	modint& operator/=(const modint& a) {return (*this) *= inv(a);}
	friend modint pow(modint a, ll p) {modint ret = 1; for (; p; p /= 2, a *= a){if (p&1) ret *= a;} return ret;}
	friend modint inv(const modint& a) {return pow(a,mod-2);}
	modint operator-() const {return modint(-v);}
	modint& operator++() {return *this += 1;}
	modint& operator--() {return *this -= 1;}
	friend modint operator+(modint a, const modint& b) {return a += b;}
	friend modint operator-(modint a, const modint& b) {return a -= b;}
	friend modint operator*(modint a, const modint& b) {return a *= b;}
	friend modint operator/(modint a, const modint& b) {return a /= b;}
	friend ostream& operator<<(ostream& out, modint a) {return out << a.v;}
	friend istream& operator>>(istream& in, modint& a) {ll b; in >> b; a.v = b; return in;}
};
using mint = modint<998244353>;
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	int n,m,k;
	cin >> n >> m >> k;
	if (n == 1) {
		if (m == 1) {
			cout << k << "\n";
		} else {
			mint x = k;
			cout << pow(x,m) << "\n";
		}
	} else {
		if (m == 1) {
			mint x = k;
			cout << pow(x,n) << "\n";
		} else {
			mint ans = 0;
			for (int q = 1; q <= k; q++) {
				mint x = pow(mint(q),n) - pow(mint(q-1),n);
				x *= pow(mint(k-q+1),m);
				ans += x;
			}
			cout << ans << "\n";
		}
	}
	return 0;
}


#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;

const int N = 40, M = 1<<(N / 2);

int n, t, a[N];

vector<ll> v1(M), v2(M);

int main() {
  cin >> n >> t;
  rep(i, n) cin >> a[i];

  rep(bit, M) {
    ll now = 0;
    rep(i, N / 2) {
      if (bit & 1<<i) {
        now += a[i];
      }
    }
    v1[bit] = now;
  }

  rep(bit, M) {
    ll now = 0;
    rep(i, N / 2) {
      if (bit & 1<<i) {
        now += a[N / 2 + i];
      }
    }
    v2[bit] = -now;
  }

  sort(v2.begin(), v2.end());

  ll ans = 0;
  rep(i1, M) {
    ll now = v1[i1];
    if (now > t) continue;
    int i2 = lower_bound(v2.begin(), v2.end(), now - t) - v2.begin();
    now -= v2[i2];
    ans = max(ans, now);
  }
  cout << ans << endl;
  return 0;
}
