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 
/*
 * Author Ayub Subhaniya
 * Institute DA-IICT
 */

import java.io.*;
import java.math.*;
import java.util.*;

public class Codeforces429B
{
	
	InputStream in;
	PrintWriter out;
	
	
	void solve() 
	{
		int n=ni();
		int k=ni();
		int m=ni();
		int a=ni();
		Pair votes[]=new Pair[n];
		for (int i=0;i<n;i++)
			votes[i]=new Pair(0,0,i);
		
		for (int i=1;i<=a;i++)
		{
			int cand=ni()-1;
			votes[cand].i=i;
			votes[cand].c++;
		}
		
		Arrays.sort(votes);
		
		int remV=m-a;
		int r[]=new int[n];
		
		if (a==m)
		{
			for (int i=0;i<k;i++)
				if (votes[i].c>0)
					r[votes[i].idx]=1;
				else
					r[votes[i].idx]=3;
			for (int i=k;i<n;i++)
				r[votes[i].idx]=3;
		}
		else if (n==k)
		{
			for (int i=0;i<n;i++)
				if (votes[i].c>0)
					r[votes[i].idx]=1;
				else
					r[votes[i].idx]=2;
		}
		else
		{
			for (int i=0;i<k;i++)
			{
				int sum=0;
				for (int j=i+1;j<=k;j++)
					sum+=votes[i].c-votes[j].c+1;
				//tr(votes[i].idx+" "+sum+" "+remV);
				if (sum>remV&&votes[i].c!=0)
					r[votes[i].idx]=1;
				else
					r[votes[i].idx]=2;
			}
			
			for (int i=k;i<n;i++)
			{
				int req=votes[k-1].c-votes[i].c+1;
				//tr(votes[i].idx+" "+req+" "+remV);
				if (req<=remV)
					r[votes[i].idx]=2;
				else
					r[votes[i].idx]=3;
			}
		}
		
		for (int i:r)
			out.print(i+" ");
			
	}
	
	class Pair implements Comparable<Pair> {
		int idx;
		int i;
		int c;
		Pair(int a, int b, int i) {
			this.i = a;
			c = b;
			idx = i;
		}

		@Override
		public int compareTo(Pair o) {
			if (c == o.c)
				return Integer.compare(i, o.i);
			else
				return Integer.compare(o.c, c);
		}
	}
	
	void run() throws Exception 
	{
		String INPUT = "C:/Users/ayubs/Desktop/input.txt";
		in = oj ? System.in : new FileInputStream(INPUT);
		out = new PrintWriter(System.out);
		
		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis() - s + "ms");
		
	}
	public static void main(String[] args) throws Exception 
	{
		new Codeforces429B().run();
	}
	
	private byte[] inbuf = new byte[1024];
	public int lenbuf = 0, ptrbuf = 0;
	
	private int readByte() 
	{
		if (lenbuf == -1)
			throw new InputMismatchException();
		if (ptrbuf >= lenbuf) 
		{
			ptrbuf = 0;
			try 
			{
				lenbuf = in.read(inbuf);
			}
			catch (IOException e) 
			{
				throw new InputMismatchException();
			}
			if (lenbuf <= 0)
				return -1;
		}
		return inbuf[ptrbuf++];
	}
	
	private boolean inSpaceChar(int c) 
	{
		return !(c >= 33 && c <= 126);
	}
	
	private int skip() 
	{
		int b;
		while ((b = readByte()) != -1 && inSpaceChar(b))
			;
		return b;
	}
	
	private double nd() 
	{
		return Double.parseDouble(ns());
	}
	
	private char nc() 
	{
		return (char) skip();
	}
	
	private String ns() 
	{
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while (!(inSpaceChar(b))) 
		{ // when nextLine, (inSpaceChar(b) && b != ' ')
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}
	
	private char[] ns(int n) 
	{
		char[] buf = new char[n];
		int b = skip(), p = 0;
		while (p < n && !(inSpaceChar(b))) 
		{
			buf[p++] = (char) b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}
	
	private char[][] nm(int n, int m) 
	{
		char[][] map = new char[n][];
		for (int i = 0; i < n; i++)
			map[i] = ns(m);
		return map;
	}
	
	private int[] na(int n) 
	{
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = ni();
		return a;
	}
	
	private int ni() 
	{
		int num = 0, b;
		boolean minus = false;
		while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
			;
		if (b == '-') 
		{
			minus = true;
			b = readByte();
		}
		
		while (true) 
		{
			if (b >= '0' && b <= '9') 
			{
				num = num * 10 + (b - '0');
			} 
			else 
			{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}
	
	private long nl() 
	{
		long num = 0;
		int b;
		boolean minus = false;
		while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
			;
		if (b == '-') 
		{
			minus = true;
			b = readByte();
		}
		
		while (true) 
		{
			if (b >= '0' && b <= '9') 
			{
				num = num * 10 + (b - '0');
			}
			else 
			{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}
	
	private boolean oj = System.getProperty("ONLINE_JUDGE") != null;
	
	private void tr(Object... o) 
	{
		if (!oj)
			System.out.println(Arrays.deepToString(o));
	}
	
}