package test;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Scanner;
public class b{
public static void main(String[] args) {
Scanner sc =new Scanner(System.in);
HashMap<Integer,Integer> map = new HashMap<>();
int n=sc.nextInt();//5
int m=sc.nextInt();//3
int l=0,r=n+1;
for(int i=1;i<=n;i++) {
map.put(i, i);
}
while(m>0) {
String s1=sc.next();
int a1 = sc.nextInt();
if(s1.equals("L")) {
map.put(a1,l--);
}
else {
map.put(a1,r++);
}
m--;
}
List<Map.Entry<Integer,Integer>> l1=new ArrayList<Map.Entry<Integer,Integer>>(map.entrySet());
Collections.sort(l1,new Comparator<Map.Entry<Integer,Integer>>() {
@Override
public int compare(Entry<Integer, Integer> o1, Entry<Integer, Integer> o2) {
// TODO Auto-generated method stub
return o1.getValue()-o2.getValue();
}
});
for(Map.Entry<Integer, Integer> map1: l1) {
System.out.print(map1.getKey()+" ");
}
}
}