/*** author: yuji9511 ***/
#include <bits/stdc++.h>
#include <atcoder/maxflow>
using namespace std;
using namespace atcoder;
using ll = long long;
using lpair = pair<ll, ll>;
const ll MOD = 1e9+7;
const ll INF = 1e18;
#define rep(i,m,n) for(ll i=(m);i<(n);i++)
#define rrep(i,m,n) for(ll i=(m);i>=(n);i--)
#define printa(x,n) for(ll i=0;i<n;i++){cout<<(x[i])<<" \n"[i==n-1];};
void print() {}
template <class H,class... T>
void print(H&& h, T&&... t){cout<<h<<" \n"[sizeof...(t)==0];print(forward<T>(t)...);}
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << "\n"

void solve(){
    ll N,M;
    cin >> N >> M;
    string S[110];
    rep(i,0,N) cin >> S[i];
    mf_graph<ll> graph(N * M + 10);
    ll st = N * M, gt = N * M + 1;
    ll dh[4] = {0,0,1,-1};
    ll dw[4] = {1,-1,0,0};
    char c1[4] = {'>', '<', 'v', '^'};
    char c2[4] ={'<', '>', '^', 'v'};
    map<lpair, ll> mp;
    rep(i,0,N){
        rep(j,0,M){
            if(S[i][j] == '#') continue;
            if((i+j) % 2 == 0){
                ll r = graph.add_edge(st, i*M+j, 1);
                auto e = graph.get_edge(r);
                // print(e.flow, e.cap);
                rep(k,0,4){
                    ll ii = i + dh[k], jj = j + dw[k];
                    if(ii >= 0 && ii < N && jj >= 0 && jj < M){
                        if(S[ii][jj] == '.'){
                            ll r = graph.add_edge(i*M+j, ii*M+jj, 1);
                            mp[{i*M+j, ii*M+jj}] = r;
                        }
                    }
                }

            }else{
                graph.add_edge(i*M+j, gt, 1);
                // rep(k,0,4){
                //     ll ii = i + dh[k], jj = j + dw[k];
                //     if(ii >= 0 && ii < N && jj >= 0 && jj < M){
                //         if(S[ii][jj] == '.'){
                //             graph.add_edge(ii*M+jj, i*M+j, 1);
                //         }
                //     }
                // }
            }
        }
    }
    ll res = graph.flow(st, gt);
    print(res);
    rep(i,0,N){
        rep(j,0,M){
            if(S[i][j] == '#') continue;
            if((i+j) % 2 == 0){
                // print(i,j);
                rep(k,0,4){
                    ll ii = i + dh[k], jj = j + dw[k];
                    if(ii >= 0 && ii < N && jj >= 0 && jj < M){
                        if(S[ii][jj] == '.'){
                            // print("ii", ii,jj);
                            auto e = graph.get_edge(mp[{i*M+j, ii*M+jj}]);
                            if(e.flow > 0){
                                if(S[i][j] != '.') exit(1);
                                S[i][j] = c1[k];
                                S[ii][jj] = c2[k];
                                break;
                            }
                            // print(i,j,e.flow, e.cap);
                            // if(e.flow > 0){
                            //     print(i,j);
                            //     break;
                            // }

                            
                        }
                    }
                }
            }
        }

    }
    rep(i,0,N){
        print(S[i]);
    }





}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    solve();
}

Measured memory_bytes: 6648