问题 H: Average Score平均分

内存限制:256 MB 时间限制:2 S
题面:传统 评测方式:文本比较 上传者:
提交:14 通过:6

题目描述

    教育改革后,波利卡普在学校只学习两门科目,安全研究和体育(体育)。在第四学期的漫长几个月里,他获得了n分。当老师在日记上写一个标记时,他们没有写这个标记是针对什么科目的,他们只是写了标记。
    现在是时候把日记给他严厉的父母看了。Polycarp知道,最近在家长会上,家长被告知他获得了安全研究分数和b PE分数(a + b = n)。现在,Polycarp 想在每个标记前面写一个主题的名称,以便:

    正好有一个安全研究标志

    正好有b PE标志

    两门科目的总平均分都是最高分。

    平均科目成绩是其中所有分数的总和除以它们的数量。当然,除法是以实数执行的,没有向上或向下舍入。Polycarp旨在最大化x1 + x2,其中x1是第一个科目(安全研究)的平均分数,x2是第二个科目(体育)的平均分数。


After the educational reform Polycarp studies only two subjects at school, Safety Studies and PE (Physical Education). During the long months of the fourth term, he received n marks in them. When teachers wrote a mark in the journal, they didn't write in what subject the mark was for, they just wrote the mark.
Now it's time to show the journal to his strict parents. Polycarp knows that recently at the Parent Meeting the parents were told that he received a Safety Studies marks and b PE marks (a+b=n). Now Polycarp wants to write a subject's name in front of each mark so that:
  • there are exactly a Safety Studies marks,
  • there are exactly b PE marks,
  • the total average score in both subjects is maximum.
An average subject grade is the sum of all marks in it, divided by the number of them. Of course, the division is performed in real numbers without rounding up or down. Polycarp aims to maximize the x1+x2, where x1 is the average score in the first subject (Safety Studies), and x2 is the average score in the second one (Physical Education).
Input
The first line contains an integer n (2≤n≤105), n is the number of marks in Polycarp's Journal. The second line contains two positive integers a,b (1≤a,bn-1,a+b=n). The third line contains a sequence of integers t1,t2,...,tn (1≤ti≤5), they are Polycarp's marks.
Output
Print the sequence of integers f1,f2,...,fn, where fi (1≤fi≤2) is the number of a subject to which the i-th mark should be attributed. If there are several possible solutions, then print such that the sequence f1,f2,...,fn is the smallest lexicographically.
The sequence p1,p2,...,pn is lexicographically less than q1,q2,...,qn if there exists such j (1≤jn) that pi=qi for all 1≤i<j, αnd pj<qj.
Examples
Input
5
3 2
4 4 5 4 4

Output
1 1 2 1 2 
Input
4
2 2
3 5 4 5
Output
1 1 2 2 

输入格式

第一行包含一个整数 n (2≤n≤105),n 是 Polycarp 日记中的标记数。第二行包含两个正整数 a,b (1≤a,b≤n-1,a+b=n)。第三行包含整数序列 t1,t2,...,tn (1≤ti≤5),它们是 Polycarp 的标记。

输出格式

打印整数序列 f1,f2,...,fn,其中 fi (1≤fi≤2) 是第 i 个标记应归属的主题的编号。如果有多种可能的解决方案,则打印序列 f1,f2,...,fn 在字典上是最小的。
序列 p1,p2,...,pn 在字典上小于 q1,q2,...,qn,如果存在这样的 j (1≤j≤n) 使得 pi=qi 对于所有 1≤i<j, αnd pj<qj

输入样例 复制

5
3 2
4 4 5 4 4

输出样例 复制

1 1 2 1 2 

数据范围与提示

在第一个样本中,第一个科目的平均分为4,第二个科目的平均分为4.5。总平均分为8.5