#include <bits/stdc++.h>
using namespace std;
const int maxn=1005;
char s[maxn][maxn];
bool vis[maxn][maxn];
typedef pair<int,int> pii;
vector<pii>save[maxn][maxn];
int dx[4]={0,0,-1,1};
int dy[4]={-1,1,0,0};
int cc[maxn][maxn];
int n,m;
int cnt=0;
bool inmaze(int x,int y){
    return x>=0&&x<n&&y>=0&&y<m;
}
bool dfs(int x,int y){
//    cout<<x<<" "<<y<<endl;
    vis[x][y]=1;
    for(int i=0;i<save[x][y].size();i++){
        pii p=save[x][y][i];
        if(vis[p.first][p.second])continue;
        vis[p.first][p.second]=1;
//        cout<<"to: "<<p.first<<" "<<p.second<<endl;
        if(p.first<x){
            s[p.first][p.second]='^';
            s[x][y]='v';
        }
        else if(p.first>x){
            s[p.first][p.second]='v';
            s[x][y]='^';
        }
        else if(p.second>y){
            s[p.first][p.second]='>';
            s[x][y]='<';
        }
        else {
            s[p.first][p.second]='<';
            s[x][y]='>';
        }
        cnt+=2;
        for(int j=0;j<save[p.first][p.second].size();j++){
            pii to=save[p.first][p.second][j];
            if(vis[to.first][to.second])continue;
            ++cc[to.first][to.second];
            int sz=save[to.first][to.second].size()-cc[to.first][to.second];
//            cout<<p.first<<" "<<p.second<<" "<<to.first<<" "<<to.second<<" "<<sz<<endl;
            if(sz==1){
                if(!dfs(to.first,to.second))return 0;
            }
        }
        break;
    }
    return 1;
}
bool solve(){
    for(int i=0;i<n;i++){
        for(int j=0;j<m;j++){
            if(vis[i][j])continue;
            int sz=save[i][j].size()-cc[i][j];
//            cout<<i<<" "<<j<<" "<<save[i][j].size()<<endl;
            if(sz==0)return 0;
            if(sz==1){
                if(!dfs(i,j))return 0;
            }
        }
    }
    return cnt==n*m;
}
int main(){
//    freopen("in","r",stdin);
    while(scanf("%d%d",&n,&m)>0){
        for(int i=0;i<n;i++){
            scanf("%s",s[i]);
        }
        for(int i=0;i<n;i++)
        for(int j=0;j<m;j++){
            if(s[i][j]=='*')vis[i][j]=1;
        }
        for(int i=0;i<n;i++)
        for(int j=0;j<m;j++){
            if(s[i][j]=='*'){
                cnt++;
            }
            else {
                for(int k=0;k<4;k++){
                    int xx=i+dx[k];
                    int yy=j+dy[k];
                    if(!inmaze(xx,yy)||vis[xx][yy])continue;
                    save[i][j].push_back(make_pair(xx,yy));
                }
            }
        }
        if(!solve())puts("Not unique");
        else {
            for(int i=0;i<n;i++)
            for(int j=0;j<m;j++){
                printf("%c",s[i][j]);
                if(j==m-1)puts("");
            }
        }
    }
}


#include <bits/stdc++.h>
using namespace std;
const int maxn=2005;
typedef pair<int,int> pii;
#define x first
#define y second
#define mp make_pair

int dx[4]={0,0,-1,1};
int dy[4]={-1,1,0,0};
char ch[2][8]={"><v^","<>^v"};
char s[maxn][maxn];
pii bfs[maxn*maxn];
int n,m;
int deg[maxn][maxn];
int main()
{
//    freopen("in","r",stdin);
    int ll=0,rr=0;
    cin>>n>>m;
    for(int i=1;i<=n;i++)scanf("%s",s[i]+1);
    for(int i=1;i<=n;i++)
    for(int j=1;j<=m;j++){
        for(int k=0;k<4;k++){
            int nx=i+dx[k];
            int ny=j+dy[k];
            if(s[nx][ny]=='.')deg[i][j]++;
        }
        if(s[i][j]=='.'&&deg[i][j]==1)bfs[rr++]=mp(i,j);
    }
    while(ll<rr){
        pii now=bfs[ll++];
        int x=now.x,y=now.y;
        int nx,ny;
        int id=-1;
        if(s[x][y]=='.'){
            for(int k=0;k<4;k++){
                nx=x+dx[k];
                ny=y+dy[k];
                if(s[nx][ny]=='.'){
                    id=k;
                    break;
                }
            }
            if(id==-1){
                puts("Not unique");
                return 0;
            }
            s[x][y]=ch[0][id];
            s[nx][ny]=ch[1][id];
            deg[x][y]=0;
            deg[nx][ny]=0;
            for(int k=0;k<4;k++){
                int nnx=nx+dx[k];
                int nny=ny+dy[k];
                deg[nnx][nny]--;
                if(deg[nnx][nny]==1)bfs[rr++]=mp(nnx,nny);
            }
        }
    }
    for(int i=1;i<=n;i++)
    for(int j=1;j<=n;j++){
        if(s[i][j]=='.'){
            puts("Not unique");
            return 0;
        }
    }
    for(int i=1;i<=n;i++)puts(s[i]+1);
    return 0;
}


/*

   SHUBHAM RAI-IIIT Hyderabad

 */
#include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(i=a;i<b;i++)
#define REP(i,a) for(i=0;i<a;i++)
#define LLD long long int
#define MOD 1000000007
#define si(n) scanf("%d",&n);
#define si2(n,m) scanf("%d%d",&n,&m);
#define sl(n) scanf("%lld",&n);
#define TR(container,it) for(typeof(container.begin()) it=container.begin();it!=container.end();it++)
#define F first
#define S second
#define pb push_back
#define mp make_pair
typedef pair<int,int> PII;
#define TRACE

#ifdef TRACE
#define trace1(x)                cerr << #x << ": " << x << endl;
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define trace5(a, b, c, d, e)    cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
#define trace6(a, b, c, d, e, f) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;

#else

#define trace1(x)
#define trace2(x, y)
#define trace3(x, y, z)
#define trace4(a, b, c, d)
#define trace5(a, b, c, d, e)
#define trace6(a, b, c, d, e, f)

#endif

string s[1002];
int n,m;
bool f[1002][1002][4];
int flag,tot,cnt;
char ans[1002][1002];

void solve(int x,int y)
{
	if(cnt==tot)
	{
		flag++;
		return;
	}
	if(flag>1)
		return;
	if(x>=n ||  y>=m)
		return;

	if(ans[x][y]!='-')
	{
		solve(x+1,y);
		solve(x,y+1);
		//return;
	}
	if(s[x][y]=='*')
	{
		solve(x+1,y);
		solve(x,y+1);
		//return;
	}
	if(x+1<n && s[x+1][y]!='*' && ans[x+1][y]=='-')
	{
		ans[x][y]='^';
		ans[x+1][y]='v';
		cnt+=2;
		solve(x,y+1);
		solve(x+1,y);
		ans[x][y]='-';
		ans[x+1][y]='-';
		cnt-=2;
	}
	if(y+1<m && s[x][y+1]!='*' && ans[x][y+1]=='-')
	{
		ans[x][y]='<';
		ans[x][y+1]='>';
		cnt+=2;
		solve(x,y+1);
		solve(x+1,y);
		ans[x][y]='-';
		ans[x+1][y]='-';
		cnt-=2;
	}
}
void printans(int x,int y)
{
	if(x>=n || y>=m)
		return;
	if(cnt==tot)
		return;
	if(ans[x][y]!='-')
	{
		printans(x+1,y);
		printans(x,y+1);
		return;
	}
	if(s[x][y]=='*')
	{
		printans(x+1,y);
		printans(x,y+1);
		return;
	}
	if(x+1<n && s[x+1][y]!='*' && ans[x+1][y]=='-')
	{
		ans[x][y]='^';
		ans[x+1][y]='v';
		cnt+=2;
		printans(x,y+1);
		printans(x+1,y);
		if(cnt!=tot)
		{
		//	ans[x][y]='-';
		//	ans[x+1][y]='-';
		//	cnt-=2;
		}
	}
	if(cnt!=tot && y+1<m && s[x][y+1]!='*' && ans[x][y+1]=='-')
	{
		ans[x][y]='<';
		ans[x][y+1]='>';
		cnt+=2;
		printans(x,y+1);
		printans(x+1,y);
		if(cnt!=tot)
		{
		//	ans[x][y]='-';
		//	ans[x+1][y]='-';
		//	cnt-=2;
		}
	}

}

int main()
{
	int i,j;
	si2(n,m);
	REP(i,n)
		cin>>s[i];
	REP(i,n)
		REP(j,m)
		{
			ans[i][j]='-';
			if(s[i][j]=='.')
				tot++;
		}
	if(tot&1)
		cout<<"Not unique\n";
	else
	{
		solve(0,0);
		if(flag>1)
			cout<<"Not unique\n";
		else
		{
			REP(i,n)
				REP(j,m)
				{
					if(s[i][j]=='.')
						ans[i][j]='-';
					else
						ans[i][j]='*';
				}
			cnt=0;
			printans(0,0);
			REP(i,n)
			{
				REP(j,m)
					cout<<ans[i][j];
				cout<<endl;
			}

		}
	}
	return 0;
}


/*

   SHUBHAM RAI-IIIT Hyderabad

 */
#include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(i=a;i<b;i++)
#define REP(i,a) for(i=0;i<a;i++)
#define LLD long long int
#define MOD 1000000007
#define si(n) scanf("%d",&n);
#define si2(n,m) scanf("%d%d",&n,&m);
#define sl(n) scanf("%lld",&n);
#define TR(container,it) for(typeof(container.begin()) it=container.begin();it!=container.end();it++)
#define F first
#define S second
#define pb push_back
#define mp make_pair
typedef pair<int,int> PII;
#define TRACE

#ifdef TRACE
#define trace1(x)                cerr << #x << ": " << x << endl;
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define trace5(a, b, c, d, e)    cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
#define trace6(a, b, c, d, e, f) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;

#else

#define trace1(x)
#define trace2(x, y)
#define trace3(x, y, z)
#define trace4(a, b, c, d)
#define trace5(a, b, c, d, e)
#define trace6(a, b, c, d, e, f)

#endif

string s[1002];
int n,m;
bool f[1002][1002][4];
int flag,tot,cnt;
char ans[1002][1002];

void solve(int x,int y)
{
	if(cnt==tot)
	{
		flag++;
		return;
	}
	if(flag>1)
		return;
	if(x>=n ||  y>=m)
		return;

	if(ans[x][y]!='-')
	{
		solve(x+1,y);
		solve(x,y+1);
		//return;
	}
	if(s[x][y]=='*')
	{
		solve(x+1,y);
		solve(x,y+1);
		//return;
	}
	if(x+1<n && s[x+1][y]!='*' && ans[x+1][y]=='-')
	{
		ans[x][y]='^';
		ans[x+1][y]='v';
		cnt+=2;
		solve(x,y+1);
		solve(x+1,y);
		ans[x][y]='-';
		ans[x+1][y]='-';
		cnt-=2;
	}
	if(y+1<m && s[x][y+1]!='*' && ans[x][y+1]=='-')
	{
		ans[x][y]='<';
		ans[x][y+1]='>';
		cnt+=2;
		solve(x,y+1);
		solve(x+1,y);
		ans[x][y]='-';
		ans[x+1][y]='-';
		cnt-=2;
	}
}
void printans(int x,int y)
{
	if(x>=n || y>=m)
		return;
	if(cnt==tot)
		return;
	if(ans[x][y]!='-')
	{
		printans(x+1,y);
		printans(x,y+1);
		return;
	}
	if(s[x][y]=='*')
	{
		printans(x+1,y);
		printans(x,y+1);
		return;
	}
	if(x+1<n && s[x+1][y]!='*' && ans[x+1][y]=='-')
	{
		ans[x][y]='^';
		ans[x+1][y]='v';
		cnt+=2;
		printans(x,y+1);
		printans(x+1,y);
		if(cnt!=tot)
		{
		//	ans[x][y]='-';
		//	ans[x+1][y]='-';
		//	cnt-=2;
		}
	}
	if(cnt!=tot && y+1<m && s[x][y+1]!='*' && ans[x][y+1]=='-')
	{
		ans[x][y]='<';
		ans[x][y+1]='>';
		cnt+=2;
		printans(x,y+1);
		printans(x+1,y);
		if(cnt!=tot)
		{
		//	ans[x][y]='-';
		//	ans[x+1][y]='-';
		//	cnt-=2;
		}
	}

}

int main()
{
	int i,j;
	si2(n,m);
	REP(i,n)
		cin>>s[i];
	REP(i,n)
		REP(j,m)
		{
			ans[i][j]='-';
			if(s[i][j]=='.')
				tot++;
		}
	if(tot&1)
		cout<<"Not unique\n";
	else
	{
		solve(0,0);
		if(flag>1)
			cout<<"Not unique\n";
		else
		{
			REP(i,n)
				REP(j,m)
					ans[i][j]='-';
			cnt=0;
			printans(0,0);
			REP(i,n)
			{
				REP(j,m)
					cout<<ans[i][j];
				cout<<endl;
			}

		}
	}
	return 0;
}


/*

   SHUBHAM RAI-IIIT Hyderabad

 */
#include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(i=a;i<b;i++)
#define REP(i,a) for(i=0;i<a;i++)
#define LLD long long int
#define MOD 1000000007
#define si(n) scanf("%d",&n);
#define si2(n,m) scanf("%d%d",&n,&m);
#define sl(n) scanf("%lld",&n);
#define TR(container,it) for(typeof(container.begin()) it=container.begin();it!=container.end();it++)
#define F first
#define S second
#define pb push_back
#define mp make_pair
typedef pair<int,int> PII;
#define TRACE

#ifdef TRACE
#define trace1(x)                cerr << #x << ": " << x << endl;
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define trace5(a, b, c, d, e)    cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
#define trace6(a, b, c, d, e, f) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;

#else

#define trace1(x)
#define trace2(x, y)
#define trace3(x, y, z)
#define trace4(a, b, c, d)
#define trace5(a, b, c, d, e)
#define trace6(a, b, c, d, e, f)

#endif

int mvx[]={-1,0,1,0},mvy[]={0,-1,0,1};
int cnt[2002][2002];
string s[2002];
char ans[2002][2002];

int main()
{
	int n,m,i,j,k,left=0;
	si2(n,m);
	REP(i,n)
		cin>>s[i];
	queue<PII> st;
	REP(i,n)
	{
		REP(j,m)
		{
			ans[i][j]='-';
			if(s[i][j]=='.')
				left++;
			else
			{
				ans[i][j]='*';
				continue;
			}
			REP(k,4)
			{
				int x=i+mvx[k],y=j+mvy[k];
				if(x<0 || x>=n ||y<0 || y>=m)
					continue;
				if(s[x][y]=='.')
					cnt[i][j]++;
			}
			if(cnt[i][j]==1)
				st.push(mp(i,j));
		}
	}
	if((st.empty() && left!=0) || (left&1))
	{
		cout<<"Not unique\n";
		return 0;
	}
	while(!st.empty())
	{
		int x=st.front().F,y=st.front().S;
		st.pop();
		if(ans[x][y]!='-')
			continue;
		int xx,yy;
		REP(k,4)
		{
			xx=x+mvx[k],yy=y+mvy[k];
			if(xx>=0 && xx<n && yy>=0 && yy<m && ans[xx][yy]=='-')
				break;
		}
		if(k==4)
		{
			cout<<"Not unique\n";
			return 0;
		}
		if(xx==x-1)
			ans[x][y]='v',ans[xx][yy]='^';
		else if(xx==x+1)
			ans[x][y]='^',ans[xx][yy]='v';
		else if(yy==y-1)
			ans[x][y]='>',ans[xx][yy]='<';
		else
			ans[x][y]='<',ans[xx][yy]='>';
		left-=2;
		REP(k,4)
		{
			x=xx+mvx[k],y=yy+mvy[k];
			if(x>-1 && x<n && y>-1 && y<m)
			{
				cnt[x][y]--;
				if(cnt[x][y]==1)
					st.push(mp(x,y));
			}
		}
	}
	if(left==0)
	{
		REP(i,n)
		{
			REP(j,m)
				cout<<ans[i][j];
			cout<<endl;
		}
	}
	else
		cout<<"Not unique\n";
	return 0;
}


