#include <bits/stdc++.h>
using namespace std;
void make_unique(vector<int> &a) {
  sort(a.begin(), a.end());
  a.erase(unique(a.begin(), a.end()), a.end());
}
void printDouble(double f, int p) {
  cout << fixed;
  cout << setprecision(p) << f << endl;
}
int Set(int N, int cur) { return N = N | (1 << cur); }
int Reset(int N, int cur) { return N = N & ~(1 << cur); }
bool Check(int N, int cur) { return (bool)(N & (1 << cur)); }
long long GCD(long long a, long long b) {
  if (b == 0) return a;
  return GCD(b, a % b);
}
long long LCM(long long a, long long b) { return a * b / GCD(a, b); }
long long POW(long long a, long long p) {
  long long res = 1, x = a;
  while (p) {
    if (p & 1) res = (res * x);
    x = (x * x);
    p >>= 1;
  }
  return res;
}
int N, c;
char dir[100055];
long long A[100055];
int DP[100055];
bool call(long long cur) {
  while (true) {
    if (cur < 0 || cur >= N) return false;
    if (DP[cur] != -1) return true;
    DP[cur] = 1;
    if (dir[cur] == '>') {
      cur += A[cur];
    } else {
      cur -= A[cur];
    }
  }
  return false;
}
int main() {
  scanf("%d %s", &N, dir);
  for (int i = 0; i < N; i++) {
    scanf("%d", &c);
    A[i] = c;
  }
  memset(DP, -1, sizeof(DP));
  bool res = call(0);
  if (res == true)
    cout << "INFINITE" << endl;
  else
    cout << "FINITE" << endl;
}

### Prompt

Create a solution in Cpp for the following problem:

Little Artem found a grasshopper. He brought it to his house and constructed a jumping area for him.

The area looks like a strip of cells 1 × n. Each cell contains the direction for the next jump and the length of that jump. Grasshopper starts in the first cell and follows the instructions written on the cells. Grasshopper stops immediately if it jumps out of the strip. Now Artem wants to find out if this will ever happen.

Input

The first line of the input contains a single integer n (1 ≤ n ≤ 100 000) — length of the strip. 

Next line contains a string of length n which consists of characters "<" and ">" only, that provide the direction of the jump from the corresponding cell. Next line contains n integers di (1 ≤ di ≤ 109) — the length of the jump from the i-th cell.

Output

Print "INFINITE" (without quotes) if grasshopper will continue his jumps forever. Otherwise print "FINITE" (without quotes).

Examples

Input

2
&gt;&lt;
1 2


Output

FINITE


Input

3
&gt;&gt;&lt;
2 1 1


Output

INFINITE

Note

In the first sample grasshopper starts from the first cell and jumps to the right on the next cell. When he is in the second cell he needs to jump two cells left so he will jump out of the strip.

Second sample grasshopper path is 1 - 3 - 2 - 3 - 2 - 3 and so on. The path is infinite.

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
void make_unique(vector<int> &a) {
  sort(a.begin(), a.end());
  a.erase(unique(a.begin(), a.end()), a.end());
}
void printDouble(double f, int p) {
  cout << fixed;
  cout << setprecision(p) << f << endl;
}
int Set(int N, int cur) { return N = N | (1 << cur); }
int Reset(int N, int cur) { return N = N & ~(1 << cur); }
bool Check(int N, int cur) { return (bool)(N & (1 << cur)); }
long long GCD(long long a, long long b) {
  if (b == 0) return a;
  return GCD(b, a % b);
}
long long LCM(long long a, long long b) { return a * b / GCD(a, b); }
long long POW(long long a, long long p) {
  long long res = 1, x = a;
  while (p) {
    if (p & 1) res = (res * x);
    x = (x * x);
    p >>= 1;
  }
  return res;
}
int N, c;
char dir[100055];
long long A[100055];
int DP[100055];
bool call(long long cur) {
  while (true) {
    if (cur < 0 || cur >= N) return false;
    if (DP[cur] != -1) return true;
    DP[cur] = 1;
    if (dir[cur] == '>') {
      cur += A[cur];
    } else {
      cur -= A[cur];
    }
  }
  return false;
}
int main() {
  scanf("%d %s", &N, dir);
  for (int i = 0; i < N; i++) {
    scanf("%d", &c);
    A[i] = c;
  }
  memset(DP, -1, sizeof(DP));
  bool res = call(0);
  if (res == true)
    cout << "INFINITE" << endl;
  else
    cout << "FINITE" << endl;
}

```