#include <bits/stdc++.h>
#define For(i, l, r) for (register int i = l, _r = r; i <= _r; ++i)
#define Ford(i, l, r) for (register int i = r, _l = l; i >= _l; --i)
using namespace std;
typedef long long ll;
#define pii pair<int, int>
#define mk make_pair
const int maxn = 105;

int n, k, mod, tp;
int dp[maxn][maxn * maxn * maxn];
ll ans;

inline int read()
{
    int x = 0, f = 1;
    char ch = getchar();
    while (ch < '0' || ch > '9'){if (ch == '-')f = -1;ch = getchar();}
    while (ch >= '0' && ch <= '9'){x = (x << 3) + (x << 1) + ch - '0';ch = getchar();}
    return x * f;
}

int main()
{
    n = read(), k = read(), mod = read();
    tp = k * n * (n - 1) / 2;
    dp[0][0] = 1;
    For(i,1,n-1)
    {
        For(j,0,tp)
        {
            dp[i][j] = dp[i - 1][j];
            if(j>=i)
                dp[i][j] = (dp[i][j] + dp[i][j - i]) % mod;
        }
        Ford(j, i * (k + 1), tp)
            dp[i][j] = (dp[i][j] - dp[i][j - i * (k + 1)] + mod) % mod;
    }
    For(i,1,n)
    {
        ans = 0;
        For(j, 0, tp) ans = (ans + 1LL * dp[i - 1][j] * dp[n - i][j]) % mod;
        ans = (ans * (k + 1) - 1) % mod;
        printf("%lld\n", ans);
    }
}
#include<iostream>
using namespace std;
bool test = false;

int h[30][29];
int w[29][30];
int si,sj,ti,tj,a,response;
double e;
string ans;

void init(){
  for(int i=0;i<30;i++) for(int j=0;j<29;j++) scanf("%d",&h[i][j]);
  for(int i=0;i<29;i++) for(int j=0;j<30;j++) scanf("%d",&w[i][j]);
}

void writeL(int n){for(int i=0;i<n;i++) ans+="L";}
void writeR(int n){for(int i=0;i<n;i++) ans+="R";}
void writeU(int n){for(int i=0;i<n;i++) ans+="U";}
void writeD(int n){for(int i=0;i<n;i++) ans+="D";}

int main(){
  if(test) init();
  for(int i=0;i<1000;i++){
    if(test) cin >> si >> sj >> ti >> tj >> a >> e;
    else cin >> si >> sj >> ti >> tj;
    
    //printf("%d %d %d %d %d %lf\n",si,sj,ti,tj,a,e);
    ans = "";
    if(si<ti) writeD(ti-si);
    else if(ti<si) writeU(si-ti);
    if(sj<tj) writeR(tj-sj);
    else if(tj<sj) writeL(sj-tj);
    
    cout << ans << endl;
    if(!test) scanf("%d",&response);
  }
}