SP1480 PT07D - Let us count 1 2 3

Description

Given two integer _n_, _p_. 4 kinds of query is needed to solve: 1. Counting the number of labeled unrooted trees with _n_ nodes 2. Counting the number of labeled rooted trees with _n_ nodes 3. Counting the number of unlabeled rooted trees with _n_ nodes 4. Counting the number of unlabeled unrooted trees with _n_ nodes Calculate the answer modulo _p_.

Input Format

N/A

Output Format

N/A