// Original C++ solution (slower):
#include <vector>

#include <list>

#include <map>

#include <set>

#include <deque>

#include <queue>

#include <stack>

#include <bitset>

#include <algorithm>

#include <functional>

#include <numeric>

#include <utility>

#include <sstream>

#include <fstream>

#include <iostream>

#include <iomanip>

#include <cstdio>

#include <cmath>

#include <cstdlib>

#include <ctime>

#include <cstring>

using namespace std;

int n,m;

char a[15][15];

bool bo[15][15];

int dx[]={-1,0,1,0},dy[]={0,1,0,-1};

char UNdir(int x)

{

    if (x==0) return 'U';

    if (x==1) return 'R';

    if (x==2) return 'D';

    if (x==3) return 'L';

}

int dir(char x)

{

    if (x=='U') return 3;

    if (x=='R') return 0;

    if (x=='D') return 1;

    if (x=='L') return 2;

}

struct node

{

    int d;

    int x[105];

    int y[105];

    int num;

    char fa;

    string ans;

};

bool in(int x,int y)

{

    return (x>=0 && x<n && y>=0 && y<m);

}

void out(node x)

{

    char xx[15][15];

    for (int i = 0; i < n; ++i)

    {

        for (int j = 0; j < m; ++j)

        {

                xx[i][j]='.';

        }

    }

    xx[x.d/m][x.d%m]=x.fa;

    for (int i = 0; i < x.num; ++i)

    {

        xx[x.x[i]][x.y[i]]='o';

    }

    for (int i = 0; i < n; ++i)

    {

        for (int j = 0; j < m; ++j)

        {

            cout<<xx[i][j];

        }

        cout<<endl;

    }

    cout<<endl;

}

int ans=0,ansd=0;

int main(int argc, char *argv[])

{

    int T;

    cin>>n>>m;

    node xx;xx.num=0;

    xx.ans="";

    for (int i = 0; i < n; ++i)

    {

        for (int j = 0 ; j < m; ++j)

        {

            cin>>a[i][j];

            if (a[i][j]=='o')

            {

                xx.x[xx.num]=i;

                xx.y[xx.num++]=j;

            }

            else if (a[i][j]=='U'||a[i][j]=='L'||a[i][j]=='R'||a[i][j]=='D')

            {

                xx.d=i*m+j;

                xx.fa=a[i][j];

            }

        }

    }

    queue<node> q;

    q.push(xx);

    bool gan=0;

    while (!q.empty())

    {

        node now=q.front();

    

        if (now.num==0)

        {

            cout<<now.ans<<endl;

            break;

        }

        q.pop();

        int x=now.d/m,y=now.d%m;

        memset(bo,0,sizeof(bo));

        bo[x][y]=1;

        for (int i = 0; i < now.num; ++i)

        {

           bo[now.x[i]][now.y[i]]=1;

        }

        int face=dir(now.fa);

        for (int i = face; i < face+3; ++i)

        {

            int ii=i%4;

            int l=1;

            int xx=x+dx[ii],yy=y+dy[ii];

            while (1)

            {

                if (!in(xx,yy)) break;

                if (bo[xx][yy])

                {

                    node go;

                    go.d=xx*m+yy;

                    go.ans=now.ans+UNdir(ii);

                    go.fa=UNdir(ii);

                    go.num=0;

                                        for (int j = 0; j < now.num; ++j)

                    {

                        int xxx=now.x[j],yyy=now.y[j];

                        if (!(xxx==xx&&yyy==yy))

                        {

                            go.x[go.num]=xxx;

                            go.y[go.num++]=yyy;

                        }

                    }

                    q.push(go); 

                    break;

                }

                xx+=dx[ii];

                yy+=dy[ii];

            }

        }

    }

    return 0;

}

// Optimized solution to the same problem (faster):
#include "stdio.h"

#include "stdlib.h"

int n,m;

int map[15][15];

char str[100];

char dir[]={' ','U','D','R','L'};

int sx,sy;

int c;

int ans[100];

bool dfs(int x,int y,int step)

{

	if(step==c) return true;

	if(map[x][y]!=2)

	for(int i=x-1;i>=0;i--)

		if(!map[i][y])

		{

			ans[step]=1;

			map[i][y]=1;

			if(dfs(i,y,step+1))return true;

			map[i][y]=0;

			break;

		}

	if(map[x][y]!=1)

	for(int i=x+1;i<n;i++)

		if(!map[i][y])

		{

			ans[step]=2;

			map[i][y]=2;

			if(dfs(i,y,step+1))return true;

			map[i][y]=0;

			break;

		}

	if(map[x][y]!=4)

	for(int i=y+1;i<m;i++)

		if(!map[x][i])

		{

			ans[step]=3;

			map[x][i]=3;

			if(dfs(x,i,step+1))return true;

			map[x][i]=0;

			break;

		}

	if(map[x][y]!=3)

	for(int i=y-1;i>=0;i--)

		if(!map[x][i])

		{

			ans[step]=4;

			map[x][i]=4;

			if(dfs(x,i,step+1))return true;

			map[x][i]=0;

			break;

		}

		return false;

}

int main(int argc, char const *argv[])

{

	scanf("%d %d",&n,&m);

	c=0;

	for(int i=0;i<n;i++)

	{

		scanf("%s",str);

		for(int j=0;j<m;j++)

			if(str[j]=='.') map[i][j]=-1;

		else if(str[j]=='o') {map[i][j]=0;c++;}

		else{

			sx=i;

			sy=j;

			if(str[j]=='U')map[i][j]=1;

			else if(str[j]=='D')map[i][j]=2;

			else if(str[j]=='R')map[i][j]=3;

			else if(str[j]=='L')map[i][j]=4;

		}

	}

	//while(1){}

	dfs(sx,sy,0);

	for(int i=0;i<c;i++)

		printf("%c",dir[ans[i]]);

	printf("\n");

	return 0;

}

// Fastest known solution for this problem: