#include using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)(n); i++) void solve() { ll n, F; cin >> n >> F; vector a(3, vector(n)); rep(j, 3) rep(i, n) cin >> a[j][i]; bitset<900010> bs, nex; bs.set(0, true); rep(i, n) { rep(j, 3) nex |= (bs << a[j][i]); cout << nex.count() << '\n'; swap(bs, nex); nex.reset(); } } int main() { std::cin.tie(nullptr); std::ios_base::sync_with_stdio(false); int T = 1; for (int t = 0; t < T; t++) { solve(); } return 0; }