40 lines
771 B
Java
40 lines
771 B
Java
package chelper;
|
|
|
|
import java.util.HashSet;
|
|
import java.util.Set;
|
|
|
|
import io.InputReader;
|
|
import io.OutputWriter;
|
|
import misc.SimpleSavingChelperSolution;
|
|
|
|
|
|
public class A extends SimpleSavingChelperSolution {
|
|
|
|
public void solve(int testNumber, InputReader in, OutputWriter out) {
|
|
wrapSolve(testNumber, in, out);
|
|
}
|
|
|
|
@Override
|
|
public void solve(int testNumber) {
|
|
Set<Integer> lucky = new HashSet<>();
|
|
|
|
for (int i = 0; i < 10; i++) {
|
|
lucky.add(in.nextInt());
|
|
}
|
|
|
|
int n = in.nextInt();
|
|
|
|
for (int i = 0; i < n; i++) {
|
|
int luckyCount = 0;
|
|
|
|
for (int j = 0; j < 6; j++) {
|
|
if (lucky.contains(in.nextInt())) {
|
|
luckyCount++;
|
|
}
|
|
}
|
|
|
|
out.println(luckyCount >= 3 ? "Lucky" : "Unlucky");
|
|
}
|
|
}
|
|
}
|