Language: Java

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.List;
import java.util.ArrayList;
import java.lang.StringBuffer;

/*Question
/??\?????????????????????????????????????????£???????????????????£??????????????????????
/insert x: ??£?????????????????????????????? x ?????????????´?????¶?????¶???????
/delete x: ?????? x ??????????????????????´??????£????????????????????????????????????????????????????´?????????¨???????????´????????????????????????
/deleteFirst: ?????????????????????????´???????????????????
/deleteLast: ????????????????°????????´??????????????????? 
*/

/*Input
/??\????????\????????¢?????§?????????????????????
/n
/command1
/command2
/...
/commandn
???????????????????????° n ?????????????????????????¶???? n ??????????????????????????????????????????????¨?4?????????????????????????????§?????????????????´??°??¨???????????? 
*/

//DLList???????????????????????£????????????????????????
public class Main {
	public static void main(String[] args) throws Exception {
		String i = DLList();
		System.out.print(i);
	}

	/*DLList????????????
	/??????????§£??????????????????????????????????????????
	/??¨????????????n???????´??????????n????????????????????????
	/?????????????????????????????????????????????????????????
	/delete?????\???????????????????????¢???????????????????????????????????????????????????
	/@return String
	*/

	static String DLList() throws Exception {
		BufferedReader sc = new BufferedReader(new InputStreamReader(System.in));
		//????????¨
		StringBuffer br = new StringBuffer();
		//n?????\???
		int n = Integer.parseInt(sc.readLine());
		//??????????????\?????¨
		String[] s = new String[2];
		//??\?????¨
		List <String> x = new ArrayList <String>();
		import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.List;
import java.util.ArrayList;
import java.lang.StringBuffer;

/*Question
/??\?????????????????????????????????????????£???????????????????£??????????????????????
/insert x: ??£?????????????????????????????? x ?????????????´?????¶?????¶???????
/delete x: ?????? x ??????????????????????´??????£????????????????????????????????????????????????????´?????????¨???????????´????????????????????????
/deleteFirst: ?????????????????????????´???????????????????
/deleteLast: ????????????????°????????´??????????????????? 
*/

/*Input
/??\????????\????????¢?????§?????????????????????
/n
/command1
/command2
/...
/commandn
???????????????????????° n ?????????????????????????¶???? n ??????????????????????????????????????????????¨?4?????????????????????????????§?????????????????´??°??¨???????????? 
*/

//DLList???????????????????????£????????????????????????
public class Main {
	public static void main(String[] args) throws Exception {
		String i = DLList();
		System.out.print(i);
	}

	/*DLList????????????
	/??????????§£??????????????????????????????????????????
	/??¨????????????n???????´??????????n????????????????????????
	/?????????????????????????????????????????????????????????
	/delete?????\???????????????????????¢???????????????????????????????????????????????????
	/@return String
	*/

	static String DLList() throws Exception {
		BufferedReader sc = new BufferedReader(new InputStreamReader(System.in));
		//????????¨
		StringBuffer br = new StringBuffer();
		//n?????\???
		int n = Integer.parseInt(sc.readLine());
		//??????????????\?????¨
		String[] s = new String[2];
		//??\?????¨
		List <String> x = new ArrayList <String>();
		//???????????\???
		for (int i = 0;i < n;i++) {
			s = sc.readLine().split(" ");
			if (s[0].equals("insert")) x.add(s[1]);
			else if (s[0].equals("delete")) 
				for (int j = 0;j < x.size();j++) 
					if (x.get(j).equals(s[1])) x.remove(j);
			else if (s[0].equals("deleteFirst")) x.remove(0);
			else if (s[0].equals("deleteLast")) x.remove(x.size()-1);
		}
		for (int i = x.size()-1;i >= 0;i--) 
			br.append(x.get(i)+" ");
		br.deleteCharAt(br.lastIndexOf(" "));
		br.append("\n");
		return br.toString();
	}
}//???????????\???
		for (int i = 0;i < n;i++) {
			s = sc.readLine().split(" ");
			if (s[0].equals("insert")) x.add(s[1]);
			else if (s[0].equals("delete")) 
				for (int j = 0;j < x.size();j++) 
					if (x.get(j).equals(s[1])) x.remove(j);
			else if (s[0].equals("deleteFirst")) x.remove(0);
			else if (s[0].equals("deleteLast")) x.remove(x.size()-1);
		}
		for (int i = x.size()-1;i >= 0;i--) 
			br.append(x.get(i)+" ");
		br.deleteCharAt(br.lastIndexOf(" "));
		br.append("\n");
		return br.toString();
	}
}

Compiler output:
Main.java:50: error: illegal start of expression
		import java.io.BufferedReader;
		^
Main.java:50: error: not a statement
		import java.io.BufferedReader;
		              ^
Main.java:51: error: illegal start of expression
import java.io.InputStreamReader;
^
Main.java:51: error: not a statement
import java.io.InputStreamReader;
              ^
Main.java:52: error: illegal start of expression
import java.util.List;
^
Main.java:52: error: not a statement
import java.util.List;
                ^
Main.java:53: error: illegal start of expression
import java.util.ArrayList;
^
Main.java:53: error: not a statement
import java.util.ArrayList;
                ^
Main.java:54: error: illegal start of expression
import java.lang.StringBuffer;
^
Main.java:54: error: not a statement
import java.lang.StringBuffer;
                ^
Main.java:75: error: illegal start of expression
public class Main {
^
Main.java:116: error: illegal start of type
		for (int i = 0;i < n;i++) {
		^
Main.java:116: error: > or ',' expected
		for (int i = 0;i < n;i++) {
		                    ^
Main.java:116: error: <identifier> expected
		for (int i = 0;i < n;i++) {
		                      ^
Main.java:125: error: illegal start of type
		for (int i = x.size()-1;i >= 0;i--) 
		^
Main.java:125: error: <identifier> expected
		for (int i = x.size()-1;i >= 0;i--) 
		                         ^
Main.java:125: error: <identifier> expected
		for (int i = x.size()-1;i >= 0;i--) 
		                                ^
Main.java:126: error: <identifier> expected
			br.append(x.get(i)+" ");
			         ^
Main.java:126: error: <identifier> expected
			br.append(x.get(i)+" ");
			               ^
Main.java:127: error: <identifier> expected
		br.deleteCharAt(br.lastIndexOf(" "));
		               ^
Main.java:127: error: <identifier> expected
		br.deleteCharAt(br.lastIndexOf(" "));
		                              ^
Main.java:128: error: <identifier> expected
		br.append("\n");
		         ^
Main.java:128: error: illegal start of type
		br.append("\n");
		          ^
Main.java:129: error: illegal start of type
		return br.toString();
		^
Main.java:129: error: <identifier> expected
		return br.toString();
		                  ^
Main.java:131: error: class, interface, enum, or record expected
}
^
26 errors