402229: GYM100703 L Many questions

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

L. Many questionstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output

— How could I have forgotten? Knight is going to visit me today, — no matter how Dragon tried to be cunning, he was not very good at it, — I think, it will be interesting for you to make the acquaintance with him.

— Perhaps, we are somewhat acquainted already, — Princess smiled, — But it rarely happens to see each other: different people, different interests...

Dragon believed that common interests are not the most important things. The most important is to have the similar similar opinions on matters of principle. Dragon had a list of questions he had asked Knight and Prince already. He was going to ask Princess these questions.

Let's consider that an answer to a question is a positive integer. If the absolute value of difference between Knight's and Princess' answers is less than one of Prince's and Princess', Dragon believes that Knight's and Princess' opinions are more similar. And vice versa, if the absolute value of difference between Prince's and Princess' answers is less than one of Knight's and Princess', Dragon believes that Knight's and Princess' opinions are more similar. Dragon ignores the questions the values of which are equal.

Your task is figure out how many questions, in which Princess' and Prince's opinions are more similar, exist and how many questions, in which Princess' and Knight's opinions are more similar, exist.

Input

The first line contains integer n (1 ≤ n ≤ 1000) — the number of Dragon's questions.

The second line contains n integers p1, p2, ..., pn — Prince's answers on Dragon questions.

The third line contains n integers k1, k2, ..., kn — Knight's answers on Dragon's questions.

The fourth line contains n integers r1, r2, ..., rn — Princess' answers on Dragon questions.

All answers are positive integer not greater than 100.

Output

In the first line print two space-separated integers — the number of questions in which Princess' and Prince's opinions are more similar and the number of questions in which Princess' and Knight's opinions are more similar.

ExamplesInput
7
1 5 24 11 82 100 7
6 3 85 78 14 32 33
2 4 64 35 55 61 5
Output
4 2

加入题单

算法标签: