Triple Sevens
시간 제한1초메모리 제한2048 MB
세 개의 슬롯 바퀴에 표시할 수 있는 숫자가 주어질 때, 모든 바퀴가 7을 표시할 수 있으면 777을, 아니면 0을 출력한다.
문제
Eddy is overseeing construction of some new slot machines. His slot machines consist of three wheels, each of which can show one of several different digits. When activated, each wheel shows a random digit. The goal is for all wheels to be able to show the digit .
A slot machine is good if each wheel is capable of showing the digit , and bad otherwise. For a given slot machine, determine if it is good or bad.
입력
The first line contains a single integer , which is the number of different digits on each wheel. Each wheel has the same number of digits.
Each of the next three lines contains distinct digits (in the range from to ). These are the digits on each of the three wheels.
출력
Output a single integer, which is if the slot machine is good, otherwise.