/*

   SHUBHAM RAI-IIIT Hyderabad

 */
#include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(i=a;i<b;i++)
#define REP(i,a) for(i=0;i<a;i++)
#define LLD long long int
#define MOD 1000000007
#define si(n) scanf("%d",&n);
#define si2(n,m) scanf("%d%d",&n,&m);
#define sl(n) scanf("%lld",&n);
#define TR(container,it) for(typeof(container.begin()) it=container.begin();it!=container.end();it++)
#define F first
#define S second
#define pb push_back
#define mp make_pair
typedef pair<int,int> PII;
#define TRACE

#ifdef TRACE
#define trace1(x)                cerr << #x << ": " << x << endl;
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define trace5(a, b, c, d, e)    cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
#define trace6(a, b, c, d, e, f) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;

#else

#define trace1(x)
#define trace2(x, y)
#define trace3(x, y, z)
#define trace4(a, b, c, d)
#define trace5(a, b, c, d, e)
#define trace6(a, b, c, d, e, f)

#endif

int mvx[]={-1,0,1,0},mvy[]={0,-1,0,1};
int cnt[2002][2002];
string s[2002];
char ans[2002][2002];

int main()
{
	int n,m,i,j,k,left=0;
	si2(n,m);
	REP(i,n)
		cin>>s[i];
	queue<PII> st;
	REP(i,n)
	{
		REP(j,m)
		{
			ans[i][j]='-';
			if(s[i][j]=='.')
				left++;
			else
			{
				ans[i][j]='*';
				continue;
			}
			REP(k,4)
			{
				int x=i+mvx[k],y=j+mvy[k];
				if(x<0 || x>n ||y<0 || y>n)
					continue;
				if(s[x][y]=='.')
					cnt[i][j]++;
			}
			if(cnt[i][j]==1)
				st.push(mp(i,j));
		}
	}
	if((st.empty() && left!=0) || (left&1))
	{
		cout<<"Not unique\n";
		return 0;
	}
	while(!st.empty())
	{
		int x=st.front().F,y=st.front().S;
		st.pop();
		if(ans[x][y]!='-')
			continue;
		int xx,yy;
		REP(k,4)
		{
			xx=x+mvx[k],yy=y+mvy[k];
			if(xx>=0 && xx<n && yy>=0 && yy<m && ans[xx][yy]=='-')
				break;
		}
		if(k==4)
		{
			cout<<"Not unique\n";
			return 0;
		}
		if(xx==x-1)
			ans[x][y]='v',ans[xx][yy]='^';
		else if(xx==x+1)
			ans[x][y]='^',ans[xx][yy]='v';
		else if(yy==y-1)
			ans[x][y]='>',ans[xx][yy]='<';
		else
			ans[x][y]='<',ans[xx][yy]='>';
		left-=2;
		REP(k,4)
		{
			x=xx+mvx[k],y=yy+mvy[k];
			if(x>-1 && x<n && y>-1 && y<m)
			{
				cnt[x][y]--;
				if(cnt[x][y]==1)
					st.push(mp(x,y));
			}
		}
	}
	if(left==0)
	{
		REP(i,n)
		{
			REP(j,m)
				cout<<ans[i][j];
			cout<<endl;
		}
	}
	else
		cout<<"Not unique\n";
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef pair<int,int>pi;
const int Maxn=2002;
int di[4][2]={{1,0},{-1,0},{0,1},{0,-1}};
int n,m;
bool done[Maxn][Maxn];
char Map[Maxn][Maxn];
int deg[Maxn][Maxn];
int cnt;
queue<pi>q;
bool check(int x,int y)
{
    if(x<1||x>n||y<1||y>m||done[x][y]||Map[x][y]=='*')return false;
    return true;
}
int find(int x,int y)
{
    for(int i=0;i<4;i++)
        if(check(x+di[i][0],y+di[i][1]))
            return i;
    return -1;
}
int main()
{
    scanf("%d%d",&n,&m);
    for(int i=1;i<=n;i++)
        scanf("%s",Map[i]+1);
    for(int i=1;i<=n;i++)
        for(int j=1;j<=m;j++)
        {
            if(Map[i][j]=='.')
            {
                cnt++;
                deg[i][j]=0;
                for(int k=0;k<4;k++)
                {
                    if(check(i+di[k][0],j+di[k][1]))deg[i][j]++;
                }
                if(deg[i][j]==1)q.push(pi(i,j));
            }
        }
    while(!q.empty())
    {
        pi u=q.front();q.pop();
        int x=u.first,y=u.second;
        if(done[x][y])continue;
        int t=find(x,y);
        int nx=x+di[t][0],ny=y+di[t][1];
        if(t==0){Map[x][y]='^',Map[nx][ny]='v';}
        if(t==1){Map[x][y]='v',Map[nx][ny]='^';}
        if(t==2){Map[x][y]='<',Map[nx][ny]='>';}
        if(t==3){Map[x][y]='>',Map[nx][ny]='<';}
        done[x][y]=1;done[nx][ny]=1;cnt-=2;
        for(int i=0;i<4;i++)
        {
            x=nx+di[i][0],y=ny+di[i][1];
            if(check(x,y))
            {
                deg[x][y]--;
                if(deg[x][y]==1)q.push(pi(x,y));
            }
        }
    }
    if(cnt)puts("Not unique");
     for(int i=1;i<=n;i++)printf("%s\n",Map[i]+1);
}


#include<bits/stdc++.h>
using namespace std;
const int inf=1<<29;
const int maxn=4000020;
const int maxm=12000000;
typedef pair<int,int>pi;
struct Edge
{
    int u;
    int v;
    int f;
    int nxt;
    Edge(){}
    Edge(int su,int sv,int sf,int snxt):u(su),v(sv),f(sf),nxt(snxt){}
}E[maxm];
int n,m;
int e,st,x,y,des,head[maxn],level[maxn];
bool vis[maxn];
int q[maxn];
char Map[2100][2100];
pi ji[maxn],ou[maxn];
void AddEdge(int u,int v,int f)
{
    E[e]=Edge(u,v,f,head[u]);
    head[u]=e++;
    E[e]=Edge(v,u,0,head[v]);
    head[v]=e++;
}
void Build()
{
    e=st=0;
    memset(head,-1,sizeof(head));
    for(int i=0;i<x;i++)
        for(int j=0;j<y;j++)
            if(Map[i][j]=='.')
            {
                if((i+j)&1)
                {
                    n++;
                    ji[n].first=i,ji[n].second=j;
                }
                else
                {
                    m++;
                    ou[m].first=i,ou[m].second=j;
                }
            }
    des=n+m+1;
    for(int i=1;i<=n;i++)
        for(int j=1;j<=m;j++)
            if(abs(ou[j].first-ji[i].first)+abs(ou[j].second-ji[i].second)==1)
            AddEdge(i,n+j,1);
    for(int i=1;i<=n;i++)
        AddEdge(st,i,1);
    for(int i=1;i<=m;i++)
        AddEdge(n+i,des,1);
}
bool BFS()
{
    memset(level,0,sizeof(level));
    level[st]=1;
    int pre=0,last=1;
    q[pre]=st;
    while(pre<last)
    {
        int u=q[pre++];
        for(int i=head[u];i!=-1;i=E[i].nxt)
            if(E[i].f&&!level[E[i].v])
            {
                level[E[i].v]=level[u]+1;
                q[last++]=E[i].v;
                if(E[i].v==des)
                    return level[E[i].v];
            }
    }
    return level[des];
}
int DFS(int u,int maxf)
{
    if(u==des||!maxf)
        return maxf;
    int f=0;
    for(int i=head[u];i!=-1;i=E[i].nxt)
        if(E[i].f&&level[E[i].v]==level[u]+1)
        {
            int t=DFS(E[i].v,min(E[i].f,maxf-f));
            if(t>0)
            {
                E[i].f-=t;
                E[i^1].f+=t;
                f+=t;
                if(f==maxf)
                    break;
            }
            else
                level[E[i].v]=0;
        }
    return f;
}
int maxflow()
{
    int ans=0;
    while(BFS())
        ans+=DFS(st,inf);
    return ans;
}
bool dfs(int u,int f)
{
    vis[u]=1;
    for(int &i=head[u];i!=-1;i=E[i].nxt)
        if(E[i].f)
        {
            if(!vis[E[i].v])
            {
                if(dfs(E[i].v,u))
                    return true;
            }
            else if(E[i].v!=f)
                return true;
        }
    vis[u]=0;
    return false;

}
void getdir(int u,int v)
{
    int xu=ji[u].first,yu=ji[u].second;
    int xv=ou[v].first,yv=ou[v].second;
    if(yu>yv){Map[xu][yu]='>',Map[xv][yv]='<';}
    if(yu<yv){Map[xu][yu]='<',Map[xv][yv]='>';}
    if(xu<xv){Map[xu][yu]='^',Map[xv][yv]='v';}
    if(xu>xv){Map[xu][yu]='v',Map[xv][yv]='^';}
}
void pt()
{
    for(int i=0;i<e;i++)
    {
        if(E[i].u!=0&&E[i].u!=des&&E[i].v!=0&&E[i].v!=des&&E[i].f==0)
        {
           // printf("%d %d\n",E[i].u,E[i].v);
            getdir(E[i].u,E[i].v-n);
        }
    }
    for(int i=0;i<x;i++)
        printf("%s\n",Map[i]);
}
void solve()
{
    Build();
    if(n!=m){puts("Not unique");return;}
    int ans=maxflow();
    if(ans!=n)
    {
        puts("Not unique");
        return;
    }
    memset(vis,0,sizeof(vis));
    bool is=false;
    for(int i=1;i<=n;i++)
        if(dfs(i,-1))
            is=true;
    if(!is)
        pt();
    else
        puts("Not unique");
}
int main()
{
    scanf("%d%d",&x,&y);
    for(int i=0;i<x;i++)scanf("%s",Map[i]);
    solve();
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int inf=1<<29;
const int maxn=4000020;
const int maxm=10000010;
typedef pair<int,int>pi;
struct Edge
{
    int u;
    int v;
    int f;
    int nxt;
    Edge(){}
    Edge(int su,int sv,int sf,int snxt):u(su),v(sv),f(sf),nxt(snxt){}
}E[maxm];
int n,m;
int e,st,x,y,des,head[maxn],level[maxn];
bool vis[maxn];
int q[maxn];
char Map[2100][2100];
pi ji[maxn/2],ou[maxn/2];
void AddEdge(int u,int v,int f)
{
    E[e]=Edge(u,v,f,head[u]);
    head[u]=e++;
    E[e]=Edge(v,u,0,head[v]);
    head[v]=e++;
}
void Build()
{
    e=st=0;
    memset(head,-1,sizeof(head));
    for(int i=0;i<x;i++)
        for(int j=0;j<y;j++)
            if(Map[i][j]=='.')
            {
                if((i+j)&1)
                {
                    n++;
                    ji[n].first=i,ji[n].second=j;
                }
                else
                {
                    m++;
                    ou[m].first=i,ou[m].second=j;
                }
            }
    des=n+m+1;
    for(int i=1;i<=n;i++)
        for(int j=1;j<=m;j++)
            if(abs(ou[j].first-ji[i].first)+abs(ou[j].second-ji[i].second)==1)
            AddEdge(i,n+j,1);
    for(int i=1;i<=n;i++)
        AddEdge(st,i,1);
    for(int i=1;i<=m;i++)
        AddEdge(n+i,des,1);
}
bool BFS()
{
    memset(level,0,sizeof(level));
    level[st]=1;
    int pre=0,last=1;
    q[pre]=st;
    while(pre<last)
    {
        int u=q[pre++];
        for(int i=head[u];i!=-1;i=E[i].nxt)
            if(E[i].f&&!level[E[i].v])
            {
                level[E[i].v]=level[u]+1;
                q[last++]=E[i].v;
                if(E[i].v==des)
                    return level[E[i].v];
            }
    }
    return level[des];
}
int DFS(int u,int maxf)
{
    if(u==des||!maxf)
        return maxf;
    int f=0;
    for(int i=head[u];i!=-1;i=E[i].nxt)
        if(E[i].f&&level[E[i].v]==level[u]+1)
        {
            int t=DFS(E[i].v,min(E[i].f,maxf-f));
            if(t>0)
            {
                E[i].f-=t;
                E[i^1].f+=t;
                f+=t;
                if(f==maxf)
                    break;
            }
            else
                level[E[i].v]=0;
        }
    return f;
}
int maxflow()
{
    int ans=0;
    while(BFS())
        ans+=DFS(st,inf);
    return ans;
}
bool dfs(int u,int f)
{
    vis[u]=1;
    for(int &i=head[u];i!=-1;i=E[i].nxt)
        if(E[i].f)
        {
            if(!vis[E[i].v])
            {
                if(dfs(E[i].v,u))
                    return true;
            }
            else if(E[i].v!=f)
                return true;
        }
    vis[u]=0;
    return false;

}
void getdir(int u,int v)
{
    int xu=ji[u].first,yu=ji[u].second;
    int xv=ou[v].first,yv=ou[v].second;
    if(yu>yv){Map[xu][yu]='>',Map[xv][yv]='<';}
    if(yu<yv){Map[xu][yu]='<',Map[xv][yv]='>';}
    if(xu<xv){Map[xu][yu]='^',Map[xv][yv]='v';}
    if(xu>xv){Map[xu][yu]='v',Map[xv][yv]='^';}
}
void pt()
{
    for(int i=0;i<e;i++)
    {
        if(E[i].u!=0&&E[i].u!=des&&E[i].v!=0&&E[i].v!=des&&E[i].f==0)
        {
           // printf("%d %d\n",E[i].u,E[i].v);
            getdir(E[i].u,E[i].v-n);
        }
    }
    for(int i=0;i<x;i++)
        printf("%s\n",Map[i]);
}
void solve()
{
    Build();
    if(n!=m){puts("Not unique");return;}
    int ans=maxflow();
    if(ans!=n)
    {
        puts("Not unique");
        return;
    }
    memset(vis,0,sizeof(vis));
    bool is=false;
    for(int i=1;i<=n;i++)
        if(dfs(i,-1))
            is=true;
    if(!is)
        pt();
    else
        puts("Not unique");
}
int main()
{
    scanf("%d%d",&x,&y);
    for(int i=0;i<x;i++)scanf("%s",Map[i]);
    solve();
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int inf=1<<29;
const int maxn=2100*2100/2;
const int maxm=8200000;
typedef pair<int,int>pi;
struct Edge
{
    int u;
    int v;
    int f;
    int nxt;
    Edge(){}
    Edge(int su,int sv,int sf,int snxt):u(su),v(sv),f(sf),nxt(snxt){}
}E[maxm];
int n,m;
int e,st,x,y,des,head[maxn],level[maxn];
bool vis[maxn];
int q[maxn];
char Map[2100][2100];
pi ji[maxn],ou[maxn];
void AddEdge(int u,int v,int f)
{
    E[e]=Edge(u,v,f,head[u]);
    head[u]=e++;
    E[e]=Edge(v,u,0,head[v]);
    head[v]=e++;
}
void Build()
{
    e=st=0;
    memset(head,-1,sizeof(head));
    for(int i=0;i<x;i++)
        for(int j=0;j<y;j++)
            if(Map[i][j]=='.')
            {
                if((i+j)&1)
                {
                    n++;
                    ji[n].first=i,ji[n].second=j;
                }
                else
                {
                    m++;
                    ou[m].first=i,ou[m].second=j;
                }
            }
    des=n+m+1;
    for(int i=1;i<=n;i++)
        for(int j=1;j<=m;j++)
            if(abs(ou[j].first-ji[i].first)+abs(ou[j].second-ji[i].second)==1)
            AddEdge(i,n+j,1);
    for(int i=1;i<=n;i++)
        AddEdge(st,i,1);
    for(int i=1;i<=m;i++)
        AddEdge(n+i,des,1);
}
bool BFS()
{
    memset(level,0,sizeof(level));
    level[st]=1;
    int pre=0,last=1;
    q[pre]=st;
    while(pre<last)
    {
        int u=q[pre++];
        for(int i=head[u];i!=-1;i=E[i].nxt)
            if(E[i].f&&!level[E[i].v])
            {
                level[E[i].v]=level[u]+1;
                q[last++]=E[i].v;
                if(E[i].v==des)
                    return level[E[i].v];
            }
    }
    return level[des];
}
int DFS(int u,int maxf)
{
    if(u==des||!maxf)
        return maxf;
    int f=0;
    for(int i=head[u];i!=-1;i=E[i].nxt)
        if(E[i].f&&level[E[i].v]==level[u]+1)
        {
            int t=DFS(E[i].v,min(E[i].f,maxf-f));
            if(t>0)
            {
                E[i].f-=t;
                E[i^1].f+=t;
                f+=t;
                if(f==maxf)
                    break;
            }
            else
                level[E[i].v]=0;
        }
    return f;
}
int maxflow()
{
    int ans=0;
    while(BFS())
        ans+=DFS(st,inf);
    return ans;
}
bool dfs(int u,int f)
{
    vis[u]=1;
    for(int &i=head[u];i!=-1;i=E[i].nxt)
        if(E[i].f)
        {
            if(!vis[E[i].v])
            {
                if(dfs(E[i].v,u))
                    return true;
            }
            else if(E[i].v!=f)
                return true;
        }
    vis[u]=0;
    return false;

}
void getdir(int u,int v)
{
    int xu=ji[u].first,yu=ji[u].second;
    int xv=ou[v].first,yv=ou[v].second;
    if(yu>yv){Map[xu][yu]='>',Map[xv][yv]='<';}
    if(yu<yv){Map[xu][yu]='<',Map[xv][yv]='>';}
    if(xu<xv){Map[xu][yu]='^',Map[xv][yv]='v';}
    if(xu>xv){Map[xu][yu]='v',Map[xv][yv]='^';}
}
void pt()
{
    for(int i=0;i<e;i++)
    {
        if(E[i].u!=0&&E[i].u!=des&&E[i].v!=0&&E[i].v!=des&&E[i].f==0)
        {
           // printf("%d %d\n",E[i].u,E[i].v);
            getdir(E[i].u,E[i].v-n);
        }
    }
    for(int i=0;i<x;i++)
        printf("%s\n",Map[i]);
}
void solve()
{
    Build();
    if(n!=m){puts("Not unique");return;}
    int ans=maxflow();
    if(ans!=n)
    {
        puts("Not unique");
        return;
    }
    memset(vis,0,sizeof(vis));
    bool is=false;
    for(int i=1;i<=n;i++)
        if(dfs(i,-1))
            is=true;
    if(!is)
        pt();
    else
        puts("Not unique");
}
int main()
{
    scanf("%d%d",&x,&y);
    for(int i=0;i<x;i++)scanf("%s",Map[i]);
    solve();
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef pair<int,int>pi;
const int Maxn=2002;
int di[4][2]={{1,0},{-1,0},{0,1},{0,-1}};
int n,m;
bool done[Maxn][Maxn];
char Map[Maxn][Maxn];
int deg[Maxn][Maxn];
int cnt;
queue<pi>q;
bool check(int x,int y)
{
    if(x<1||x>n||y<1||y>m||done[x][y]||Map[x][y]=='*')return false;
    return true;
}
int find(int x,int y)
{
    for(int i=0;i<4;i++)
        if(check(x+di[i][0],y+di[i][1]))
            return i;
    return -1;
}
int main()
{
    scanf("%d%d",&n,&m);
    for(int i=1;i<=n;i++)
        scanf("%s",Map[i]+1);
    for(int i=1;i<=n;i++)
        for(int j=1;j<=m;j++)
        {
            if(Map[i][j]=='.')
            {
                cnt++;
                deg[i][j]=0;
                for(int k=0;k<4;k++)
                {
                    if(check(i+di[k][0],j+di[k][1]))deg[i][j]++;
                }
                if(deg[i][j]==1)q.push(pi(i,j));
            }
        }
    while(!q.empty())
    {
        pi u=q.front();q.pop();
        int x=u.first,y=u.second;
        if(done[x][y])continue;
        int t=find(x,y);
        int nx=x+di[t][0],ny=y+di[t][1];
        if(t==0){Map[x][y]='^',Map[nx][ny]='v';}
        if(t==1){Map[x][y]='v',Map[nx][ny]='^';}
        if(t==2){Map[x][y]='<',Map[nx][ny]='>';}
        if(t==3){Map[x][y]='>',Map[nx][ny]='<';}
        done[x][y]=1;done[nx][ny]=1;cnt-=2;
        for(int i=0;i<4;i++)
        {
            x=nx+di[i][0],y=nx+di[i][1];
            if(check(x,y))
            {
                deg[x][y]--;
                if(deg[x][y]==1)q.push(pi(x,y));
            }
        }
    }
    if(cnt)puts("Not unique");
    else for(int i=1;i<=n;i++)printf("%s\n",Map[i]+1);
}


#include<bits/stdc++.h>
using namespace std;
typedef pair<int,int>pi;
const int Maxn=2002;
int di[4][2]={{1,0},{-1,0},{0,1},{0,-1}};
int n,m;
bool done[Maxn][Maxn];
char Map[Maxn][Maxn];
int deg[Maxn][Maxn];
int cnt;
queue<pi>q;
bool check(int x,int y)
{
    if(x<1||x>n||y<1||y>m||done[x][y]||Map[x][y]=='*')return false;
    return true;
}
int find(int x,int y)
{
    for(int i=0;i<4;i++)
        if(check(x+di[i][0],y+di[i][1]))
            return i;
    return -1;
}
int main()
{
    scanf("%d%d",&n,&m);
    for(int i=1;i<=n;i++)
        scanf("%s",Map[i]+1);
    for(int i=1;i<=n;i++)
        for(int j=1;j<=m;j++)
        {
            if(Map[i][j]=='.')
            {
                cnt++;
                deg[i][j]=0;
                for(int k=0;k<4;k++)
                {
                    if(check(i+di[k][0],j+di[k][1]))deg[i][j]++;
                }
                if(deg[i][j]==1)q.push(pi(i,j));
            }
        }
    while(!q.empty())
    {
        pi u=q.front();q.pop();
        int x=u.first,y=u.second;
        if(done[x][y])continue;
        int t=find(x,y);
        int nx=x+di[t][0],ny=y+di[t][1];
        if(t==0){Map[x][y]='^',Map[nx][ny]='v';}
        if(t==1){Map[x][y]='v',Map[nx][ny]='^';}
        if(t==2){Map[x][y]='<',Map[nx][ny]='>';}
        if(t==3){Map[x][y]='>',Map[nx][ny]='<';}
        done[x][y]=1;done[nx][ny]=1;cnt-=2;
        for(int i=0;i<4;i++)
        {
            x=nx+di[i][0],y=ny+di[i][1];
            if(check(x,y))
            {
                deg[x][y]--;
                if(deg[x][y]==1)q.push(pi(x,y));
            }
        }
    }
    if(cnt)puts("Not unique");
    else for(int i=1;i<=n;i++)printf("%s\n",Map[i]+1);
}


#include<bits/stdc++.h>
using namespace std;
const int inf=1<<29;
const int maxn=2100;
const int maxm=6e5;
typedef pair<int,int>pi;
struct Edge
{
    int u;
    int v;
    int f;
    int nxt;
    Edge(){}
    Edge(int su,int sv,int sf,int snxt):u(su),v(sv),f(sf),nxt(snxt){}
}E[maxm];
int n,m;
int e,st,x,y,des,head[maxn],level[maxn];
bool vis[maxn];
int q[maxn];
char Map[maxn][maxn];
pi ji[maxn*maxn],ou[maxn*maxn];
void AddEdge(int u,int v,int f)
{
    E[e]=Edge(u,v,f,head[u]);
    head[u]=e++;
    E[e]=Edge(v,u,0,head[v]);
    head[v]=e++;
}
void Build()
{
    e=st=0;
    memset(head,-1,sizeof(head));
    for(int i=0;i<x;i++)
        for(int j=0;j<y;j++)
            if(Map[i][j]=='.')
            {
                if((i+j)&1)
                {
                    n++;
                    ji[n].first=i,ji[n].second=j;
                }
                else
                {
                    m++;
                    ou[m].first=i,ou[m].second=j;
                }
            }
    des=n+m+1;
    for(int i=1;i<=n;i++)
        for(int j=1;j<=m;j++)
            if(abs(ou[j].first-ji[i].first)+abs(ou[j].second-ji[i].second)==1)
            AddEdge(i,n+j,1);
    for(int i=1;i<=n;i++)
        AddEdge(st,i,1);
    for(int i=1;i<=m;i++)
        AddEdge(n+i,des,1);
}
bool BFS()
{
    memset(level,0,sizeof(level));
    level[st]=1;
    int pre=0,last=1;
    q[pre]=st;
    while(pre<last)
    {
        int u=q[pre++];
        for(int i=head[u];i!=-1;i=E[i].nxt)
            if(E[i].f&&!level[E[i].v])
            {
                level[E[i].v]=level[u]+1;
                q[last++]=E[i].v;
                if(E[i].v==des)
                    return level[E[i].v];
            }
    }
    return level[des];
}
int DFS(int u,int maxf)
{
    if(u==des||!maxf)
        return maxf;
    int f=0;
    for(int i=head[u];i!=-1;i=E[i].nxt)
        if(E[i].f&&level[E[i].v]==level[u]+1)
        {
            int t=DFS(E[i].v,min(E[i].f,maxf-f));
            if(t>0)
            {
                E[i].f-=t;
                E[i^1].f+=t;
                f+=t;
                if(f==maxf)
                    break;
            }
            else
                level[E[i].v]=0;
        }
    return f;
}
int maxflow()
{
    int ans=0;
    while(BFS())
        ans+=DFS(st,inf);
    return ans;
}
bool dfs(int u,int f)
{
    vis[u]=1;
    for(int &i=head[u];i!=-1;i=E[i].nxt)
        if(E[i].f)
        {
            if(!vis[E[i].v])
            {
                if(dfs(E[i].v,u))
                    return true;
            }
            else if(E[i].v!=f)
                return true;
        }
    vis[u]=0;
    return false;

}
void getdir(int u,int v)
{
    int xu=ji[u].first,yu=ji[u].second;
    int xv=ou[v].first,yv=ou[v].second;
    if(yu>yv){Map[xu][yu]='>',Map[xv][yv]='<';}
    if(yu<yv){Map[xu][yu]='<',Map[xv][yv]='>';}
    if(xu<xv){Map[xu][yu]='^',Map[xv][yv]='v';}
    if(xu>xv){Map[xu][yu]='v',Map[xv][yv]='^';}
}
void pt()
{
    for(int i=0;i<e;i++)
    {
        if(E[i].u!=0&&E[i].u!=des&&E[i].v!=0&&E[i].v!=des&&E[i].f==0)
        {
           // printf("%d %d\n",E[i].u,E[i].v);
            getdir(E[i].u,E[i].v-n);
        }
    }
    for(int i=0;i<x;i++)
        printf("%s\n",Map[i]);
}
void solve()
{
    Build();
    if(n!=m){puts("Not unique");return;}
    int ans=maxflow();
    if(ans!=n)
    {
        puts("Not unique");
        return;
    }
    memset(vis,0,sizeof(vis));
    bool is=false;
    for(int i=1;i<=n;i++)
        if(dfs(i,-1))
            is=true;
    if(!is)
        pt();
    else
        puts("Not unique");
}
int main()
{
    scanf("%d%d",&x,&y);
    for(int i=0;i<x;i++)scanf("%s",Map[i]);
    solve();
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int inf=1<<29;
const int maxn=2100*2100/2;
const int maxm=12200000;
typedef pair<int,int>pi;
struct Edge
{
    int u;
    int v;
    int f;
    int nxt;
    Edge(){}
    Edge(int su,int sv,int sf,int snxt):u(su),v(sv),f(sf),nxt(snxt){}
}E[maxm];
int n,m;
int e,st,x,y,des,head[maxn],level[maxn];
bool vis[maxn];
int q[maxn];
char Map[2100][2100];
pi ji[maxn],ou[maxn];
void AddEdge(int u,int v,int f)
{
    E[e]=Edge(u,v,f,head[u]);
    head[u]=e++;
    E[e]=Edge(v,u,0,head[v]);
    head[v]=e++;
}
void Build()
{
    e=st=0;
    memset(head,-1,sizeof(head));
    for(int i=0;i<x;i++)
        for(int j=0;j<y;j++)
            if(Map[i][j]=='.')
            {
                if((i+j)&1)
                {
                    n++;
                    ji[n].first=i,ji[n].second=j;
                }
                else
                {
                    m++;
                    ou[m].first=i,ou[m].second=j;
                }
            }
    des=n+m+1;
    for(int i=1;i<=n;i++)
        for(int j=1;j<=m;j++)
            if(abs(ou[j].first-ji[i].first)+abs(ou[j].second-ji[i].second)==1)
            AddEdge(i,n+j,1);
    for(int i=1;i<=n;i++)
        AddEdge(st,i,1);
    for(int i=1;i<=m;i++)
        AddEdge(n+i,des,1);
}
bool BFS()
{
    memset(level,0,sizeof(level));
    level[st]=1;
    int pre=0,last=1;
    q[pre]=st;
    while(pre<last)
    {
        int u=q[pre++];
        for(int i=head[u];i!=-1;i=E[i].nxt)
            if(E[i].f&&!level[E[i].v])
            {
                level[E[i].v]=level[u]+1;
                q[last++]=E[i].v;
                if(E[i].v==des)
                    return level[E[i].v];
            }
    }
    return level[des];
}
int DFS(int u,int maxf)
{
    if(u==des||!maxf)
        return maxf;
    int f=0;
    for(int i=head[u];i!=-1;i=E[i].nxt)
        if(E[i].f&&level[E[i].v]==level[u]+1)
        {
            int t=DFS(E[i].v,min(E[i].f,maxf-f));
            if(t>0)
            {
                E[i].f-=t;
                E[i^1].f+=t;
                f+=t;
                if(f==maxf)
                    break;
            }
            else
                level[E[i].v]=0;
        }
    return f;
}
int maxflow()
{
    int ans=0;
    while(BFS())
        ans+=DFS(st,inf);
    return ans;
}
bool dfs(int u,int f)
{
    vis[u]=1;
    for(int &i=head[u];i!=-1;i=E[i].nxt)
        if(E[i].f)
        {
            if(!vis[E[i].v])
            {
                if(dfs(E[i].v,u))
                    return true;
            }
            else if(E[i].v!=f)
                return true;
        }
    vis[u]=0;
    return false;

}
void getdir(int u,int v)
{
    int xu=ji[u].first,yu=ji[u].second;
    int xv=ou[v].first,yv=ou[v].second;
    if(yu>yv){Map[xu][yu]='>',Map[xv][yv]='<';}
    if(yu<yv){Map[xu][yu]='<',Map[xv][yv]='>';}
    if(xu<xv){Map[xu][yu]='^',Map[xv][yv]='v';}
    if(xu>xv){Map[xu][yu]='v',Map[xv][yv]='^';}
}
void pt()
{
    for(int i=0;i<e;i++)
    {
        if(E[i].u!=0&&E[i].u!=des&&E[i].v!=0&&E[i].v!=des&&E[i].f==0)
        {
           // printf("%d %d\n",E[i].u,E[i].v);
            getdir(E[i].u,E[i].v-n);
        }
    }
    for(int i=0;i<x;i++)
        printf("%s\n",Map[i]);
}
void solve()
{
    Build();
    if(n!=m){puts("Not unique");return;}
    int ans=maxflow();
    if(ans!=n)
    {
        puts("Not unique");
        return;
    }
    memset(vis,0,sizeof(vis));
    bool is=false;
    for(int i=1;i<=n;i++)
        if(dfs(i,-1))
            is=true;
    if(!is)
        pt();
    else
        puts("Not unique");
}
int main()
{
    scanf("%d%d",&x,&y);
    for(int i=0;i<x;i++)scanf("%s",Map[i]);
    solve();
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int inf=1<<29;
const int maxn=4000020;
const int maxm=10000010;
typedef pair<int,int>pi;
struct Edge
{
    int u;
    int v;
    int f;
    int nxt;
    Edge(){}
    Edge(int su,int sv,int sf,int snxt):u(su),v(sv),f(sf),nxt(snxt){}
}E[maxm];
int n,m;
int e,st,x,y,des,head[maxn],level[maxn];
bool vis[maxn];
int q[maxn];
char Map[2100][2100];
pi ji[maxn],ou[maxn];
void AddEdge(int u,int v,int f)
{
    E[e]=Edge(u,v,f,head[u]);
    head[u]=e++;
    E[e]=Edge(v,u,0,head[v]);
    head[v]=e++;
}
void Build()
{
    e=st=0;
    memset(head,-1,sizeof(head));
    for(int i=0;i<x;i++)
        for(int j=0;j<y;j++)
            if(Map[i][j]=='.')
            {
                if((i+j)&1)
                {
                    n++;
                    ji[n].first=i,ji[n].second=j;
                }
                else
                {
                    m++;
                    ou[m].first=i,ou[m].second=j;
                }
            }
    des=n+m+1;
    for(int i=1;i<=n;i++)
        for(int j=1;j<=m;j++)
            if(abs(ou[j].first-ji[i].first)+abs(ou[j].second-ji[i].second)==1)
            AddEdge(i,n+j,1);
    for(int i=1;i<=n;i++)
        AddEdge(st,i,1);
    for(int i=1;i<=m;i++)
        AddEdge(n+i,des,1);
}
bool BFS()
{
    memset(level,0,sizeof(level));
    level[st]=1;
    int pre=0,last=1;
    q[pre]=st;
    while(pre<last)
    {
        int u=q[pre++];
        for(int i=head[u];i!=-1;i=E[i].nxt)
            if(E[i].f&&!level[E[i].v])
            {
                level[E[i].v]=level[u]+1;
                q[last++]=E[i].v;
                if(E[i].v==des)
                    return level[E[i].v];
            }
    }
    return level[des];
}
int DFS(int u,int maxf)
{
    if(u==des||!maxf)
        return maxf;
    int f=0;
    for(int i=head[u];i!=-1;i=E[i].nxt)
        if(E[i].f&&level[E[i].v]==level[u]+1)
        {
            int t=DFS(E[i].v,min(E[i].f,maxf-f));
            if(t>0)
            {
                E[i].f-=t;
                E[i^1].f+=t;
                f+=t;
                if(f==maxf)
                    break;
            }
            else
                level[E[i].v]=0;
        }
    return f;
}
int maxflow()
{
    int ans=0;
    while(BFS())
        ans+=DFS(st,inf);
    return ans;
}
bool dfs(int u,int f)
{
    vis[u]=1;
    for(int &i=head[u];i!=-1;i=E[i].nxt)
        if(E[i].f)
        {
            if(!vis[E[i].v])
            {
                if(dfs(E[i].v,u))
                    return true;
            }
            else if(E[i].v!=f)
                return true;
        }
    vis[u]=0;
    return false;

}
void getdir(int u,int v)
{
    int xu=ji[u].first,yu=ji[u].second;
    int xv=ou[v].first,yv=ou[v].second;
    if(yu>yv){Map[xu][yu]='>',Map[xv][yv]='<';}
    if(yu<yv){Map[xu][yu]='<',Map[xv][yv]='>';}
    if(xu<xv){Map[xu][yu]='^',Map[xv][yv]='v';}
    if(xu>xv){Map[xu][yu]='v',Map[xv][yv]='^';}
}
void pt()
{
    for(int i=0;i<e;i++)
    {
        if(E[i].u!=0&&E[i].u!=des&&E[i].v!=0&&E[i].v!=des&&E[i].f==0)
        {
           // printf("%d %d\n",E[i].u,E[i].v);
            getdir(E[i].u,E[i].v-n);
        }
    }
    for(int i=0;i<x;i++)
        printf("%s\n",Map[i]);
}
void solve()
{
    Build();
    if(n!=m){puts("Not unique");return;}
    int ans=maxflow();
    if(ans!=n)
    {
        puts("Not unique");
        return;
    }
    memset(vis,0,sizeof(vis));
    bool is=false;
    for(int i=1;i<=n;i++)
        if(dfs(i,-1))
            is=true;
    if(!is)
        pt();
    else
        puts("Not unique");
}
int main()
{
    scanf("%d%d",&x,&y);
    for(int i=0;i<x;i++)scanf("%s",Map[i]);
    solve();
    return 0;
}


#include <bits/stdc++.h>

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FORD(i, a, b) for(int i = (a); i >= (b); --i)
#define VAR(v, i) __typeof(i) v=(i)
#define FORE(i, c) for(VAR(i, (c).begin()); i != (c).end(); ++i)
#define all(v) (v).begin(),(v).end()

#define VI vector<int>
#define PII pair<int,int>
#define st first
#define nd second
#define mp make_pair
#define pb push_back
#define lint long long int

#define debug(x) {cerr <<#x <<" = " <<x <<endl; }
#define debug2(x,y) {cerr <<#x <<" = " <<x << ", "<<#y<<" = "<< y <<endl; }
#define debug3(x,y,z) {cerr <<#x <<" = " <<x << ", "<<#y<<" = "<< y << ", " << #z << " = " << z <<endl; }
#define debugv(x) {{cerr <<#x <<" = "; FORE(itt, (x)) cerr <<*itt <<", "; cerr <<endl; }}
#define debugt(t,n) {{cerr <<#t <<" = "; FOR(it,0,(n)) cerr <<t[it] <<", "; cerr <<endl; }}

#define make( x) int (x); scanf("%d",&(x));
#define make2( x, y) int (x), (y); scanf("%d%d",&(x),&(y));
#define make3(x, y, z) int (x), (y), (z); scanf("%d%d%d",&(x),&(y),&(z));
#define make4(x, y, z, t) int (x), (y), (z), (t); scanf("%d%d%d%d",&(x),&(y),&(z),&(t));
#define makev(v,n) VI (v); FOR(i,0,(n)) { make(a); (v).pb(a);}
#define IOS ios_base::sync_with_stdio(0)
#define HEAP priority_queue

#define read( x) scanf("%d",&(x));
#define read2( x, y) scanf("%d%d",&(x),&(y));
#define read3(x, y, z) scanf("%d%d%d",&(x),&(y),&(z));
#define read4(x, y, z, t) scanf("%d%d%d%d",&(x),&(y),&(z),&(t));
#define readv(v,n) FOR(i,0,(n)) { make(a); (v).pb(a);}

using namespace std;

int n,m;
char s[2005][2005];
int byl[2005][2005];
int deg[2005][2005];
int mate[2005][2005];

int dx[]={1,0,0,-1};
int dy[]={0,-1,1,0};
char sg[]={'^','>','<','v'};

bool check(int a,int b){
	return (a>=0 && a<n && b>=0 && b < m && s[a][b]=='.');
}

int main(){
	read2(n,m);
	FOR(i,0,n) scanf("%s",s[i]);
	FOR(i,0,n) FOR(j,0,m) mate[i][j] = -1;

	FOR(i,0,n) FOR(j,0,m) deg[i][j] = 0;
	FOR(i,0,n) FOR(j,0,m) FOR(k,0,4)
		if(s[i][j]!='.') continue;
	  else if(check(i+dx[k],j+dy[k])) deg[i][j]++;

	vector<PII> kju;

	FOR(i,0,n) FOR(j,0,n){
		if(s[i][j]=='.' && deg[i][j]==0){
			printf("Not unique\n"); return 0;
		}
		if(s[i][j]=='.' && deg[i][j]==1){
			kju.pb(mp(i,j));
		}
	}
	int i = 0;
	while(1){
		if(i >= kju.size()) break;
		int ax = kju[i].st, ay = kju[i].nd;
		i++;
		if(mate[ax][ay]!=-1) continue;
		int bx = -1,by =-1;
		bool ok = false;
		FOR(j,0,4){
			bx = ax+dx[j], by = ay+dy[j];
			if(check(bx,by) && mate[bx][by]==-1){
				mate[ax][ay] = j;
				mate[bx][by] = 3-j;
				ok = true;
				break;
			}
		}
		if(!ok){
			printf("Not unique\n"); return 0;
		}
		FOR(j,0,4){
			int cx = bx+dx[j], cy = by+dy[j];
			if(check(cx,cy) && mate[cx][cy]==-1){
				deg[cx][cy]--;
				if(deg[cx][cy]==1) kju.pb(mp(cx,cy));
			}
		}
	}
	FOR(i,0,n) FOR(j,0,m){
		if(s[i][j]=='.' && mate[i][j]==-1){
			printf("Not unique\n"); return 0;
		}
	}
	FOR(i,0,n){
		FOR(j,0,m){
			if(s[i][j]!='.') printf("%c",s[i][j]);
			else printf("%c",sg[mate[i][j]]);
		}
		printf("\n");
	}
}


#include <bits/stdc++.h>

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FORD(i, a, b) for(int i = (a); i >= (b); --i)
#define VAR(v, i) __typeof(i) v=(i)
#define FORE(i, c) for(VAR(i, (c).begin()); i != (c).end(); ++i)
#define all(v) (v).begin(),(v).end()

#define VI vector<int>
#define PII pair<int,int>
#define st first
#define nd second
#define mp make_pair
#define pb push_back
#define lint long long int

#define debug(x) {cerr <<#x <<" = " <<x <<endl; }
#define debug2(x,y) {cerr <<#x <<" = " <<x << ", "<<#y<<" = "<< y <<endl; }
#define debug3(x,y,z) {cerr <<#x <<" = " <<x << ", "<<#y<<" = "<< y << ", " << #z << " = " << z <<endl; }
#define debugv(x) {{cerr <<#x <<" = "; FORE(itt, (x)) cerr <<*itt <<", "; cerr <<endl; }}
#define debugt(t,n) {{cerr <<#t <<" = "; FOR(it,0,(n)) cerr <<t[it] <<", "; cerr <<endl; }}

#define make( x) int (x); scanf("%d",&(x));
#define make2( x, y) int (x), (y); scanf("%d%d",&(x),&(y));
#define make3(x, y, z) int (x), (y), (z); scanf("%d%d%d",&(x),&(y),&(z));
#define make4(x, y, z, t) int (x), (y), (z), (t); scanf("%d%d%d%d",&(x),&(y),&(z),&(t));
#define makev(v,n) VI (v); FOR(i,0,(n)) { make(a); (v).pb(a);}
#define IOS ios_base::sync_with_stdio(0)
#define HEAP priority_queue

#define read( x) scanf("%d",&(x));
#define read2( x, y) scanf("%d%d",&(x),&(y));
#define read3(x, y, z) scanf("%d%d%d",&(x),&(y),&(z));
#define read4(x, y, z, t) scanf("%d%d%d%d",&(x),&(y),&(z),&(t));
#define readv(v,n) FOR(i,0,(n)) { make(a); (v).pb(a);}

using namespace std;

int n,m;
char s[2005][2005];
int byl[2005][2005];
int deg[2005][2005];
int mate[2005][2005];

int dx[]={1,0,0,-1};
int dy[]={0,-1,1,0};
char sg[]={'^','>','<','v'};

bool check(int a,int b){
	return (a>=0 && a<n && b>=0 & b < m && s[a][b]=='.');
}

int main(){
	read2(n,m);
	FOR(i,0,n) scanf("%s",s[i]);
	FOR(i,0,n) FOR(j,0,m) mate[i][j] = -1;

	FOR(i,0,n) FOR(j,0,m) deg[i][j] = 0;
	FOR(i,0,n) FOR(j,0,m) FOR(k,0,4)
		if(s[i][j]!='.') continue;
	  else if(check(i+dx[k],j+dy[k])) deg[i][j]++;

	vector<PII> kju;

	FOR(i,0,n) FOR(j,0,n){
		if(s[i][j]=='.' && deg[i][j]==0){
			printf("Not unique\n"); return 0;
		}
		if(s[i][j]=='.' && deg[i][j]==1){
			kju.pb(mp(i,j));
		}
	}
	int i = 0;
	while(1){
		if(i >= kju.size()) break;
		int ax = kju[i].st, ay = kju[i].nd;
		i++;
		if(mate[ax][ay]!=-1) continue;
		int bx = -1,by =-1;
		bool ok = false;
		FOR(j,0,4){
			bx = ax+dx[j], by = ay+dy[j];
			if(check(bx,by) && mate[bx][by]==-1){
				mate[ax][ay] = j;
				mate[bx][by] = 3-j;
				ok = true;
				break;
			}
		}
		if(!ok){
			printf("Not unique\n"); return 0;
		}
		FOR(j,0,4){
			int cx = bx+dx[j], cy = by+dy[j];
			if(check(cx,cy) && mate[cx][cy]==-1){
				deg[cx][cy]--;
				if(deg[cx][cy]==1) kju.pb(mp(cx,cy));
			}
		}
	}
	FOR(i,0,n) FOR(j,0,m){
		if(s[i][j]=='.' && mate[i][j]==-1){
			printf("Not unique\n"); return 0;
		}
	}
	FOR(i,0,n){
		FOR(j,0,m){
			if(s[i][j]!='.') printf("%c",s[i][j]);
			else printf("%c",sg[mate[i][j]]);
		}
		printf("\n");
	}
}


#include <bits/stdc++.h>

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FORD(i, a, b) for(int i = (a); i >= (b); --i)
#define VAR(v, i) __typeof(i) v=(i)
#define FORE(i, c) for(VAR(i, (c).begin()); i != (c).end(); ++i)
#define all(v) (v).begin(),(v).end()

#define VI vector<int>
#define PII pair<int,int>
#define st first
#define nd second
#define mp make_pair
#define pb push_back
#define lint long long int

#define debug(x) {cerr <<#x <<" = " <<x <<endl; }
#define debug2(x,y) {cerr <<#x <<" = " <<x << ", "<<#y<<" = "<< y <<endl; }
#define debug3(x,y,z) {cerr <<#x <<" = " <<x << ", "<<#y<<" = "<< y << ", " << #z << " = " << z <<endl; }
#define debugv(x) {{cerr <<#x <<" = "; FORE(itt, (x)) cerr <<*itt <<", "; cerr <<endl; }}
#define debugt(t,n) {{cerr <<#t <<" = "; FOR(it,0,(n)) cerr <<t[it] <<", "; cerr <<endl; }}

#define make( x) int (x); scanf("%d",&(x));
#define make2( x, y) int (x), (y); scanf("%d%d",&(x),&(y));
#define make3(x, y, z) int (x), (y), (z); scanf("%d%d%d",&(x),&(y),&(z));
#define make4(x, y, z, t) int (x), (y), (z), (t); scanf("%d%d%d%d",&(x),&(y),&(z),&(t));
#define makev(v,n) VI (v); FOR(i,0,(n)) { make(a); (v).pb(a);}
#define IOS ios_base::sync_with_stdio(0)
#define HEAP priority_queue

#define read( x) scanf("%d",&(x));
#define read2( x, y) scanf("%d%d",&(x),&(y));
#define read3(x, y, z) scanf("%d%d%d",&(x),&(y),&(z));
#define read4(x, y, z, t) scanf("%d%d%d%d",&(x),&(y),&(z),&(t));
#define readv(v,n) FOR(i,0,(n)) { make(a); (v).pb(a);}

using namespace std;

int n,m;
char s[2005][2005];
int byl[2005][2005];
int deg[2005][2005];
int mate[2005][2005];

int dx[]={1,0,0,-1};
int dy[]={0,-1,1,0};
char sg[]={'^','>','<','v'};

bool dfs(int k, int l,int px,int py){
	bool ok = true;
	byl[k][l] = 1;
	FOR(i,0,4){
		if(k+dx[i]>=0 && k+dx[i]<n && l+dy[i]>=0 && l+dy[i]<m){
			if(s[k+dx[i]][l+dy[i]]=='.'){
				if(byl[k+dx[i]][l+dy[i]]==0) ok = ok && dfs(k+dx[i],l+dy[i],k,l);
				else if(k+dx[i]!=px || l+dy[i]!=py) return false;
			}
		}
	}
	return ok;
}

int main(){
	read2(n,m);
	FOR(i,0,n) scanf("%s",s[i]);
	FOR(i,0,n) FOR(j,0,m) byl[i][j] = 0;
	FOR(i,0,n) FOR(j,0,m) mate[i][j] = -1;
/*	bool ok = true;
	FOR(i,0,n) FOR(j,0,m){
		if(s[i][j]=='.' && byl[i][j]==0) ok = ok && dfs(i,j,-1,-1);
	}
	if(!ok){
		printf("Not unique\n");
		return 0;
	}*/
	FOR(i,0,n) FOR(j,0,m) deg[i][j] = 0;
	FOR(i,0,n) FOR(j,0,m) FOR(k,0,4)
		if(s[i][j]!='.') continue;
	  else if(i+dx[k]>=0 && i+dx[k]<n && j+dy[k]>=0 && j+dy[k]<m && s[i+dx[k]][j+dy[k]]=='.') deg[i][j]++;

	vector<PII> kju;

	FOR(i,0,n) FOR(j,0,n){
		if(s[i][j]=='.' && deg[i][j]==0){
			printf("Not unique\n"); return 0;
		}
		if(s[i][j]=='.' && deg[i][j]==1){
			kju.pb(mp(i,j));
		}
	}
	int i = 0;
	while(1){
		if(i >= kju.size()) break;
		int ax = kju[i].st, ay = kju[i].nd;
		i++;
		if(mate[ax][ay]!=-1) continue;
		int bx = -1,by =-1;
		FOR(j,0,4){
			bx = ax+dx[j], by = ay+dy[j];
			if(bx>=0 && bx<n && by>=0 && by<m && s[bx][by]=='.' && mate[bx][by]==-1){
				mate[ax][ay] = j;
				mate[bx][by] = 3-j;
				break;
			}
		}
		if(bx==-1 || by==-1){
			printf("Not unique\n"); return 0;
		}
		FOR(j,0,4){
			int cx = bx+dx[j], cy = by+dy[j];
			if(cx>=0 && cx<n && cy>=0 && cy<m && s[cx][cy]=='.' && mate[cx][cy]==-1){
				deg[cx][cy]--;
				if(deg[cx][cy]==1) kju.pb(mp(cx,cy));
			}
		}
	}
	FOR(i,0,n) FOR(j,0,m){
		if(s[i][j]=='.' && mate[i][j]==-1){
			printf("Not unique\n"); return 0;
		}
	}
	FOR(i,0,n){
		FOR(j,0,m){
			if(s[i][j]!='.') printf("%c",s[i][j]);
			else printf("%c",sg[mate[i][j]]);
		}
		printf("\n");
	}
}


#include <bits/stdc++.h>

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FORD(i, a, b) for(int i = (a); i >= (b); --i)
#define VAR(v, i) __typeof(i) v=(i)
#define FORE(i, c) for(VAR(i, (c).begin()); i != (c).end(); ++i)
#define all(v) (v).begin(),(v).end()

#define VI vector<int>
#define PII pair<int,int>
#define st first
#define nd second
#define mp make_pair
#define pb push_back
#define lint long long int

#define debug(x) {cerr <<#x <<" = " <<x <<endl; }
#define debug2(x,y) {cerr <<#x <<" = " <<x << ", "<<#y<<" = "<< y <<endl; }
#define debug3(x,y,z) {cerr <<#x <<" = " <<x << ", "<<#y<<" = "<< y << ", " << #z << " = " << z <<endl; }
#define debugv(x) {{cerr <<#x <<" = "; FORE(itt, (x)) cerr <<*itt <<", "; cerr <<endl; }}
#define debugt(t,n) {{cerr <<#t <<" = "; FOR(it,0,(n)) cerr <<t[it] <<", "; cerr <<endl; }}

#define make( x) int (x); scanf("%d",&(x));
#define make2( x, y) int (x), (y); scanf("%d%d",&(x),&(y));
#define make3(x, y, z) int (x), (y), (z); scanf("%d%d%d",&(x),&(y),&(z));
#define make4(x, y, z, t) int (x), (y), (z), (t); scanf("%d%d%d%d",&(x),&(y),&(z),&(t));
#define makev(v,n) VI (v); FOR(i,0,(n)) { make(a); (v).pb(a);}
#define IOS ios_base::sync_with_stdio(0)
#define HEAP priority_queue

#define read( x) scanf("%d",&(x));
#define read2( x, y) scanf("%d%d",&(x),&(y));
#define read3(x, y, z) scanf("%d%d%d",&(x),&(y),&(z));
#define read4(x, y, z, t) scanf("%d%d%d%d",&(x),&(y),&(z),&(t));
#define readv(v,n) FOR(i,0,(n)) { make(a); (v).pb(a);}

using namespace std;

int n,m;
char s[2005][2005];
int byl[2005][2005];
int deg[2005][2005];
int mate[2005][2005];

int dx[]={1,0,0,-1};
int dy[]={0,-1,1,0};
char sg[]={'^','>','<','v'};

bool check(int a,int b){
	return (a>=0 && a<n && b>=0 && b < m && s[a][b]=='.');
}

int main(){
	read2(n,m);
	FOR(i,0,n) scanf("%s",s[i]);
	FOR(i,0,n) FOR(j,0,m) mate[i][j] = -1;

	FOR(i,0,n) FOR(j,0,m) deg[i][j] = 0;
	FOR(i,0,n) FOR(j,0,m) FOR(k,0,4)
		if(s[i][j]!='.') continue;
	  else if(check(i+dx[k],j+dy[k])) deg[i][j]++;

	vector<PII> kju;

	FOR(i,0,n) FOR(j,0,m){
		if(s[i][j]=='.' && deg[i][j]==0){
			printf("Not unique\n"); return 0;
		}
		if(s[i][j]=='.' && deg[i][j]==1){
			kju.pb(mp(i,j));
		}
	}
	int i = 0;
	while(1){
		if(i >= kju.size()) break;
		int ax = kju[i].st, ay = kju[i].nd;
		i++;
		if(mate[ax][ay]!=-1) continue;
		int bx = -1,by =-1;
		bool ok = false;
		FOR(j,0,4){
			bx = ax+dx[j], by = ay+dy[j];
			if(check(bx,by) && mate[bx][by]==-1){
				mate[ax][ay] = j;
				mate[bx][by] = 3-j;
				ok = true;
				break;
			}
		}
		if(!ok){
			printf("Not unique\n"); return 0;
		}
		FOR(j,0,4){
			int cx = bx+dx[j], cy = by+dy[j];
			if(check(cx,cy) && mate[cx][cy]==-1){
				deg[cx][cy]--;
				if(deg[cx][cy]==1) kju.pb(mp(cx,cy));
			}
		}
	}
	FOR(i,0,n) FOR(j,0,m){
		if(s[i][j]=='.' && mate[i][j]==-1){
			printf("Not unique\n"); return 0;
		}
	}
	FOR(i,0,n){
		FOR(j,0,m){
			if(s[i][j]!='.') printf("%c",s[i][j]);
			else printf("%c",sg[mate[i][j]]);
		}
		printf("\n");
	}
}


#include <bits/stdc++.h>

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FORD(i, a, b) for(int i = (a); i >= (b); --i)
#define VAR(v, i) __typeof(i) v=(i)
#define FORE(i, c) for(VAR(i, (c).begin()); i != (c).end(); ++i)
#define all(v) (v).begin(),(v).end()

#define VI vector<int>
#define PII pair<int,int>
#define st first
#define nd second
#define mp make_pair
#define pb push_back
#define lint long long int

#define debug(x) {cerr <<#x <<" = " <<x <<endl; }
#define debug2(x,y) {cerr <<#x <<" = " <<x << ", "<<#y<<" = "<< y <<endl; }
#define debug3(x,y,z) {cerr <<#x <<" = " <<x << ", "<<#y<<" = "<< y << ", " << #z << " = " << z <<endl; }
#define debugv(x) {{cerr <<#x <<" = "; FORE(itt, (x)) cerr <<*itt <<", "; cerr <<endl; }}
#define debugt(t,n) {{cerr <<#t <<" = "; FOR(it,0,(n)) cerr <<t[it] <<", "; cerr <<endl; }}

#define make( x) int (x); scanf("%d",&(x));
#define make2( x, y) int (x), (y); scanf("%d%d",&(x),&(y));
#define make3(x, y, z) int (x), (y), (z); scanf("%d%d%d",&(x),&(y),&(z));
#define make4(x, y, z, t) int (x), (y), (z), (t); scanf("%d%d%d%d",&(x),&(y),&(z),&(t));
#define makev(v,n) VI (v); FOR(i,0,(n)) { make(a); (v).pb(a);}
#define IOS ios_base::sync_with_stdio(0)
#define HEAP priority_queue

#define read( x) scanf("%d",&(x));
#define read2( x, y) scanf("%d%d",&(x),&(y));
#define read3(x, y, z) scanf("%d%d%d",&(x),&(y),&(z));
#define read4(x, y, z, t) scanf("%d%d%d%d",&(x),&(y),&(z),&(t));
#define readv(v,n) FOR(i,0,(n)) { make(a); (v).pb(a);}

using namespace std;

int n,m;
char s[2005][2005];
int byl[2005][2005];
int deg[2005][2005];
int mate[2005][2005];

int dx[]={1,0,0,-1};
int dy[]={0,-1,1,0};
char sg[]={'^','>','<','v'};

int main(){
	read2(n,m);
	FOR(i,0,n) scanf("%s",s[i]);
	FOR(i,0,n) FOR(j,0,m) mate[i][j] = -1;

	FOR(i,0,n) FOR(j,0,m) deg[i][j] = 0;
	FOR(i,0,n) FOR(j,0,m) FOR(k,0,4)
		if(s[i][j]!='.') continue;
	  else if(i+dx[k]>=0 && i+dx[k]<n && j+dy[k]>=0 && j+dy[k]<m && s[i+dx[k]][j+dy[k]]=='.') deg[i][j]++;

	vector<PII> kju;

	FOR(i,0,n) FOR(j,0,n){
		if(s[i][j]=='.' && deg[i][j]==0){
			printf("Not unique\n"); return 0;
		}
		if(s[i][j]=='.' && deg[i][j]==1){
			kju.pb(mp(i,j));
		}
	}
	int i = 0;
	while(1){
		if(i >= kju.size()) break;
		int ax = kju[i].st, ay = kju[i].nd;
		i++;
		if(mate[ax][ay]!=-1) continue;
		int bx = -1,by =-1;
		bool ok = false;
		FOR(j,0,4){
			bx = ax+dx[j], by = ay+dy[j];
			if(bx>=0 && bx<n && by>=0 && by<m && s[bx][by]=='.' && mate[bx][by]==-1){
				mate[ax][ay] = j;
				mate[bx][by] = 3-j;
				ok = true;
				break;
			}
		}
		if(!ok){
			printf("Not unique\n"); return 0;
		}
		FOR(j,0,4){
			int cx = bx+dx[j], cy = by+dy[j];
			if(cx>=0 && cx<n && cy>=0 && cy<m && s[cx][cy]=='.' && mate[cx][cy]==-1){
				deg[cx][cy]--;
				if(deg[cx][cy]==1) kju.pb(mp(cx,cy));
			}
		}
	}
	FOR(i,0,n) FOR(j,0,m){
		if(s[i][j]=='.' && mate[i][j]==-1){
			printf("Not unique\n"); return 0;
		}
	}
	FOR(i,0,n){
		FOR(j,0,m){
			if(s[i][j]!='.') printf("%c",s[i][j]);
			else printf("%c",sg[mate[i][j]]);
		}
		printf("\n");
	}
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <cstring>
#include <cassert>
#include <ctime>
#include <utility>

#define F first
#define S second
#define pb push_back
#define mp make_pair

using namespace std;

typedef long long LL;
typedef pair <int, int> pii;

const int maxn = (int)2e3 + 10;
const int inf = (int)1e9;
const int mod = (int)1e9 + 7;
const double eps = 1e-9;

char a[maxn][maxn];
int n, m, x, y, u, v, d[maxn][maxn], u1, v1, l, r;
pii q[maxn * maxn + 10];
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};

int main() {
//	freopen("in", "r", stdin);
	scanf("%d%d\n", &n, &m);
	for (int i = 1; i <= n; ++i) {
		for (int j = 1; j <= m; ++j)
			a[i][j] = getchar();
		getchar();
	}

	for (int i = 1; i <= n; ++i)
		for (int j = 1; j <= m; ++j) {
			for (int k = 0; k < 4; ++k) {
				x = i + dx[k];
				y = j + dy[k];

				if (x > 0 && x <= n && y > 0 && y <= m && a[x][y] == '.')
					++d[i][j];
			}

			if (a[i][j] == '.' && d[i][j] == 1)
				q[r++] = mp(i, j);
		}
	while (l < r) {
		x = q[l].F;
		y = q[l++].S;

		if (a[x][y] != '.')
			continue;

		if (d[x][y] != 1) {
			cout << "Not unique\n";
			return 0;
		}

        for (int k = 0; k < 4; ++k) {
			u = x + dx[k];
			v = y + dy[k];

			if (u > 0 && u <= n && v > 0 && v <= m && a[u][v] == '.') {
				if (u > x) {
					a[x][y] = '^';
					a[u][v] = 'v';
				}
				if (u < x) {
					a[u][v] = '^';
					a[x][y] = 'v';
				}
				if (v > y) {
					a[x][y] = '<';
					a[u][v] = '>';
				}
				if (v < y) {
					a[u][v] = '<';
					a[x][y] = '>';
				}

				for (int k1 = 0; k1 < 4; ++k1) {
					u1 = u + dx[k1];
					v1 = v + dy[k1];
                    d[u1][v1]--;
				}
			}
		}
	}

	for (int i = 1; i <= n; ++i, puts(""))
		for (int j = 1; j <= m; ++j)
			printf("%c", a[i][j]);
	return 0;
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <cstring>
#include <cassert>
#include <ctime>
#include <utility>

#define F first
#define S second
#define pb push_back
#define mp make_pair

using namespace std;

typedef long long LL;
typedef pair <int, int> pii;

const int maxn = (int)2e3 + 10;
const int inf = (int)1e9;
const int mod = (int)1e9 + 7;
const double eps = 1e-9;

char a[maxn][maxn];
int n, m, x, y, u, v, d[maxn][maxn], u1, v1;
set <pair <int, pii> > Set;
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};

int main() {
//	freopen("in", "r", stdin);
	scanf("%d%d\n", &n, &m);
	for (int i = 1; i <= n; ++i) {
		for (int j = 1; j <= m; ++j)
			scanf("%c", &a[i][j]);
		scanf("\n");
	}

	for (int i = 1; i <= n; ++i)
		for (int j = 1; j <= m; ++j) {
			for (int k = 0; k < 4; ++k) {
				x = i + dx[k];
				y = j + dy[k];

				if (x > 0 && x <= n && y > 0 && y <= m && a[x][y] == '.')
					++d[i][j];
			}

			if (a[i][j] == '.')
				Set.insert(mp(d[i][j], mp(i, j)));
		}
	while (!Set.empty()) {
		x = (*Set.begin()).S.F;
		y = (*Set.begin()).S.S;

		Set.erase(*Set.begin());
		if (a[x][y] != '.')
			continue;

	//	cerr << x << ' ' << y << '\n';

		if (d[x][y] != 1) {
			cout << "Not unique\n";
			return 0;
		}

        for (int k = 0; k < 4; ++k) {
			u = x + dx[k];
			v = y + dy[k];

			if (u > 0 && u <= n && v > 0 && v <= m && a[u][v] == '.') {
				if (u > x) {
					a[x][y] = '^';
					a[u][v] = 'v';
				}
				if (u < x) {
					a[u][v] = '^';
					a[x][y] = 'v';
				}
				if (v > y) {
					a[x][y] = '<';
					a[u][v] = '>';
				}
				if (v < y) {
					a[u][v] = '<';
					a[x][y] = '>';
				}

			//	cerr << u << ' ' << v << "!\n";

				Set.erase(mp(d[u][v], mp(u, v)));
				for (int k1 = 0; k1 < 4; ++k1) {
					u1 = u + dx[k1];
					v1 = v + dy[k1];

					d[u1][v1]--;
				}
			}
		}
	}

	for (int i = 1; i <= n; ++i, puts(""))
		for (int j = 1; j <= m; ++j)
			printf("%c", a[i][j]);

	return 0;
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <cstring>
#include <cassert>
#include <ctime>
#include <utility>

#define F first
#define S second
#define pb push_back
#define mp make_pair

using namespace std;

typedef long long LL;
typedef pair <int, int> pii;

const int maxn = (int)2e3 + 10;
const int inf = (int)1e9;
const int mod = (int)1e9 + 7;
const double eps = 1e-9;

char a[maxn][maxn];
int n, m, x, y, u, v, d[maxn][maxn], u1, v1, l, r;
pii q[maxn * maxn + 10];
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};

int main() {
//	freopen("in", "r", stdin);
	scanf("%d%d\n", &n, &m);
	for (int i = 1; i <= n; ++i) {
		for (int j = 1; j <= m; ++j)
			a[i][j] = getchar();
		getchar();
	}

	for (int i = 1; i <= n; ++i)
		for (int j = 1; j <= m; ++j) {
			for (int k = 0; k < 4; ++k) {
				x = i + dx[k];
				y = j + dy[k];

				if (x > 0 && x <= n && y > 0 && y <= m && a[x][y] == '.')
					++d[i][j];
			}

			if (a[i][j] == '.' && d[i][j] == 1)
				q[r++] = mp(i, j);
		}
	while (l < r) {
		cerr << l << ' ' << r << '\n';
		x = q[l].F;
		y = q[l++].S;

		if (a[x][y] != '.')
			continue;

		if (d[x][y] != 1) {
			cout << "Not unique\n";
			return 0;
		}

        for (int k = 0; k < 4; ++k) {
			u = x + dx[k];
			v = y + dy[k];

			if (u > 0 && u <= n && v > 0 && v <= m && a[u][v] == '.') {
				if (u > x) {
					a[x][y] = '^';
					a[u][v] = 'v';
				}
				if (u < x) {
					a[u][v] = '^';
					a[x][y] = 'v';
				}
				if (v > y) {
					a[x][y] = '<';
					a[u][v] = '>';
				}
				if (v < y) {
					a[u][v] = '<';
					a[x][y] = '>';
				}

				for (int k1 = 0; k1 < 4; ++k1) {
					u1 = u + dx[k1];
					v1 = v + dy[k1];
                    d[u1][v1]--;
				}
			}
		}
	}

	for (int i = 1; i <= n; ++i)
		for (int j = 1; j <= m; ++j)
			if (a[i][j] == '.') {
				cout << "Not unique\n";
				return 0;
			}

	for (int i = 1; i <= n; ++i, puts(""))
		for (int j = 1; j <= m; ++j)
			printf("%c", a[i][j]);
	return 0;
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <cstring>
#include <cassert>
#include <ctime>
#include <utility>

#define F first
#define S second
#define pb push_back
#define mp make_pair

using namespace std;

typedef long long LL;
typedef pair <int, int> pii;

const int maxn = (int)2e3 + 10;
const int inf = (int)1e9;
const int mod = (int)1e9 + 7;
const double eps = 1e-9;

char a[maxn][maxn];
int n, m, x, y, u, v, d[maxn][maxn], u1, v1;
set <pair <int, pii> > Set;
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};

int main() {
//	freopen("in", "r", stdin);
	scanf("%d%d\n", &n, &m);
	for (int i = 1; i <= n; ++i) {
		for (int j = 1; j <= m; ++j)
			scanf("%c", &a[i][j]);
		scanf("\n");
	}

	for (int i = 1; i <= n; ++i)
		for (int j = 1; j <= m; ++j) {
			for (int k = 0; k < 4; ++k) {
				x = i + dx[k];
				y = j + dy[k];

				if (x > 0 && x <= n && y > 0 && y <= m && a[x][y] == '.')
					++d[i][j];
			}

			if (a[i][j] == '.')
				Set.insert(mp(d[i][j], mp(i, j)));
		}
	while (!Set.empty()) {
		x = (*Set.begin()).S.F;
		y = (*Set.begin()).S.S;

		Set.erase(*Set.begin());
		if (a[x][y] != '.')
			continue;

	//	cerr << x << ' ' << y << '\n';

		if (d[x][y] != 1) {
			cout << "Not unique\n";
			return 0;
		}

		bool ok = false;

        for (int k = 0; k < 4; ++k) {
			u = x + dx[k];
			v = y + dy[k];

			if (u > 0 && u <= n && v > 0 && v <= m && a[u][v] == '.') {
				ok = true;
				if (u > x) {
					a[x][y] = '^';
					a[u][v] = 'v';
				}
				if (u < x) {
					a[u][v] = '^';
					a[x][y] = 'v';
				}
				if (v > y) {
					a[x][y] = '<';
					a[u][v] = '>';
				}
				if (v < y) {
					a[u][v] = '<';
					a[x][y] = '>';
				}

				Set.erase(mp(d[u][v], mp(u, v)));
				for (int k1 = 0; k1 < 4; ++k1) {
					u1 = u + dx[k1];
					v1 = v + dy[k1];

					if (a[u1][v1] == '.') {
						Set.erase(mp(d[u1][v1]--, mp(u1, v1)));
						Set.insert(mp(d[u1][v1], mp(u1, v1)));
					}
				}
			}
		}
		if (!ok) {
			cout << "Not unique\n";
			return 0;
		}
	}

	for (int i = 1; i <= n; ++i, puts(""))
		for (int j = 1; j <= m; ++j)
			printf("%c", a[i][j]);

	return 0;
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <cstring>
#include <cassert>
#include <ctime>
#include <utility>

#define F first
#define S second
#define pb push_back
#define mp make_pair

using namespace std;

typedef long long LL;
typedef pair <int, int> pii;

const int maxn = (int)2e3 + 10;
const int inf = (int)1e9;
const int mod = (int)1e9 + 7;
const double eps = 1e-9;

char a[maxn][maxn];
int n, m, x, y, u, v, d[maxn][maxn], u1, v1, l, r;
pii q[maxn * maxn + 10];
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};

int main() {
//	freopen("in", "r", stdin);
	scanf("%d%d\n", &n, &m);
	for (int i = 1; i <= n; ++i) {
		for (int j = 1; j <= m; ++j)
			a[i][j] = getchar();
		getchar();
	}

	for (int i = 1; i <= n; ++i)
		for (int j = 1; j <= m; ++j) {
			for (int k = 0; k < 4; ++k) {
				x = i + dx[k];
				y = j + dy[k];

				if (x > 0 && x <= n && y > 0 && y <= m && a[x][y] == '.')
					++d[i][j];
			}

			if (a[i][j] == '.' && d[i][j] == 1)
				q[r++] = mp(i, j);
		}
	while (l < r) {
		x = q[l].F;
		y = q[l++].S;

		if (a[x][y] != '.')
			continue;

		if (d[x][y] != 1) {
			cout << "Not unique\n";
			return 0;
		}

        for (int k = 0; k < 4; ++k) {
			u = x + dx[k];
			v = y + dy[k];

			if (u > 0 && u <= n && v > 0 && v <= m && a[u][v] == '.') {
				if (u > x) {
					a[x][y] = '^';
					a[u][v] = 'v';
				}
				if (u < x) {
					a[u][v] = '^';
					a[x][y] = 'v';
				}
				if (v > y) {
					a[x][y] = '<';
					a[u][v] = '>';
				}
				if (v < y) {
					a[u][v] = '<';
					a[x][y] = '>';
				}

				for (int k1 = 0; k1 < 4; ++k1) {
					u1 = u + dx[k1];
					v1 = v + dy[k1];
                    d[u1][v1]--;

                    if (d[u1][v1] == 1)
                    	q[r++] = mp(u1, v1);
				}
			}
		}
	}

	for (int i = 1; i <= n; ++i)
		for (int j = 1; j <= m; ++j)
			if (a[i][j] == '.') {
				cout << "Not unique\n";
				return 0;
			}

	for (int i = 1; i <= n; ++i, puts(""))
		for (int j = 1; j <= m; ++j)
			printf("%c", a[i][j]);
	return 0;
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <cstring>
#include <cassert>
#include <ctime>
#include <utility>

#define F first
#define S second
#define pb push_back
#define mp make_pair

using namespace std;

typedef long long LL;
typedef pair <int, int> pii;

const int maxn = (int)2e3 + 10;
const int inf = (int)1e9;
const int mod = (int)1e9 + 7;
const double eps = 1e-9;

char a[maxn][maxn];
int n, m, x, y, u, v, d[maxn][maxn], u1, v1;
set <pair <int, pii> > Set;
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};

int main() {
//	freopen("in", "r", stdin);
	scanf("%d%d\n", &n, &m);
	for (int i = 1; i <= n; ++i) {
		for (int j = 1; j <= m; ++j)
			scanf("%c", &a[i][j]);
		scanf("\n");
	}

	for (int i = 1; i <= n; ++i)
		for (int j = 1; j <= m; ++j) {
			for (int k = 0; k < 4; ++k) {
				x = i + dx[k];
				y = j + dy[k];

				if (x > 0 && x <= n && y > 0 && y <= m && a[x][y] == '.')
					++d[i][j];
			}

			if (a[i][j] == '.')
				Set.insert(mp(d[i][j], mp(i, j)));
		}
	while (!Set.empty()) {
		x = (*Set.begin()).S.F;
		y = (*Set.begin()).S.S;

		Set.erase(*Set.begin());
		if (a[x][y] != '.')
			continue;

	//	cerr << x << ' ' << y << '\n';

		if (d[x][y] != 1) {
			cout << "Not unique\n";
			return 0;
		}

        for (int k = 0; k < 4; ++k) {
			u = x + dx[k];
			v = y + dy[k];

			if (u > 0 && u <= n && v > 0 && v <= m && a[u][v] == '.') {
				if (u > x) {
					a[x][y] = '^';
					a[u][v] = 'v';
				}
				if (u < x) {
					a[u][v] = '^';
					a[x][y] = 'v';
				}
				if (v > y) {
					a[x][y] = '<';
					a[u][v] = '>';
				}
				if (v < y) {
					a[u][v] = '<';
					a[x][y] = '>';
				}

				Set.erase(mp(d[u][v], mp(u, v)));
				for (int k1 = 0; k1 < 4; ++k1) {
					u1 = u + dx[k1];
					v1 = v + dy[k1];

					if (a[u1][v1] == '.') {
						Set.erase(mp(d[u1][v1]--, mp(u1, v1)));
						Set.insert(mp(d[u1][v1], mp(u1, v1)));
					}
				}
			}
		}
	}

	for (int i = 1; i <= n; ++i, puts(""))
		for (int j = 1; j <= m; ++j)
			printf("%c", a[i][j]);

	return 0;
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <cstring>
#include <cassert>
#include <ctime>
#include <utility>

#define F first
#define S second
#define pb push_back
#define mp make_pair

using namespace std;

typedef long long LL;
typedef pair <int, int> pii;

const int maxn = (int)2e3 + 10;
const int inf = (int)1e9;
const int mod = (int)1e9 + 7;
const double eps = 1e-9;

char a[maxn][maxn];
int n, m, x, y, u, v, d[maxn][maxn], u1, v1, l, r;
pii q[maxn * maxn + 10];
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};

int main() {
	freopen("in", "r", stdin);
	scanf("%d%d\n", &n, &m);
	for (int i = 1; i <= n; ++i) {
		for (int j = 1; j <= m; ++j)
			a[i][j] = getchar();
		getchar();
	}

	for (int i = 1; i <= n; ++i)
		for (int j = 1; j <= m; ++j) {
			for (int k = 0; k < 4; ++k) {
				x = i + dx[k];
				y = j + dy[k];

				if (x > 0 && x <= n && y > 0 && y <= m && a[x][y] == '.')
					++d[i][j];
			}

			if (a[i][j] == '.' && d[i][j] == 1)
				q[r++] = mp(i, j);
		}
	while (l < r) {
		x = q[l].F;
		y = q[l++].S;

		if (a[x][y] != '.')
			continue;

		if (d[x][y] != 1) {
			cout << "Not unique\n";
			return 0;
		}

        for (int k = 0; k < 4; ++k) {
			u = x + dx[k];
			v = y + dy[k];

			if (u > 0 && u <= n && v > 0 && v <= m && a[u][v] == '.') {
				if (u > x) {
					a[x][y] = '^';
					a[u][v] = 'v';
				}
				if (u < x) {
					a[u][v] = '^';
					a[x][y] = 'v';
				}
				if (v > y) {
					a[x][y] = '<';
					a[u][v] = '>';
				}
				if (v < y) {
					a[u][v] = '<';
					a[x][y] = '>';
				}

				for (int k1 = 0; k1 < 4; ++k1) {
					u1 = u + dx[k1];
					v1 = v + dy[k1];
                    d[u1][v1]--;
				}
			}
		}
	}

	for (int i = 1; i <= n; ++i, puts(""))
		for (int j = 1; j <= m; ++j)
			printf("%c", a[i][j]);
	return 0;
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <cstring>
#include <cassert>
#include <ctime>
#include <utility>

#define F first
#define S second
#define pb push_back
#define mp make_pair

using namespace std;

typedef long long LL;
typedef pair <int, int> pii;

const int maxn = (int)2e3 + 10;
const int inf = (int)1e9;
const int mod = (int)1e9 + 7;
const double eps = 1e-9;

char a[maxn][maxn];
int n, m, x, y, u, v, d[maxn][maxn], u1, v1;
set <pair <int, pii> > Set;
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};

int main() {
//	freopen("in", "r", stdin);
	scanf("%d%d\n", &n, &m);
	for (int i = 1; i <= n; ++i) {
		for (int j = 1; j <= m; ++j)
			a[i][j] = getchar();
		getchar();
	}

	for (int i = 1; i <= n; ++i)
		for (int j = 1; j <= m; ++j) {
			for (int k = 0; k < 4; ++k) {
				x = i + dx[k];
				y = j + dy[k];

				if (x > 0 && x <= n && y > 0 && y <= m && a[x][y] == '.')
					++d[i][j];
			}

			if (a[i][j] == '.')
				Set.insert(mp(d[i][j], mp(i, j)));
		}
	while (!Set.empty()) {
		x = (*Set.begin()).S.F;
		y = (*Set.begin()).S.S;

		Set.erase(*Set.begin());
		if (a[x][y] != '.')
			continue;

	//	cerr << x << ' ' << y << '\n';

		if (d[x][y] != 1) {
			cout << "Not unique\n";
			return 0;
		}

		bool ok = false;

        for (int k = 0; k < 4; ++k) {
			u = x + dx[k];
			v = y + dy[k];

			if (u > 0 && u <= n && v > 0 && v <= m && a[u][v] == '.') {
				ok = true;
				if (u > x) {
					a[x][y] = '^';
					a[u][v] = 'v';
				}
				if (u < x) {
					a[u][v] = '^';
					a[x][y] = 'v';
				}
				if (v > y) {
					a[x][y] = '<';
					a[u][v] = '>';
				}
				if (v < y) {
					a[u][v] = '<';
					a[x][y] = '>';
				}

				Set.erase(mp(d[u][v], mp(u, v)));
				for (int k1 = 0; k1 < 4; ++k1) {
					u1 = u + dx[k1];
					v1 = v + dy[k1];

					if (a[u1][v1] == '.') {
						Set.erase(mp(d[u1][v1]--, mp(u1, v1)));
						Set.insert(mp(d[u1][v1], mp(u1, v1)));
					}
				}
			}
		}
		if (!ok) {
			cout << "Not unique\n";
			return 0;
		}
	}

	for (int i = 1; i <= n; ++i, puts(""))
		for (int j = 1; j <= m; ++j)
			printf("%c", a[i][j]);

	return 0;
}


#include <bits/stdc++.h>
#define fi first
#define se second
using namespace std;

typedef pair < int , int > ii;

const int maxn = 2020;

int n,m,dx[4]={0,1,0,-1},dy[4]={1,0,-1,0},deg[maxn][maxn];
char ar[maxn][maxn],ans[maxn][maxn];

void finish(){
	for( int i=1 ; i <= n ; i++ )
		printf("%s\n",ans[i]+1);
	exit(0);
}

int main(){

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

	for( int i=1 ; i <= n ; i++ ){
		scanf("%s",ar[i]+1);
		for( int j=1 ; j <= m ; j++ )
			ans[i][j] = ar[i][j];
	}

	int count_dot = 0;

	queue < ii > q;

	for( int i=1 ; i <= n ; i++ )
		for( int j=1 ; j <= m ; j++ )
		if( ar[i][j] == '.' ){
			count_dot++;
			for( int k=0 ; k < 4 ; k++ ){
				int a = i + dx[k];
				int b = j + dy[k];
				if( ar[a][b] == '.' )
					deg[i][j]++;
			}
			if( !deg[i][j] ){
				puts("Not unique");
				return 0;
			}
			if( deg[i][j] == 1 )
				q.push(ii(i , j));
		}

	if( !count_dot )
		finish();

	if( (count_dot and q.empty()) or (count_dot & 1) ){
		puts("Not unique");
		return 0;
	}

	int count_fill = 0;

	while( !q.empty() ){
		int x = q.front().fi;
		int y = q.front().se;
		q.pop();
		if( ans[x][y] != '.' ) continue;
		for( int k=0 ; k < 4 ; k++ ){
			int a = x + dx[k];
			int b = y + dy[k];
			if( ans[a][b] == '.' ){
				count_fill += 2;
				if( !k )			ans[x][y] = '<' , ans[a][b] = '>';
				else if( k == 1 )	ans[x][y] = '^' , ans[a][b] = 'v';
				else if( k == 2 )	ans[x][y] = '>' , ans[a][b] = '<';
				else 				ans[x][y] = 'v' , ans[a][b] = '^';

				for( int i=0 ; i < 4 ; i++ ){
					x = a + dx[i];
					y = b + dy[i];
					if( ans[x][y] == '.' )
						deg[x][y]--;
					if( deg[x][y] == 1 )
						q.push(ii(x , y));
				}

				break;
			}
		}
	}

	if( count_dot != count_fill ){
		puts("Not unique");
		return 0;
	}

	finish();

	return 0;
}


#include <bits/stdc++.h>
#define fi first
#define se second
using namespace std;

typedef pair < int , int > ii;

const int maxn = 2020;

int n,m,dx[4]={0,1,0,-1},dy[4]={1,0,-1,0},deg[maxn][maxn];
char ar[maxn][maxn],ans[maxn][maxn];

void finish(){
	for( int i=1 ; i <= n ; i++ )
		printf("%s\n",ans[i]+1);
	exit(0);
}

int main(){

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

	for( int i=1 ; i <= n ; i++ ){
		scanf("%s",ar[i]+1);
		for( int j=1 ; j <= m ; j++ )
			ans[i][j] = ar[i][j];
	}

	int count_dot = 0;

	queue < ii > q;

	for( int i=1 ; i <= n ; i++ )
		for( int j=1 ; j <= m ; j++ )
		if( ar[i][j] == '.' ){
			count_dot++;
			for( int k=0 ; k < 4 ; k++ ){
				int a = i + dx[k];
				int b = j + dy[k];
				if( ar[a][b] == '.' )
					deg[i][j]++;
			}
			if( !deg[i][j] ){
				puts("Not unique");
				return 0;
			}
			if( deg[i][j] == 1 )
				q.push(ii(i , j));
		}

	if( !count_dot )
		finish();

	if( (count_dot and q.empty()) or (count_dot & 1) ){
		puts("Not unique");
		return 0;
	}

	int count_fill = 0;

	while( !q.empty() ){
		int x = q.front().fi;
		int y = q.front().se;
		q.pop();
		for( int k=0 ; k < 4 ; k++ ){
			int a = x + dx[k];
			int b = y + dy[k];
			if( ans[a][b] == '.' ){
				count_fill += 2;
				if( !k )			ans[x][y] = '<' , ans[a][b] = '>';
				else if( k == 1 )	ans[x][y] = '^' , ans[a][b] = 'v';
				else if( k == 2 )	ans[x][y] = '>' , ans[a][b] = '<';
				else 				ans[x][y] = 'v' , ans[a][b] = '^';

				for( int i=0 ; i < 4 ; i++ ){
					x = a + dx[i];
					y = b + dy[i];
					if( ans[x][y] == '.' )
						deg[x][y]--;
					if( deg[x][y] == 1 )
						q.push(ii(x , y));
				}

				break;
			}
		}
	}

	if( count_dot != count_fill ){
		puts("Not unique");
		return 0;
	}

	finish();

	return 0;
}


#include <bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
using namespace std;

typedef long long lint;
typedef pair < int , int > ii;
typedef pair < int , ii > iii;

const int MAXN = 2020;

int N,M,point,adj[MAXN][MAXN],yon[4][2]={{1,0},{0,1},{0,-1},{-1,0}};
char ar[MAXN][MAXN];
vector < ii > er;

bool used[MAXN][MAXN];

int main(){

	scanf("%d%d",&N,&M);

	for( int i=1 ; i <= N ; i++ )
		for( int j=1 ; j <= M ; j++ ){
			scanf(" %c",&ar[i][j]);
			if( ar[i][j] == '.' )
				point++;
			else
				used[i][j] = 1;
		}

	for( int i=0 ; i <= M+1 ; i++ )
		used[0][i] = used[N+1][i] = 1;

	for( int i=0 ; i <= N +1 ; i++ )
		used[i][0] = used[i][M+1] = 1;

	if( point % 2 ){
		printf("Not unique");
		return 0;
	}

	for( int i=0 ; i <= 4 ; i++ ){

		for( int j=1 ; j <= N ; j++ )
			for( int k=1 ; k <= M ; k++ )
				if( !used[j][k] ){
					adj[j][k] = 0;
					for( int l=0,x,y ; l < 4 ; l++ ){
						x = j + yon[l][0];
						y = k + yon[l][1];
						if( !used[x][y] ){
							adj[j][k]++;
						}
					}
				}

		int c1=0,c2=0;

		for( int i=1 ; i <= N ; i++ )
			for( int j=1 ; j <= M ; j++ )
				if( !used[i][j] ){
					if( adj[i][j] == 1 ){
							c1 = 1;
							for( int l=0,x,y ; l < 4 ; l++ ){
								x = i + yon[l][0];
								y = j + yon[l][1];
								if( !used[x][y] ){

									used[i][j] = 1;
									used[x][y] = 1;
									adj[i][j] = 0;
									adj[x][y] = 0;

									if( l == 0 ){
										ar[i][j] = '^';
										ar[x][y] = 'v';
									} else if( l == 1 ){
										ar[i][j] = '<';
										ar[x][y] = '>';

									} else if( l == 2 ){
										ar[i][j] = '>';
										ar[x][y] = '<';
									} else{
										ar[i][j] = 'v';
										ar[x][y] = '^';
									}
								}
						}
					}
					else if( adj[i][j] > 1 ){
						c2 = 1;
					}
				}

		if( !c1 and c2 ){
			printf("Not unique");
			return 0;
		}

	}

	for( int i=1 ; i <= N ; i++,puts("") )
		for( int j=1 ; j <= M ; j++ )
			printf("%c",ar[i][j]);

	return 0;
}


#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <queue>
#include <cmath>
#include <stack>
#include <map>
#include <time.h>

#pragma comment(linker, "/STACK:1024000000")
#define EPS (1e-10)
#define LL long long
#define ULL unsigned long long
#define _LL __int64
#define INF 0x3f3f3f3f
#define Mod 100007

using namespace std;

vector<int> vec[4000010];

char Map[2010][2010];

int deg[4000010] = {0};

int pos[2010][2010];

queue<int> q;

int Calx(int pos,int n,int m)
{
    return (pos-1)/m+1;
}

int Caly(int pos,int n,int m)
{
    return pos%m == 0 ? m : pos%m;
}

int Mat[4001000];

char CalTy(int pos,int n,int m)
{
    int x = Calx(pos,n,m);
    int y = Caly(pos,n,m);

    int tx = Calx(Mat[pos],n,m);
    int ty = Caly(Mat[pos],n,m);

    if(tx == x)
        return y < ty ? '<' : '>';
    return x < tx ? '^' : 'v';
}

bool mark[4001000];

int main()
{
    int n,m,i,j;

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

    for(i = 1;i <= n; ++i)
    {
        scanf("%s",Map[i]+1);
    }

    int sum = 0,ans = 0;

    for(i = 1;i <= n; ++i)
    for(j = 1;j <= m; ++j)
        if(Map[i][j] == '.')
            sum++;

    for(i = 1;i < n; ++i)
    {
        for(j = 1;j < m; ++j)
        {
            if(Map[i][j] == '.')
            {
                if(Map[i][j+1] == '.')
                    deg[(i-1)*m+j]++,deg[(i-1)*m+j+1]++,vec[(i-1)*m+j+1].push_back((i-1)*m+j),vec[(i-1)*m+j].push_back((i-1)*m+j+1);
                if(Map[i+1][j] == '.')
                    deg[(i-1)*m+j]++,deg[i*m+j]++,vec[i*m+j].push_back((i-1)*m+j),vec[i*m+j].push_back(i*m+j);
            }
        }
    }

    for(i = n;i <= n; ++i)
    {
        for(j = 1;j < m; ++j)
        {
            if(Map[i][j] == '.')
            {
                if(Map[i][j+1] == '.')
                    deg[(i-1)*m+j]++,deg[(i-1)*m+j+1]++,vec[(i-1)*m+j+1].push_back((i-1)*m+j),vec[(i-1)*m+j].push_back((i-1)*m+j+1);
            }
        }
    }

    for(i = 1;i < n; ++i)
    {
        for(j = m;j <= m; ++j)
        {
            if(Map[i][j] == '.')
            {
                if(Map[i+1][j] == '.')
                    deg[(i-1)*m+j]++,deg[i*m+j]++,vec[i*m+j].push_back((i-1)*m+j),vec[i*m+j].push_back(i*m+j);
            }
        }
    }

    memset(mark,false,sizeof(mark));

    for(i = 1;i <= n*m; ++i)
    {
        if(deg[i] == 0 && Map[Calx(i,n,m)][Caly(i,n,m)] == '.')
            return puts("Not unique"),0;

        if(deg[i] == 1)
            ans++,q.push(i),mark[i] = true;
    }

    memset(Mat,-1,sizeof(Mat));

    while(q.empty() == false)
    {
        int f = q.front();
        q.pop();

        if(Mat[f] != -1)
            continue;

        for(i = 0;i < vec[f].size();i++)
        {
            if(Mat[vec[f][i]] == -1)
            {
                Mat[f] = vec[f][i];
                Mat[vec[f][i]] = f;

                if(mark[vec[f][i]])
                    break;

                mark[vec[f][i]] = true;

                for(j = 0 ;j < vec[vec[f][i]].size(); ++j)
                {
                    deg[vec[vec[f][i]][j]]--;
                    if(deg[vec[vec[f][i]][j]] == 1 && mark[vec[vec[f][i]][j]] == false)
                    {
                        q.push(vec[vec[f][i]][j]);
                        ans++;
                        mark[vec[vec[f][i]][j]] = true;
                    }
                }

                break;
            }
        }

        if(i == vec[f].size())
        {
            return puts("Not unique"),0;
        }
    }

    for(i = 1;i <= n*m; ++i)
        if(Mat[i] == -1 && Map[Calx(i,n,m)][Caly(i,n,m)] == '.')
            return puts("Not unique"),0;

    for(i = 1;i <= n*m; ++i)
    {
        if(Mat[i] != -1)
        Map[Calx(i,n,m)][Caly(i,n,m)] = CalTy(i,n,m);
    }

    for(i = 1;i <= n; ++i)
    {
        printf("%s\n",Map[i]+1);
    }

    return 0;
}


#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <queue>
#include <cmath>
#include <stack>
#include <map>
#include <time.h>

#pragma comment(linker, "/STACK:1024000000")
#define EPS (1e-10)
#define LL long long
#define ULL unsigned long long
#define _LL __int64
#define INF 0x3f3f3f3f
#define Mod 100007

using namespace std;

vector<int> vec[4000010];

char Map[2010][2010];

int deg[4000010] = {0};

int pos[2010][2010];

queue<int> q;

int Calx(int pos,int n,int m)
{
    return (pos-1)/m+1;
}

int Caly(int pos,int n,int m)
{
    return pos%m == 0 ? m : pos%m;
}

int Mat[4001000];

char CalTy(int pos,int n,int m)
{
    int x = Calx(pos,n,m);
    int y = Caly(pos,n,m);

    int tx = Calx(Mat[pos],n,m);
    int ty = Caly(Mat[pos],n,m);

    if(tx == x)
        return y < ty ? '<' : '>';
    return x < tx ? '^' : 'v';
}

bool mark[4001000];

int main()
{
    int n,m,i,j;

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

    for(i = 1;i <= n; ++i)
    {
        scanf("%s",Map[i]+1);
    }

    int sum = 0,ans = 0;

    for(i = 1;i <= n; ++i)
    for(j = 1;j <= m; ++j)
        if(Map[i][j] == '.')
            sum++;

    for(i = 1;i < n; ++i)
    {
        for(j = 1;j < m; ++j)
        {
            if(Map[i][j] == '.')
            {
                if(Map[i][j+1] == '.')
                    deg[(i-1)*m+j]++,deg[(i-1)*m+j+1]++,vec[(i-1)*m+j+1].push_back((i-1)*m+j),vec[(i-1)*m+j].push_back((i-1)*m+j+1);
                if(Map[i+1][j] == '.')
                    deg[(i-1)*m+j]++,deg[i*m+j]++,vec[i*m+j].push_back((i-1)*m+j),vec[i*m+j].push_back(i*m+j);
            }
        }
    }

    for(i = n;i <= n; ++i)
    {
        for(j = 1;j < m; ++j)
        {
            if(Map[i][j] == '.')
            {
                if(Map[i][j+1] == '.')
                    deg[(i-1)*m+j]++,deg[(i-1)*m+j+1]++,vec[(i-1)*m+j+1].push_back((i-1)*m+j),vec[(i-1)*m+j].push_back((i-1)*m+j+1);
            }
        }
    }

    for(i = 1;i < n; ++i)
    {
        for(j = m;j <= m; ++j)
        {
            if(Map[i][j] == '.')
            {
                if(Map[i][j+1] == '.')
                    deg[(i-1)*m+j]++,deg[(i-1)*m+j+1]++,vec[(i-1)*m+j+1].push_back((i-1)*m+j),vec[(i-1)*m+j].push_back((i-1)*m+j+1);
            }
        }
    }

    memset(mark,false,sizeof(mark));

    for(i = 1;i <= n*m; ++i)
    {
        if(deg[i] == 0 && Map[Calx(i,n,m)][Caly(i,n,m)] == '.')
            return puts("Not unique"),0;

        if(deg[i] == 1)
            ans++,q.push(i),mark[i] = true;
    }

    memset(Mat,-1,sizeof(Mat));

    while(q.empty() == false)
    {
        int f = q.front();
        q.pop();

        if(Mat[f] != -1)
            continue;

        for(i = 0;i < vec[f].size();i++)
        {
            if(Mat[vec[f][i]] == -1)
            {
                Mat[f] = vec[f][i];
                Mat[vec[f][i]] = f;

                if(mark[vec[f][i]])
                    break;

                mark[vec[f][i]] = true;

                for(j = 0 ;j < vec[vec[f][i]].size(); ++j)
                {
                    deg[vec[vec[f][i]][j]]--;
                    if(deg[vec[vec[f][i]][j]] == 1)
                    {
                        q.push(vec[vec[f][i]][j]);
                        ans++;
                        mark[vec[vec[f][i]][j]] = true;
                    }
                }

                break;
            }
        }

        if(i == vec[f].size())
        {
            return puts("Not unique"),0;
        }
    }

    for(i = 1;i <= n*m; ++i)
        if(Mat[i] == -1 && Map[Calx(i,n,m)][Caly(i,n,m)] == '.')
            return puts("Not unique"),0;

    for(i = 1;i <= n*m; ++i)
    {
        if(Mat[i] != -1)
        Map[Calx(i,n,m)][Caly(i,n,m)] = CalTy(i,n,m);
    }

    for(i = 1;i <= n; ++i)
    {
        printf("%s\n",Map[i]+1);
    }

    return 0;
}


#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <queue>
#include <cmath>
#include <stack>
#include <map>
#include <time.h>

#pragma comment(linker, "/STACK:1024000000")
#define EPS (1e-10)
#define LL long long
#define ULL unsigned long long
#define _LL __int64
#define INF 0x3f3f3f3f
#define Mod 100007

using namespace std;

struct N
{
    int x,y,dir;
};

queue<N> q;

char Map[2010][2010];

int jx[] = {-1, 0, 1, 0};
int jy[] = { 0, 1, 0,-1};

char CalChar(int dir)
{
    if(dir == 0)
        return 'v';
    if(dir == 1)
        return '<';
    if(dir == 2)
        return '^';
    return '>';
}

int Check(int x,int y,int n,int m)
{
    bool hav = false;

    int dir;

    for(int i = 0;i < 4; ++i)
    {
        if(1 <= x+jx[i] && x+jx[i] <= n && 1 <= y+jy[i] && y+jy[i] <= m && Map[x+jx[i]][y+jy[i]] == '.')
        {
            if(hav)
                return -1;
            hav = true;
            dir = i;
        }
    }
    if(hav == false)
        return -2;
    return dir;

}

void Output(int n,int m)
{
    for(int i = 1;i <= n; ++i)
        puts(Map[i]+1);
    puts("");
}

int main()
{
    int n,m,i,j,tmp;

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

    for(i = 1;i <= n; ++i)
        scanf("%s",Map[i]+1);

    for(i = 1;i <= n; ++i)
    {
        for(j = 1;j <= m; ++j)
        {
            if(Map[i][j] == '.')
            {
                tmp = Check(i,j,n,m);

                if(0 <= tmp)
                {
                    q.push((N){i,j,tmp});
                    Map[i][j] = CalChar(tmp);
                }
            }
        }
    }

    N f,t;

    while(q.empty() == false)
    {
        f = q.front();
        q.pop();

        if(Map[f.x][f.y] != CalChar(f.dir))
            continue;

      //  printf("x = %d y = %d dir = %d\n",f.x,f.y,f.dir);

        t.x = f.x+jx[f.dir];
        t.y = f.y+jy[f.dir];
        Map[t.x][t.y] = CalChar((f.dir+2)%4);
        //Output(n,m);
        for(i = 0 ;i < 4; ++i)
        {
            if(1 <= t.x+jx[i] && t.x+jx[i] <= n && 1 <= t.y+jy[i] && t.y+jy[i] <= m && Map[t.x+jx[i]][t.y+jy[i]] == '.')
            {
                tmp = Check(t.x+jx[i],t.y+jy[i],n,m);

                if(0 <= tmp)
                {
                    Map[t.x+jx[i]][t.y+jy[i]] = CalChar(tmp);
                    q.push((N){t.x+jx[i],t.y+jy[i],tmp});
                  //  printf("     x = %d y = %d dir = %d\n",t.x+jx[i],t.y+jy[i],tmp);
                }
            }
        }
    }

    for(i = 1;i <= n; ++i)
    {
        for(j = 1;j <= m; ++j)
            if(Map[i][j] == '.')
                return puts("Not unique"),0;
    }

    for(i = 1;i <= n; ++i)
        puts(Map[i]+1);

    return 0;
}


#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <queue>
#include <cmath>
#include <stack>
#include <map>
#include <time.h>

#pragma comment(linker, "/STACK:1024000000")
#define EPS (1e-10)
#define LL long long
#define ULL unsigned long long
#define _LL __int64
#define INF 0x3f3f3f3f
#define Mod 100007

using namespace std;

struct N
{
    int x,y;
};

queue<N> q;

char Map[2010][2010];

int jx[] = {-1, 0, 1, 0};
int jy[] = { 0, 1, 0,-1};

char CalChar(int dir)
{
    if(dir == 0)
        return 'v';
    if(dir == 1)
        return '<';
    if(dir == 2)
        return '^';
    return '>';
}

int Check(int x,int y,int n,int m)
{
    bool hav = false;

    int dir;

    for(int i = 0;i < 4; ++i)
    {
        if(1 <= x+jx[i] && x+jx[i] <= n && 1 <= y+jy[i] && y+jy[i] <= m && Map[x+jx[i]][y+jy[i]] == '.')
        {
            if(hav)
                return -1;
            hav = true;
            dir = i;
        }
    }
    if(hav == false)
        return -2;
    return dir;

}

void Output(int n,int m)
{
    for(int i = 1;i <= n; ++i)
        puts(Map[i]+1);
    puts("");
}

int main()
{
    int n,m,i,j,tmp;

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

    for(i = 1;i <= n; ++i)
        scanf("%s",Map[i]+1);

    for(i = 1;i <= n; ++i)
    {
        for(j = 1;j <= m; ++j)
        {
            if(Map[i][j] == '.')
            {
                tmp = Check(i,j,n,m);

                if(0 <= tmp)
                {
                    q.push((N){i+jx[tmp],j+jy[tmp]});
                    Map[i][j] = CalChar(tmp);
                    Map[i+jx[tmp]][j+jy[tmp]] = CalChar((tmp+2)%4);
                }
            }
        }
    }

    N f,t;

    while(q.empty() == false)
    {
        f = q.front();
        q.pop();

        for(i = 0;i < 4; ++i)
        {
            t.x = f.x+jx[i];
            t.y = f.y+jy[i];

            if(1 <= t.x && t.x <= n && 1 <= t.y && t.y <= m && Map[t.x][t.y] == '.')
            {
                tmp = Check(t.x,t.y,n,m);

                if(tmp == -2)
                    return puts("Not unique"),0;

                if(0 <= tmp)
                {
                    Map[t.x][t.y] = CalChar(tmp);
                    Map[t.x+jx[tmp]][t.y+jy[tmp]] = CalChar((tmp+2)%4);
                    q.push((N){t.x+jx[tmp],t.y+jy[tmp]});
                }
            }
        }

    }

    for(i = 1;i <= n; ++i)
    {
        for(j = 1;j <= m; ++j)
            if(Map[i][j] == '.')
                return puts("Not unique"),0;
    }

    for(i = 1;i <= n; ++i)
        puts(Map[i]+1);

    return 0;
}


#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <queue>
#include <cmath>
#include <stack>
#include <map>
#include <time.h>

#pragma comment(linker, "/STACK:1024000000")
#define EPS (1e-10)
#define LL long long
#define ULL unsigned long long
#define _LL __int64
#define INF 0x3f3f3f3f
#define Mod 100007

using namespace std;

vector<int> vec[4000010];

char Map[2010][2010];

int deg[4000010] = {0};

int pos[2010][2010];

queue<int> q;

int Calx(int pos,int n,int m)
{
    return (pos-1)/m+1;
}

int Caly(int pos,int n,int m)
{
    return pos%m == 0 ? m : pos%m;
}

int Mat[4001000];

char CalTy(int pos,int n,int m)
{
    int x = Calx(pos,n,m);
    int y = Caly(pos,n,m);

    int tx = Calx(Mat[pos],n,m);
    int ty = Caly(Mat[pos],n,m);

    if(tx == x)
        return y < ty ? '<' : '>';
    return x < tx ? '^' : 'v';
}

bool mark[4001000];

int main()
{
    int n,m,i,j;

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

    for(i = 1;i <= n; ++i)
    {
        scanf("%s",Map[i]+1);
    }

    int sum = 0,ans = 0;

    for(i = 1;i <= n; ++i)
    for(j = 1;j <= m; ++j)
        if(Map[i][j] == '.')
            sum++;

    for(i = 1;i < n; ++i)
    {
        for(j = 1;j < m; ++j)
        {
            if(Map[i][j] == '.')
            {
                if(Map[i][j+1] == '.')
                    deg[(i-1)*m+j]++,deg[(i-1)*m+j+1]++,vec[(i-1)*m+j+1].push_back((i-1)*m+j),vec[(i-1)*m+j].push_back((i-1)*m+j+1);
                if(Map[i+1][j] == '.')
                    deg[(i-1)*m+j]++,deg[i*m+j]++,vec[i*m+j].push_back((i-1)*m+j),vec[i*m+j].push_back(i*m+j);
            }
        }
    }

    for(i = n;i <= n; ++i)
    {
        for(j = 1;j < m; ++j)
        {
            if(Map[i][j] == '.')
            {
                if(Map[i][j+1] == '.')
                    deg[(i-1)*m+j]++,deg[(i-1)*m+j+1]++,vec[(i-1)*m+j+1].push_back((i-1)*m+j),vec[(i-1)*m+j].push_back((i-1)*m+j+1);
            }
        }
    }

    for(i = 1;i < n; ++i)
    {
        for(j = m;j <= m; ++j)
        {
            if(Map[i][j] == '.')
            {
                if(Map[i+1][j] == '.')
                    deg[(i-1)*m+j]++,deg[i*m+j]++,vec[i*m+j].push_back((i-1)*m+j),vec[i*m+j].push_back(i*m+j);
            }
        }
    }

    memset(mark,false,sizeof(mark));

    for(i = 1;i <= n*m; ++i)
    {
        if(deg[i] == 0 && Map[Calx(i,n,m)][Caly(i,n,m)] == '.')
            return puts("Not unique"),0;

        if(deg[i] == 1)
            ans++,q.push(i),mark[i] = true;
    }

    memset(Mat,-1,sizeof(Mat));

    while(q.empty() == false)
    {
        int f = q.front();
        q.pop();

        if(Mat[f] != -1)
            continue;

        for(i = 0;i < vec[f].size();i++)
        {
            if(Mat[vec[f][i]] == -1)
            {
                Mat[f] = vec[f][i];
                Mat[vec[f][i]] = f;

                if(mark[vec[f][i]])
                    break;

                mark[vec[f][i]] = true;

                for(j = 0 ;j < vec[vec[f][i]].size(); ++j)
                {
                    deg[vec[vec[f][i]][j]]--;
                    if(deg[vec[vec[f][i]][j]] == 1)
                    {
                        q.push(vec[vec[f][i]][j]);
                        ans++;
                        mark[vec[vec[f][i]][j]] = true;
                    }
                }

                break;
            }
        }

        if(i == vec[f].size())
        {
            return puts("Not unique"),0;
        }
    }

    for(i = 1;i <= n*m; ++i)
        if(Mat[i] == -1 && Map[Calx(i,n,m)][Caly(i,n,m)] == '.')
            return puts("Not unique"),0;

    for(i = 1;i <= n*m; ++i)
    {
        if(Mat[i] != -1)
        Map[Calx(i,n,m)][Caly(i,n,m)] = CalTy(i,n,m);
    }

    for(i = 1;i <= n; ++i)
    {
        printf("%s\n",Map[i]+1);
    }

    return 0;
}