AlgoBazaAlgoBaza
Back to tasks

A meeting on the number line

Beginner

Python for kids 路 Lesson 30: Contest tasks with conditions

Problem Statement

Ola is at home from hour a1 to b1, and Kuba from a2 to b2. Read these four numbers and print TAK if there is a moment when both are at home (the end of one range may be the start of the other), otherwise NIE. (TAK is Polish for yes, NIE for no.)

Input Format

Four whole numbers a1, b1, a2, b2 (0..24, a1 <= b1, a2 <= b2), each on its own line.

Output Format

TAK or NIE, in capital letters (Polish for yes and no - like in Polish olympiads).

Examples
Example 1

Input

8
12
10
15

Output

TAK
Example 2

Input

8
10
12
15

Output

NIE
Example 3

Input

8
12
12
15

Output

TAK