package com.javarush.task.task19.task1916;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
/*
Отслеживаем изменения
*/
public class Solution {
public static List<LineItem> lines = new ArrayList<LineItem>();
public static void main(String[] args) throws IOException {
try( BufferedReader reader = new BufferedReader( new InputStreamReader(System.in));
BufferedReader reader1 = new BufferedReader(new FileReader(reader.readLine()));
BufferedReader reader2 = new BufferedReader(new FileReader(reader.readLine()));) {
while (reader1.ready()) {
String firstFile = reader1.readLine();
String seccondFile = reader2.readLine();
lines.add(getLineItem(firstFile, seccondFile));
}
}catch (IOException e){ }
}
static LineItem getLineItem(String original, String changed){
if (original.equals(changed))return new LineItem(Type.SAME, original);
else if (original.isEmpty())return new LineItem(Type.ADDED, changed);
else if (changed.isEmpty()) return new LineItem(Type.REMOVED,original);
return null;
}
public static enum Type {
ADDED, //добавлена новая строка
REMOVED, //удалена строка
SAME //без изменений
}
public static class LineItem {
public Type type;
public String line;
public LineItem(Type type, String line) {
this.type = type;
this.line = line;
}
}
}