#include <bits/stdc++.h>
using namespace std;
const int sz = 300100;
pair<int, int> arr[sz];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int t = 0;
  cin >> t;
  while (t > 0) {
    t--;
    int n = 0;
    cin >> n;
    vector<char> v(n);
    for (int i = 0; i < n; i++) {
      cin >> v[i];
    }
    int tmp = 0;
    if (n != 1) {
      for (int i = 0; i < n; i++) {
        if (v[i] == '>')
          tmp = 1;
        else {
          if (tmp == 1) {
            cout << 0 << '\n';
            break;
          }
          cout << 1 << '\n';
        }
      }
    } else {
      cout << 0 << '\n';
    }
  }
  return 0;
}
