//つぶあん つぶす #include using namespace std; typedef long long ll; typedef pair l_l; typedef pair i_i; template inline bool chmax(T &a, T b) { if(a < b) { a = b; return true; } return false; } template inline bool chmin(T &a, T b) { if(a > b) { a = b; return true; } return false; } const long double EPS = 1e-10; const long long INF = 1e18; const long double PI = acos(-1.0L); const ll mod = 998244353; ll inv[10000100]; ll FactorialInv[10000100]; ll Factorial[10000100]; ll beki(ll a, ll b){ a %= mod; if(b == 0){ return 1; } ll ans = beki(a, b / 2); ans = ans * ans % mod; if(b % 2 == 1){ ans = ans * a % mod; } return ans; } void init_combination(){ const int MAX = 10000002; Factorial[0] = 1; inv[0] = 1; for(int i = 1; i <= MAX; i++){ Factorial[i] = Factorial[i - 1] * i % mod; } FactorialInv[MAX] = beki(Factorial[MAX], mod - 2); for(ll i = MAX - 1; i >= 0; i--) { FactorialInv[i] = FactorialInv[i+1] * (i+1) % mod; } for(int i = 1; i <= MAX; i++) { inv[i] = FactorialInv[i] * Factorial[i-1] % mod; } } ll combination(ll a, ll b){ if((a == b) || (b == 0)){ return 1; } if(a < b) return 0; ll ans = Factorial[a] * FactorialInv[b] % mod; ans = ans * FactorialInv[a - b] % mod; return ans; } ll N, M; ll ans[3]; void ANSWER() { for(int i = 0; i < 3; i++) { if(i != 0) cout << " "; cout << ans[i]; } cout << endl; } int main() { //cout.precision(10); cin.tie(0); ios::sync_with_stdio(false); init_combination(); cin >> N >> M; ans[0] = beki(2, N); ans[1] = 1; for(int i = 0; i < N; i++) { ans[1] *= beki(2, M - i) - 1; ans[1] %= mod; ans[1] *= beki(2, i); ans[1] %= mod; } for(int Empty = 0; Empty <= N + 1; Empty++) { ll tmp = combination(N + 1, Empty); tmp *= beki(N + 1 - Empty, M); tmp %= mod; //cerr << Empty << " " << tmp << endl; if(Empty & 1) ans[2] -= tmp; else ans[2] += tmp; //cerr << ans[2] << endl; } for(int Empty = 0; Empty <= N; Empty++) { ll tmp = combination(N, Empty); tmp *= beki(N - Empty, M); tmp %= mod; //cerr << Empty << " " << tmp << endl; if(Empty & 1) ans[2] -= tmp; else ans[2] += tmp; //cerr << ans[2] << endl; } ans[1] *= FactorialInv[N]; ans[1] %= mod; ans[2] %= mod; ans[2] *= FactorialInv[N]; ans[2] %= mod; ans[2] += mod; ans[2] %= mod; ANSWER(); return 0; }