import java.io.*; import java.util.*; public class Main { static ArrayList> lists = new ArrayList<>(); public static void main(String[] args) throws Exception { Scanner sc = new Scanner(); int n = sc.nextInt(); int m = sc.nextInt(); HashMap> current = new HashMap<>(); current.put(0, new HashMap<>()); current.get(0).put(0, 1); for (int i = 2; i <= n * 2; i++) { HashMap> next = new HashMap<>(); for (int x : current.keySet()) { for (int y : current.get(x).keySet()) { if (i - x <= n) { if (!next.containsKey(x)) { next.put(x, new HashMap<>()); } next.get(x).put(y + x, (next.get(x).getOrDefault(y + x, 0) + current.get(x).get(y)) % m); } if (x < i - x - 1) { if (!next.containsKey(x + 1)) { next.put(x + 1, new HashMap<>()); } next.get(x + 1).put(y, (next.get(x + 1).getOrDefault(y, 0) + current.get(x).get(y)) % m); } } } current = next; } int[] ans = new int[n * n + 1]; for (HashMap map : current.values()) { for (int x : map.keySet()) { ans[x] += map.get(x); ans[x] %= m; } } StringBuilder sb = new StringBuilder(); for (int x : ans) { sb.append(x).append("\n"); } System.out.print(sb); } } class Scanner { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(""); public Scanner() throws Exception { } public int nextInt() throws Exception { return Integer.parseInt(next()); } public long nextLong() throws Exception { return Long.parseLong(next()); } public String next() throws Exception { if (!st.hasMoreTokens()) { st = new StringTokenizer(br.readLine()); } return st.nextToken(); } }