import java.io.*;
import java.util.*;

public class Validator {

	Scanner in1, in2;
	PrintWriter out;


	void asserT(boolean e) {
		if (!e) {
			throw new Error();
		}
	}

	boolean isCorrect(char []s) {
		int d = 0;
		for (int i = 0; i < s.length; i++) {
			if (s[i] == '(') {
				d++;
			} else {
				asserT(s[i] == ')');
				d--;
				if (d < 0) {
					return false;
				}
			}
		}
		return d == 0;
	}
   
	void solve(){
   	ArrayList <Integer> list = new ArrayList <Integer>();
   	ArrayList <Integer> list2 = new ArrayList <Integer>();


   	while (in1.hasNextInt()) {
   		list.add(in1.nextInt());
   	}

   	while (in2.hasNextInt()){
   		list2.add(in2.nextInt());
   	}

   	if (list.size() != list2.size()){
   		out.println("FAIL SIZE");
   		return;
   	}
   	for (int i = 0; i < list.size(); i++) {
   		int val1 = list.get(i);
   		int val2 = list2.get(i);
   		if (val1 != val2) {
   			out.println("FAIL VALUE " + val1 + " " + val2);
   			return;
   		}
   	}
   	out.println("TRUE");
   }

	void run(String filename){
		try {
			in1 = new Scanner(new FileReader(filename + ".out"));
			in2 = new Scanner(new FileReader(filename + ".out.correct"));
//			out = new PrintWriter(System.out);
      } catch (IOException e) {
      	throw new Error();
      }


		try {
			solve();
		} finally {
//			out.close();
		}
	}

	void solveAll(){
		out = new PrintWriter(System.out);
		for (int i = 1; i <= 18; i++) {
			run(i + "");
		}
		out.close();
	}

	public static void main(String []args) {
		new Validator().solveAll();
	}
};