Problem: You are given a grid of N rows and M columns. The square at the i-th row and j-th column will be denoted as (i,j). Some of the squares contain an object. All the remaining squares are empty. The state of the grid is represented by strings S_1,S_2,\cdots,S_N. The square (i,j) contains an object if S_{i,j}= `#` and is empty if S_{i,j}= `.`.

Consider placing 1 \times 2 tiles on the grid. Tiles can be placed vertically or horizontally to cover two adjacent empty squares. Tiles must not stick out of the grid, and no two different tiles may intersect. Tiles cannot occupy the square with an object.

Calculate the maximum number of tiles that can be placed and any configulation that acheives the maximum.

Constraints

* 1 \leq N \leq 100
* 1 \leq M \leq 100
* S_i is a string with length M consists of `#` and `.`.

Input

Input is given from Standard Input in the following format:


N M
S_1
S_2
\vdots
S_N


Output

On the first line, print the maximum number of tiles that can be placed.

On the next N lines, print a configulation that achieves the maximum. Precisely, output the strings t_1,t_2,\cdots,t_N constructed by the following way.

* t_i is initialized to S_i.
* For each (i,j), if there is a tile that occupies (i,j) and (i+1,j), change t_{i,j}:=`v`, t_{i+1,j}:=`^`.
* For each (i,j), if there is a tile that occupies (i,j) and (i,j+1), change t_{i,j}:=`>`, t_{i,j+1}:=`<`.



See samples for further information.

You may print any configulation that maximizes the number of tiles.

Examples

Input

3 3
#..
..#
...


Output

3
#><
vv#
^^.


Input

3 3
..
..#
...


Output

3
><
vv#
^^.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>

using namespace std;
using int64 = long long;

constexpr int DEBUG = 0;

struct FlowEdge {
  const int from, to;
  const int64 cap;  // Capacity
  FlowEdge(int from, int to, int64 cap) : from(from), to(to), cap(cap) {}
};

tuple<int64, vector<int64>> MaxFlow(int n, const vector<FlowEdge>& edges, int s, int t) {
  int m = edges.size();
  
  vector<vector<tuple<FlowEdge, int>>> graph(n);
  vector<int64> res_caps(2 * m);  // Edge ID to residual capacity
  vector<int> to_reverse(2 * m, -1);  // Edge ID to the reverse edge ID
  for (int i = 0; i < m; i++) {
    const auto& edge = edges[i];
    graph[edge.from].push_back(make_tuple(edge, i));
    graph[edge.to].push_back(
        make_tuple(FlowEdge(edge.to, edge.from, 0), m + i));
    res_caps[i] = edge.cap;
    to_reverse[i] = m + i;
    to_reverse[m + i] = i;
  }

  int64 total = 0;
  while (true) {
    queue<int> q;
    vector<int> prevs(n, -1);
    vector<int> used_edges(n, -1);
    q.push(s);
    while (!q.empty()) {
      int v = q.front();
      q.pop();
      for (const auto& edge_tuple : graph[v]) {
        FlowEdge edge = get<0>(edge_tuple);
        int edge_id = get<1>(edge_tuple);
        if (res_caps[edge_id] == 0 || prevs[edge.to] >= 0) continue;
        prevs[edge.to] = v;
        used_edges[edge.to] = edge_id;
        q.push(edge.to);
      }
    }

    if (prevs[t] == -1) return {total, res_caps};

    int cur = t;
    vector<int> path;
    while (cur != s) {
      path.push_back(used_edges[cur]);
      cur = prevs[cur];
    }

    int64 inc = INT64_MAX;
    for (int edge_id : path) {
      inc = min(inc, res_caps[edge_id]);
    }

    total += inc;

    for (int edge_id : path) {
      res_caps[edge_id] -= inc;
      res_caps[to_reverse[edge_id]] += inc;
    }
  }
}

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

  int h, w;
  cin >> h >> w;
  vector<string> rows(h);
  for (int y = 0; y < h; y++) {
    cin >> rows[y];
  }

  int s = h * w;
  int t = h * w + 1;
  vector<FlowEdge> edges;
  for (int y = 0; y < h; y++) {
    for (int x = 0; x < w; x++) {
      if (rows[y][x] == '#') continue;
      int v = y * w + x;
      if ((y + x) % 2 == 0) {
        edges.push_back({s, v, 1});
      } else {
        edges.push_back({v, t, 1});
      }

      if ((y + x) % 2 == 0) {
        if (x > 0 && rows[y][x - 1] == '.') {
          edges.push_back({v, v - 1, 1});
        }
        if (x < w - 1 && rows[y][x + 1] == '.') {
          edges.push_back({v, v + 1, 1});
        }
        if (y > 0 && rows[y - 1][x] == '.') {
          edges.push_back({v, v - w, 1});
        }
        if (y < h - 1 && rows[y + 1][x] == '.') {
          edges.push_back({v, v + w, 1});
        }
      }
    }
  }

  auto [max_flow, res_caps] = MaxFlow(h * w + 2, edges, s, t);
  cout << max_flow << endl;

  vector<string> output = rows;
  for (int i = 0; i < edges.size(); i++) {
    int v1 = edges[i].from;
    int v2 = edges[i].to;
    if (v1 == s || v2 == t) continue;
    if (res_caps[i] == 1) continue;
    int x1 = v1 % w;
    int y1 = v1 / w;
    int x2 = v2 % w;
    int y2 = v2 / w;
    // cout << y1 << " " << x1 << " " << y2 << " " << x2 << endl;
    if (x1 == x2) {
      output[min(y1, y2)][x1] = 'v';
      output[max(y1, y2)][x1] = '^';
    } else {
      output[y1][min(x1, x2)] = '>';
      output[y1][max(x1, x2)] = '<';
    }
  }

  for (int y = 0; y < h; y++) {
    cout << output[y] << "\n";
  }
}