The elections to Berland parliament are happening today. Voting is in full swing!

Totally there are n candidates, they are numbered from 1 to n. Based on election results k (1 ≤ k ≤ n) top candidates will take seats in the parliament.

After the end of the voting the number of votes for each candidate is calculated. In the resulting table the candidates are ordered by the number of votes. In case of tie (equal number of votes) they are ordered by the time of the last vote given. The candidate with ealier last vote stands higher in the resulting table.

So in the resulting table candidates are sorted by the number of votes (more votes stand for the higher place) and if two candidates have equal number of votes they are sorted by the time of last vote (earlier last vote stands for the higher place).

There is no way for a candidate with zero votes to take a seat in the parliament. So it is possible that less than k candidates will take a seat in the parliament.

In Berland there are m citizens who can vote. Each of them will vote for some candidate. Each citizen will give a vote to exactly one of n candidates. There is no option "against everyone" on the elections. It is not accepted to spoil bulletins or not to go to elections. So each of m citizens will vote for exactly one of n candidates.

At the moment a citizens have voted already (1 ≤ a ≤ m). This is an open election, so for each citizen it is known the candidate for which the citizen has voted. Formally, the j-th citizen voted for the candidate gj. The citizens who already voted are numbered in chronological order; i.e. the (j + 1)-th citizen voted after the j-th.

The remaining m - a citizens will vote before the end of elections, each of them will vote for one of n candidates.

Your task is to determine for each of n candidates one of the three possible outcomes:

  * a candidate will be elected to the parliament regardless of votes of the remaining m - a citizens; 
  * a candidate has chance to be elected to the parliament after all n citizens have voted; 
  * a candidate has no chances to be elected to the parliament regardless of votes of the remaining m - a citizens. 

Input

The first line contains four integers n, k, m and a (1 ≤ k ≤ n ≤ 100, 1 ≤ m ≤ 100, 1 ≤ a ≤ m) — the number of candidates, the number of seats in the parliament, the number of Berland citizens and the number of citizens who already have voted.

The second line contains a sequence of a integers g1, g2, ..., ga (1 ≤ gj ≤ n), where gj is the candidate for which the j-th citizen has voted. Citizens who already voted are numbered in increasing order of voting times.

Output

Print the sequence consisting of n integers r1, r2, ..., rn where:

  * ri = 1 means that the i-th candidate is guaranteed to take seat in the parliament regardless of votes of the remaining m - a citizens; 
  * ri = 2 means that the i-th candidate has a chance to take a seat in the parliament, i.e. the remaining m - a citizens can vote in such a way that the candidate will take a seat in the parliament; 
  * ri = 3 means that the i-th candidate will not take a seat in the parliament regardless of votes of the remaining m - a citizens. 

Examples

Input

3 1 5 4
1 2 1 3


Output

1 3 3 

Input

3 1 5 3
1 3 1


Output

2 3 2 

Input

3 2 5 3
1 3 1


Output

1 2 2 
import java.io.*;
import java.util.*;

public class F847 {

	public static void main(String[] args) throws IOException {
		IO io = new IO(System.in);

		int n = io.nextInt();
		int k = io.nextInt();
		int m = io.nextInt();
		int a = io.nextInt();
		int remaining = m - a;

		int[] votes = new int[n];
		int[] last = new int[n];

		for (int i = 0; i < a; i++) {
			int cand = io.nextInt() - 1;
			votes[cand]++;
			last[cand] = i + 1;
		}

		Cand[] c = new Cand[n];
		for (int i = 0; i < n; i++) {
			c[i] = new Cand(votes[i], last[i], i);
		}
		Arrays.sort(c);

		int[] res = new int[n];
		for (int i = 0; i < n; i++) {
			Cand cur = c[i];
			// Check for case 3
			if (cur.votes + remaining == 0) {
				// Cant get any votes at all
				res[i] = 3;
				continue;
			}
			if (i >= k && cur.votes + remaining <= c[k - 1].votes) {
				// Current position is too low, and cant get enough
				res[i] = 3;
				continue;
			}
			// Case 1 or 2
			if (cur.votes==0) {
				// have 0 votes so far, cant be situation 1
				res[i] = 2;
				continue;
			}
			if (i >= k) {
				// current position is not good enough, so cant be 1
				res[i] = 2;
				continue;
			}
			// how many must get ahead of cur to bump cur out
			int space = k - i;
			// not enough candidates to get ahead of this
			if (space > (n-i-1)) {
				res[i] = 1;
				continue;
			}
			int votes_needed = 0;
			for (int j = i + 1; j < n && j <= i + space; j++) {
				votes_needed += cur.votes - c[j].votes + 1;
			}
			if (votes_needed <= remaining) {
				res[i] = 2;
			} else {
				res[i] = 1;
			}
		}
		
		int[] ans = new int[n];
		for (int i = 0; i < res.length; i++) {
			ans[c[i].pos] = res[i];
		}
		
		for (int i = 0; i < ans.length; i++) {
			io.print(ans[i] + " ");
		}
		
		io.close();
	}

	static class Cand implements Comparable<Cand> {
		int pos, votes, time;

		Cand(int _v, int _t, int _p) {
			votes = _v;
			time = _t;
			pos = _p;
		}

		public int compareTo(Cand o) {
			if (this.votes == o.votes) {
				return Integer.compare(this.time, o.time);
			} else {
				return Integer.compare(o.votes, this.votes);
			}
		}
	}

	static class IO extends PrintWriter {
		static BufferedReader r;
		static StringTokenizer t;

		public IO(InputStream i) {
			super(new BufferedOutputStream(System.out));
			r = new BufferedReader(new InputStreamReader(i));
			t = new StringTokenizer("");
		}

		public String next() throws IOException {
			while (!t.hasMoreTokens()) {
				t = new StringTokenizer(r.readLine());
			}
			return t.nextToken();
		}

		public String nextLine() throws IOException {
			String nextLine = next();
			while (t.hasMoreTokens()) {
				nextLine += " " + next();
			}
			return nextLine;
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}
	}

}