AT_abc398_d [ABC398D] Bonfire

Description

There is an infinitely large two-dimensional grid, with a campfire at coordinate $ (0,0) $ . At time $ t=0 $ , smoke exists only at cell $ (0,0) $ . You are given a length- $ N $ string $ S $ consisting of `N`, `W`, `S`, `E`. At times $ t=1,2,\dots,N $ , the following happen in order: - Wind blows, and all the smoke present at that time moves as follows: - If the $ t $ -th character of $ S $ is `N`, smoke in cell $ (r,c) $ moves to cell $ (r-1,c) $ . - If it is `W`, smoke in cell $ (r,c) $ moves to cell $ (r,c-1) $ . - If it is `S`, smoke in cell $ (r,c) $ moves to cell $ (r+1,c) $ . - If it is `E`, smoke in cell $ (r,c) $ moves to cell $ (r,c+1) $ . - If there is no smoke in cell $ (0,0) $ , new smoke is generated at cell $ (0,0) $ . Takahashi is standing at cell $ (R,C) $ . For each integer $ 1 \le t \le N $ , determine if smoke exists at cell $ (R,C) $ at time $ t+0.5 $ , and print the response according to the required format.

Input Format

The input is given from Standard Input in the following format: > $ N $ $ R $ $ C $ $ S $

Output Format

Print an $ N $ -character string consisting of `0` and `1`. The $ t $ -th character ( $ 1 \le t \le N $ ) should be: - `1` if smoke exists at cell $ (R,C) $ at time $ t+0.5 $ , and - `0` otherwise.

Explanation/Hint

### Sample Explanation 1 At times $ 1.5,2.5,4.5,6.5 $ , there is no smoke at cell $ (-2,1) $ . At times $ 3.5,5.5 $ , there is smoke at cell $ (-2,1) $ . Hence, output `001010`. In the figures below, taking cell $ (0,0) $ with the campfire as a reference, cell $ (r,c) $ is drawn: - $ -r $ cells up if $ r < 0 $ , - $ r $ cells down if $ r \ge 0 $ , - $ -c $ cells left if $ c < 0 $ , - $ c $ cells right if $ c \ge 0 $ . The grid at time $ 0.5 $ looks like: ![](https://cdn.luogu.com.cn/upload/vjudge_pic/AT_abc398_d/f81282a82f8d41810cb80c0213f16f93d32ebc7ff5e4537492f92937d9d74dbb.png) The grid at time $ 1.5 $ looks like: ![](https://cdn.luogu.com.cn/upload/vjudge_pic/AT_abc398_d/c6267eb1ee903b8845738ff9adc9113302e53f2946431e91d73a017a538aaee0.png) The grid at time $ 2.5 $ looks like: ![](https://cdn.luogu.com.cn/upload/vjudge_pic/AT_abc398_d/e19fd4aeb39e794b144ec269a9ac83c845a593f877d1e157eb9da2e3950d179e.png) The grid at time $ 3.5 $ looks like: ![](https://cdn.luogu.com.cn/upload/vjudge_pic/AT_abc398_d/3d9ab0813fa1b6497c3c2a91f98cac20dc0c26ec67af04ded46ca3de69d9e522.png) The grid at time $ 4.5 $ looks like: ![](https://cdn.luogu.com.cn/upload/vjudge_pic/AT_abc398_d/6b406df9b7d106576cdd797c095564b035893a429e45c42a57b0fb4ec4d0184a.png) The grid at time $ 5.5 $ looks like: ![](https://cdn.luogu.com.cn/upload/vjudge_pic/AT_abc398_d/38b695dc998b7a41f351a7a35e5ef9dec75e1df0799799261f2cd4a50dd389f8.png) The grid at time $ 6.5 $ looks like: ![](https://cdn.luogu.com.cn/upload/vjudge_pic/AT_abc398_d/1997ae841303a3e38d8db2787a14884f445a155d76a0196aff11cb9df39efecd.png) ### Constraints - $ N $ is an integer between $ 1 $ and $ 200000 $ , inclusive. - $ S $ is a length $ N $ string consisting of `N`, `W`, `S`, `E`. - $ R $ and $ C $ are integers between $ -N $ and $ N $ , inclusive. - $ (R,C) \neq (0,0) $