#include <stdio.h>

int main()
{
	long long int i,j,len,n,curr;
	scanf("%lld",&n);
	char c[n+1];
	len=n+1;
	scanf("%s",c);
	long long int a[n],b[n];
	for(i=0;i<n;i++)
	{
		scanf("%lld",a+i);
	}
	for(i=0;i<n;i++)
	{
		if(c[i]=='<')
		{
			b[i]=i-a[i];

		}
		else if(c[i]=='>')
		{
			b[i]=i+a[i];
		}
	}
	curr=0;
	j=0;
	for(i=0;i<n;i++)
	{
		if(j>=n || j<0)
		{
			break;
		}
		curr = b[j];
		j = curr;
	}
	if(curr>=0 && curr<n)
		printf("INFINITE\n");
	else
		printf("FINITE\n");
	return 0;

}


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * File:   main.c
 * Author: Bruno Espezúa
 *
 * Created on 16 de mayo de 2017, 03:45 PM
 */

#include <stdio.h>
#include <stdlib.h>

#define MAX 100000
/*
 *
 */
typedef struct{
    char dir;
    int step;
}move;

int isFinite(move arr[],int visits[],int n);
int siguiente(int i,char c,int step);
int esValido(int i,int n);

int main() {
    int n;
    int i;
    move arr[MAX];
    int visits[MAX]={};
    scanf("%d\n",&n);
    for(i=0;i<n;i++) scanf("%c",&arr[i].dir);
    for(i=0;i<n;i++) scanf("%d",&arr[i].step);

    visits[0]=1;//siempre se visita el primero al inicio
    if (isFinite(arr,visits,n)==1) printf("FINITE\n");
    else printf("INFINITE\n");
    return 0;
}

int isFinite(move arr[],int visits[],int n){
    int i=0,newI;
    while(1){
        newI=siguiente(i,arr[i].dir,arr[i].step);
        if (esValido(newI,n)==1){
            //a=siguiente(newI,arr[newI].dir,arr[newI].step);
            if(visits[newI]==1) return 0;//infinito
            else visits[newI]=1;
        }
        else{
            return 1;
        }
        i=newI;
    }
}

int siguiente(int i,char c,int step){
    if (c=='<'){
        return i-step;
    }
    else if(c=='>'){
        return i+step;
    }
}

int esValido(int i,int n){//comprueba solo si esta dentro de los limites
    if(i>=0 && i<n) return 1;
    return 0;
}


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * File:   main.c
 * Author: Bruno Espezúa
 *
 * Created on 16 de mayo de 2017, 03:45 PM
 */

#include <stdio.h>
#include <stdlib.h>

#define MAX 100000
/*
 *
 */
typedef struct{
    char dir;
    int step;
}move;

int isFinite(move arr[],int n);
int siguiente(int i,char c,int step);
int esValido(int i,int n);

int main() {
    int n;
    int i;
    move arr[MAX];
    scanf("%d\n",&n);
    for(i=0;i<n;i++) scanf("%c",&arr[i].dir);
    for(i=0;i<n;i++) scanf("%d",&arr[i].step);

    if (isFinite(arr,n)==1) printf("FINITE\n");
    else printf("INFINITE\n");
    return 0;
}

int isFinite(move arr[],int n){
    int i=0,newI,a;
    while(1){
        newI=siguiente(i,arr[i].dir,arr[i].step);
        if (esValido(newI,n)==1){
            a=siguiente(newI,arr[newI].dir,arr[newI].step);
            if(i==a) return 0;//infinito
        }
        else{
            return 1;
        }
        i=newI;
    }
}

int siguiente(int i,char c,int step){
    if (c=='<'){
        return i-step;
    }
    else if(c=='>'){
        return i+step;
    }
}

int esValido(int i,int n){
    if(i>=0 && i<n) return 1;
    return 0;
}


#include <stdio.h>
int main() {
  const int MAX = (int)1e5;
  int n, i;
  char direction[MAX];
  scanf("%s", direction);
  int step[MAX];
  int visited[MAX];
  for (i = 0; i < n; i++) {
    visited[i] = 0; // 0 significa que no está visitado
    scanf("%d", &step[i]);
  }
  int pos = 0;
  visited[pos] = 1;
  while (1) {
    // realizamos el salto
    if (direction[pos] == '>') {
      pos = pos + step[pos];
    }
    else {
      pos = pos - step[pos];
    }
    if (pos <= 0 || pos >= n) { // nos salimos!
      puts("FINITE");
      break;
    }
    if (visited[pos] == 1) { // encontramos el ciclo
      puts("INFINITE");
      break;
    }
    visited[pos] = 1; // marcamos posicion como visitada
  }
  return 0;
}


#include <stdio.h>

int main() {
  const int MAX = (int)1e5;
  int n, i;
  scanf("%d", &n);
  char direction[MAX];
  scanf("%s", direction);
  int step[MAX];
  int visited[MAX];
  for (i = 0; i < n; i++) {
    visited[i] = 0; // 0 significa que no está visitado
    scanf("%d", &step[i]);
  }
  int pos = 0;
  visited[pos] = 1;
  while (1) {
    // realizamos el salto
    if (direction[pos] == '>') {
      pos = pos + step[pos];
    }
    else {
      pos = pos - step[pos];
    }
    if (pos <= 0 || pos >= n) { // nos salimos!
      puts("FINITE");
      break;
    }
    if (visited[pos] == 1) { // encontramos el ciclo
      puts("INFINITE");
      break;
    }
    visited[pos] = 1; // marcamos posicion como visitada
  }
  return 0;
}


#include <stdio.h>
int main() {
  const int MAX = (int)1e5;
  int n, i;
  char direction[MAX];
  scanf("%s", direction);
  int step[MAX];
  int visited[MAX];
  for (i = 0; i < n; i++) {
    visited[i] = 0; // 0 significa que no está visitado
    scanf("%d", &step[i]);
  }
  int pos = 0;
  visited[pos] = 1;
  while (1) {
    // realizamos el salto
    if (direction[pos] == '>') {
      pos = pos + step[pos];
    }
    else {
      pos = pos - step[pos];
    }
    if (pos < 0 || pos >= n) { // nos salimos!
      puts("FINITE");
      break;
    }
    if (visited[pos] == 1) { // encontramos el ciclo
      puts("INFINITE");
      break;
    }
    visited[pos] = 1; // marcamos posicion como visitada
  }
  return 0;
}


#include <stdio.h>
int main() {
  const int MAX = (int)1e5;
  int n, i;
  scanf("%d", &n);
  char direction[MAX];
  scanf("%s", direction);
  int step[MAX];
  int visited[MAX];
  for (i = 0; i < n; i++) {
    visited[i] = 0; // 0 significa que no está visitado
    scanf("%d", &step[i]);
  }
  int pos = 0;
  visited[pos] = 1;
  while (1) {
    // realizamos el salto
    if (direction[pos] == '>') {
      pos = pos + step[pos];
    }
    else {
      pos = pos - step[pos];
    }
    if (pos < 0 || pos >= n) { // nos salimos!
      puts("FINITE");
      break;
    }
    if (visited[pos] == 1) { // encontramos el ciclo
      puts("INFINITE");
      break;
    }
    visited[pos] = 1; // marcamos posicion como visitada
  }
  return 0;
}


#include <stdio.h>

int main(){
	int visited[100005] = {0};
	int n;
	scanf("%d", &n);
	int jum[n];
	char seq[100005];
	scanf("%s", seq);
	for(int i = 0; i < n; i++){
		scanf("%d", &jum[i]);
	}
	int stuck = 0;
	int finite = 1;
	int i = 0;
	while(1){
		//If we go beyond the strip then its finite
		if(i >= n || i < 0){
			break;
		}
		// If we had been in the cell before then we are stuck
		if(visited[i]){
			stuck = 1;
			finite = 0;
			break;
		}
		//Mark visited cells as visited
		visited[i] = 1;
		if(seq[i] == '>'){
			i += jum[i];
		} else{
			i -= jum[i];
		}
	}
	printf("%s\n", stuck ? "INFINITE" : "FINITE");
}


#include <stdio.h>

int main(){
	int visited[100005] = {0};
	int n;
	scanf("%d", &n);
	int jum[n];
	char seq[100005];
	scanf("%s", seq);
	for(int i = 0; i < n; i++){
		scanf("%d", &jum[i]);
	}
	int stuck = 0;
	int finite = 1;
	int i = 0;
	while(1){
		if(i >= n || i < 0){
			break;
		}
		if(visited[i]){
			stuck = 1;
			finite = 0;
			break;
		}
		visited[i] = 1;
		if(seq[i] == '>'){
			i += jum[i];
		} else{
			i -= jum[i];
		}
	}
	printf("%s\n", stuck ? "INFINITE" : "FINITE");
}


#include<stdio.h>
#include<string.h>
int main()
{
    long int n;
    int i,j,flag=0;
    scanf("%ld",&n);
    char a[n];
    long long int b[n],c=1;
    scanf("%s",&a);
    for (i=1;i<=n;i++)
        scanf("%I64",&b[i]);
    for(i=0;i<n;i++)
    {
        if(a[c-1]=='>')
            c=c+b[c];
        else if(a[c-1]=='<')
            c=c-b[c];
        if(c<1 || c>n)
            flag=1;
        if(flag==1)
            break;
    }
	if(flag==1)
		printf("FINITE\n");
	else
		printf("INFINITE\n");
    return 0;
}


#include <stdio.h>

char Flag[100000];
char Str[100001];
int Offset[100000];

int main()
{
    int N, i;
    char outFlag = 0;
    scanf("%d %s", &N, Str);
    for(i = 0; i < N; ++i) {
        scanf("%d", &Offset[i]);
    }
    int s = 0;
    Flag[0] = 1;
    while(1) {
        int new;
        if(Str[s] == '>') {
            new = s + Offset[s];
        } else {
            new = s - Offset[s];
        }
        if(new < 0 || new >= N) {
            outFlag = 1;
            break;
        }
        if(Flag[new]) {
            break;
        }
        Flag[new] = 1;
        s = new;
    }
    puts(outFlag ? "FINITE" : "INFINITE");
    return 0;
}


#include <stdio.h>
#include <stdlib.h>

int main(void) {
	long range, i, jump;
	char dir[100001];

	scanf("%ld", &range);
	scanf("%s", dir);

	for(i = 0; i < range; i ++) {
		scanf("%ld", &jump);
		if(dir[i] == '<'&& i - jump < 0) {
			printf("FINITE\n");
			return 0;
		} else if(dir[i] == '>' && i + jump >= range) {
			printf("FINITE\n");
			return 0;
		}
	}

	printf("INFINITE\n");
	return 0;
}


#include <stdio.h>
#include <stdlib.h>

int main(void) {
	int range, i, jump;
	char *dir;

	scanf("%d", &range);
	dir = (char*) malloc(sizeof(char) * range + 1);
	scanf("%s", dir);

	for(i = 0; i < range; i ++) {
		scanf("%jd", &jump);
		if(dir[i] == '<') {
			if(i - jump < 0) {
				printf("FINITE\n");
				free(dir);
				return 0;
			}
		} else if(dir[i] == '>') {
			if(i + jump >= range) {
				printf("FINITE\n");
				free(dir);
				return 0;
			}
		}
	}

	printf("INFINITE\n");
	free(dir);
	return 0;
}


#include <stdio.h>
#include <stdlib.h>

int main(void) {
	int range, i, jump;
	char *dir;

	scanf("%d", &range);
	dir = (char*) malloc(sizeof(char) * range + 1);
	scanf("%s", dir);

	for(i = 0; i < range; i ++) {
		scanf("%d", &jump);
		if(dir[i] == '<') {
			if(i - jump < 0) {
				printf("FINITE\n");
				free(dir);
				return 0;
			}
		} else if(dir[i] == '>') {
			if(i + jump > range) {
				printf("FINITE\n");
				free(dir);
				return 0;
			}
		}
	}

	printf("INFINITE\n");
	free(dir);
	return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(void) {
	int range, loc = 0, jump[100001], res;
	char dir[100001], visited[100001];
	memset(visited, 0, 100001);

	scanf("%d", &range);
	scanf("%s", dir);

	int i;
	for(i = 0; i < range; i ++) {
		scanf("%d", &jump[i]);
	}

	while(loc >= 0 && loc < range) {
		if(dir[loc] == '<') {
			if((res = loc - jump[loc]) < 0) {
				printf("FINITE\n");
				return 0;
			} else if(visited[res] == 1) {
				printf("INFINITE\n");
				return 0;
			} else {
				visited[res] = 1;
				loc = res;
			}
		} else if(dir[loc] == '>') {
			if((res = loc + jump[loc]) >= range) {
				printf("FINITE\n");
				return 0;
			} else if(visited[res] == 1) {
				printf("INFINITE\n");
				return 0;
			} else {
				visited[res] = 1;
				loc = res;
			}
		}
	}

	return 0;
}


#include <stdio.h>
#include <stdlib.h>

int main(void) {
	int range, i, jump;
	char *dir;

	scanf("%d", &range);
	dir = (char*) malloc(sizeof(char) * range + 1);
	scanf("%s", dir);

	for(i = 0; i < range; i ++) {
		scanf("%d", &jump);
		if(dir[i] == '<') {
			if(i - jump < 0) {
				printf("FINITE\n");
				return 0;
			}
		} else if(dir[i] == '>') {
			if(i + jump > range) {
				printf("FINITE\n");
				return 0;
			}
		}
	}
	printf("INFINITE\n");

	return 0;
}


#include <stdio.h>
#include <stdlib.h>

int main(void) {
	long long range, i, jump;
	char *dir;

	scanf("%jd", &range);
	dir = (char*) malloc(sizeof(char) * range + 1);
	scanf("%s", dir);

	for(i = 0; i < range; i ++) {
		scanf("%jd", &jump);
		if(dir[i] == '<') {
			if(i - jump < 0) {
				printf("FINITE\n");
				free(dir);
				return 0;
			}
		} else if(dir[i] == '>') {
			if(i + jump >= range) {
				printf("FINITE\n");
				free(dir);
				return 0;
			}
		}
	}

	printf("INFINITE\n");
	free(dir);
	return 0;
}


#include <stdio.h>
#include <stdlib.h>

int main(void) {
	long range, i, jump;
	char *dir;

	scanf("%ld", &range);
	dir = (char*) malloc(sizeof(char) * range + 1);
	scanf("%s", dir);

	for(i = 0; i < range; i ++) {
		scanf("%ld", &jump);
		if(dir[i] == '<') {
			if(i - jump < 0) {
				printf("FINITE\n");
				free(dir);
				return 0;
			}
		} else if(dir[i] == '>') {
			if(i + jump >= range) {
				printf("FINITE\n");
				free(dir);
				return 0;
			}
		}
	}

	printf("INFINITE\n");
	free(dir);
	return 0;
}


#include <stdio.h>
#include <stdlib.h>

int main(void) {
	long range, i, jump;
	long long res;
	char dir[100001];

	scanf("%ld", &range);
	scanf("%s", dir);

	for(i = 0; i < range; i ++) {
		scanf("%ld", &jump);
		if(dir[i] == '<'&& (res = i - jump) < 0) {
			printf("FINITE\n");
			return 0;
		} else if(dir[i] == '>' && (res = i + jump) >= range) {
			printf("FINITE\n");
			return 0;
		}
	}

	printf("INFINITE\n");
	return 0;
}


#include <stdio.h>
#include <stdlib.h>

int main(void) {
	int range, i, jump;
	char *dir;

	scanf("%d", &range);
	dir = (char*) malloc(sizeof(char) * range + 1);
	scanf("%s", dir);

	for(i = 0; i < range; i ++) {
		scanf("%d", &jump);
		if(dir[i] == '<') {
			if(i - jump < 0) {
				printf("FINITE\n");
				free(dir);
				return 0;
			}
		} else if(dir[i] == '>') {
			if(i + jump >= range) {
				printf("FINITE\n");
				free(dir);
				return 0;
			}
		}
	}

	printf("INFINITE\n");
	free(dir);
	return 0;
}


#include <stdio.h>
#include <stdlib.h>

int main(void) {
	long range, i, jump;
	char *dir;

	scanf("%ld", &range);
	dir = (char*) malloc(sizeof(char) * range + 1);
	scanf("%s", dir);

	for(i = 0; i < range; i ++) {
		scanf("%jd", &jump);
		if(dir[i] == '<') {
			if(i - jump < 0) {
				printf("FINITE\n");
				free(dir);
				return 0;
			}
		} else if(dir[i] == '>') {
			if(i + jump >= range) {
				printf("FINITE\n");
				free(dir);
				return 0;
			}
		}
	}

	printf("INFINITE\n");
	free(dir);
	return 0;
}


#include <stdio.h>

int main(){
    unsigned n, i, inter;
    char c;
    scanf("%u", &n);
    long d[n];
    scanf("%*c");
    for (i = 0; i < n; i++){
        scanf("%c", &c);
        d[i] = (c=='>') ? 1 : -1;
    }
    for (i = 0; i < n; i++){
        inter = d[i];
        scanf("%li", &d[i]);
        d[i] = inter * d[i];
    }
    i = 0;
    while (1){
        inter = i;
        i = i + d[i];
        if ((i < 0) || (i >= n)){
            printf("FINITE");
            return 0;
        }
        if (inter == i){
            printf("INFINITE");
            return 0;
        }
        d[inter] = 0;
    }
}


#include <stdio.h>

int main(){
    unsigned n;
    long unsigned i, inter;
    char c;
    scanf("%u", &n);
    long d[n];
    scanf("%*c");
    for (i = 0; i < n; i++){
        scanf("%c", &c);
        d[i] = (c=='>') ? 1 : -1;
    }
    for (i = 0; i < n; i++){
        inter = d[i];
        scanf("%li", &d[i]);
        d[i] = inter * d[i];
    }
    i = 0;
    while (1){
        inter = i;
        i = i + d[i];
        if (i >= n){
            printf("FINITE");
            return 0;
        }
        if (inter == i){
            printf("INFINITE");
            return 0;
        }
        d[inter] = 0;
    }
}


#include<stdio.h>
#include<string.h>
int main()
{
    long int n;
    int i,j,flag=0;
    scanf("%ld",&n);
    char a[n];
    long long int b[n],c=1;
    scanf("%s",&a);
    for (i=1;i<=n;i++)
        scanf("%lld",&b[i]);
    for(i=0;i<n;i++)
    {
        if(a[c-1]=='>')
            c=c+b[c];
        else if(a[c-1]=='<')
            c=c-b[c];
        if(c<1 || c>n)
            flag=1;
        if(flag==1)
            break;
    }
	if(flag==1)
		printf("FINITE\n");
	else
		printf("INFINITE\n");
    return 0;
}


#include<stdio.h>
#include<string.h>
int main()
{
    long int n;
    int i,j,flag=0;
    scanf("%ld",&n);
    char a[n];
    long long int b[n],c=1;
    scanf("%s",&a);
    for (i=1;i<=n;i++)
        scanf("%lld",&b[i]);
    for(i=0;i<n;i++)
    {
        if(a[c-1]=='>')
            c=c+b[c];
        else if(a[c-1]=='<')
            c=c-b[c];
        if(c<1 || c>n)
            flag=1;
        if(flag==1)
            break;
    }
	if(flag==1)
		printf("FINITE\n");
	else
		printf("INFINITE\n");
    return 0;
}#include<stdio.h>
#include<string.h>
int main()
{
    long int n;
    int i,j,flag=0;
    scanf("%ld",&n);
    char a[n];
    long long int b[n],c=1;
    scanf("%s",&a);
    for (i=1;i<=n;i++)
        scanf("%lld",&b[i]);
    for(i=0;i<n;i++)
    {
        if(a[c-1]=='>')
            c=c+b[c];
        else if(a[c-1]=='<')
            c=c-b[c];
        if(c<1 || c>n)
            flag=1;
        if(flag==1)
            break;
    }
	if(flag==1)
		printf("FINITE\n");
	else
		printf("INFINITE\n");
    return 0;
}


#include <stdio.h>
int main()
{

int n;
scanf("%d",&n);
int a[n],i,j,k=0,m;
char s[n+1];
scanf("%s",s);
for(i=0;i<n;i++)
scanf("%d",&a[i]);

while( (k<n )&& (k>=0))
{
if(s[k]=='>')
{
m=k;
k=k+a[k];
if(s[k]=='<' && a[k]==m)
{printf("INFINITE");
return 0;}
}
else
{m=k;
k=k-a[k];
if(s[k]=='>' && a[k]==m)
{printf("INFINITE");
return 0;}
}

}

printf("FINITE");
return 0;

}


#include <stdio.h>
int main()
{

int n;
scanf("%d",&n);
int a[n],i,j,k=0,m,v[n];
char s[n+1];
scanf("%s",s);
for(i=0;i<n;i++)
{scanf("%d",&a[i]);
v[i]=0;}
while( (k<n )&& (k>=0))
{
	v[k]=1;
if(s[k]=='>')
{

m=k;
k=k+a[k];
if(k>=n)
	break;
if(v[k]==1)
{printf("INFINITE");
return 0;}
/*if(s[k]=='<' && a[k]==m)
{printf("INFINITE");
return 0;}*/
}
else
{m=k;
k=k-a[k];
if (k<0)
	break;
if(v[k]==1)
{printf("INFINITE");
return 0;}
/*if(s[k]=='>' && a[k]==m)
{printf("INFINITE");
return 0;}*/
}

}

printf("FINITE");
return 0;

}


#include <stdio.h>
int main()
{

int n;
scanf("%d",&n);
int a[n],i,j,k=0,m;
char s[n+1];
scanf("%s",s);
for(i=0;i<n;i++)
scanf("%d",&a[i]);

while( (k<n )&& (k>=0))
{
if(s[k]=='>')
{
m=k;
k=k+a[k];
if(k>=n)
	break;
if(s[k]=='<' && a[k]==m)
{printf("INFINITE");
return 0;}
}
else
{m=k;
k=k-a[k];
if (k<0)
	break;
if(s[k]=='>' && a[k]==m)
{printf("INFINITE");
return 0;}
}

}

printf("FINITE");
return 0;

}


#include <stdio.h>
#include <stdlib.h>

int visited[100005];

int main()
{
    long long int n, i;
    scanf("%I64d", &n);
    char s[n + 5];
    long long int arr[n];
    scanf("%s", &s);
    for (i = 0; i < n; i++) scanf("%I64d", &arr[i]);
    i = 0;
    while (1){
        visited[i] = 1;
        if (s[i] == '<') i -= arr[i];
        else i += arr[i];
        if ((i < 0) || (i >= n)){
            printf("FINITE\n");
            return 0;
        }else if (visited[i]){
            printf("INFINITE\n");
            return 0;
        }
    }
    return 0;
}


#include <stdio.h>
#include <stdlib.h>

int main()
{
    long long int n, i;
    scanf("%I64d", &n);
    char s[n + 5];
    long long int arr[n];
    scanf("%s", &s);
    for (i = 0; i < n; i++){
        scanf("%I64d", &arr[i]);
        long long int tmp = i + 1;
        if (s[i] == '<') tmp -= arr[i];
        else tmp += arr[i];
        if ((tmp < 1) || (tmp > n)){
            printf("FINITE\n");
            return 0;
        }
    }
    printf("INFINITE\n");
    return 0;
}


#include <stdio.h>

int main(){
    int n, j=0;
    scanf("%i%*i", &n);
    char side[n];
    long int d[n], i=0;
    int two[n];
    while(i<n){
        two[i]=0;
        i++;
    }
    i=0;
    while(i<n){
        scanf("%c", &side[i]);
        i++;
    }
    i=0;
    while(i<n){
        scanf("%i", &d[i]);
        i++;
    }
    i=0;
    while(j==0){
        if (d[i]<1000000000){
            two[i]=1;
            if(side[i]==60) i=i-d[i];
            else i=i+d[i];
            if (two[i]==1) j=1;
            if (i<0 || i>=n) j=2;
        }
        else j=2;
    }
    if(j==1) printf("INFINITE");
    if(j==2) printf("FINITE");
}


#include <stdio.h>

int main(){
    int n, i=0, j=0;
    scanf("%i%*i", &n);
    char side[n];
    long int d[n];
    int two[n];
    while(i<n){
        two[i]=0;
        i++;
    }
    i=0;
    while(i<n){
        scanf("%c", &side[i]);
        i++;
    }
    i=0;
    while(i<n){
        scanf("%i", &d[i]);
        i++;
    }
    i=0;
    while(j==0){
        two[i]=1;
        if(side[i]==60) i=i-i[d];
        else i=i+i[d];
        if (two[i]==1) j=1;
        if (i<0 || i>=n) j=2;
    }
    if(j==1) printf("INFINITE");
    if(j==2) printf("FINITE");
}


#include <stdio.h>

int main(){
    int n, j=0;
    scanf("%i%*i", &n);
    char side[n];
    long int d[n], i=0;
    int two[n];
    while(i<n){
        two[i]=0;
        i++;
    }
    i=0;
    while(i<n){
        scanf("%c", &side[i]);
        i++;
    }
    i=0;
    while(i<n){
        scanf("%i", &d[i]);
        i++;
    }
    i=0;
    float a=i;
    while(j==0){
        if (d[a]<1000000000){
            two[a]=1;
            if(side[a]==60) a=a-d[a];
            else a=a+d[a];
            if (two[a]==1) j=1;
            if (a<0 || a>=n) j=2;
        }
        else j=2;
    }
    if(j==1) printf("INFINITE");
    if(j==2) printf("FINITE");
}


#include <stdio.h>

int main(){
    long int n, j=0;
    scanf("%i%*i", &n);
    char side[n];
    long int d[n], i=0;
    int two[n];
    while(i<n){
        two[i]=0;
        i++;
    }
    i=0;
    while(i<n){
        scanf("%c", &side[i]);
        i++;
    }
    i=0;
    while(i<n){
        scanf("%i", &d[i]);
        i++;
    }
    i=0;
    while(j==0){
        if (two[i]==1) j=1;
        else{
            two[i]=1;
            if(side[i]==60){
                if (i-d[i]<0) j=2;
                else i=i-d[i];
            }
            else{
                if (i+d[i]>=n) j=2;
                else i=i+d[i];
            }
        }
    }
    if(j==1) printf("INFINITE");
    if(j==2) printf("FINITE");
}


#include <stdio.h>

int main(){
    long int n, i=0, j=0;
    scanf("%i%*i", &n);
    char side[n];
    long int d[n];
    int two[n];
    while(i<n){
        two[i]=0;
        i++;
    }
    i=0;
    while(i<n){
        scanf("%c", &side[i]);
        i++;
    }
    i=0;
    while(i<n){
        scanf("%i", &d[i]);
        i++;
    }
    i=0;
    while(j==0){
        two[i]=1;
        if(side[i]==60) i=i-i[d];
        else i=i+i[d];
        if (two[i]==1) j=1;
        if (i<0 || i>=n) j=2;
    }
    if(j==1) printf("INFINITE");
    if(j==2) printf("FINITE");
}


#include <stdio.h>

int main(){
    long int n, j=0;
    scanf("%i%*i", &n);
    char side[n];
    long int d[n], i=0;
    int two[n];
    while(i<n){
        two[i]=0;
        i++;
    }
    i=0;
    while(i<n){
        scanf("%c", &side[i]);
        i++;
    }
    i=0;
    while(i<n){
        scanf("%i", &d[i]);
        i++;
    }
    i=0;
    while(j==0){
        printf("%i\n", i);
        if (two[i]==1) j=1;
        else{
            two[i]=1;
            if(side[i]==60){
                if (i-d[i]<0) j=2;
                else i=i-d[i];
            }
            else{
                if (i+d[i]>=n) j=2;
                else i=i+d[i];
            }
        }
    }
    if(j==1) printf("INFINITE");
    if(j==2) printf("FINITE");
}


#include <stdio.h>

int main(){
    int n, j=0;
    scanf("%i%*i", &n);
    char side[n];
    long int d[n], i=0;
    int two[n];
    while(i<n){
        two[i]=0;
        i++;
    }
    i=0;
    while(i<n){
        scanf("%c", &side[i]);
        i++;
    }
    i=0;
    while(i<n){
        scanf("%i", &d[i]);
        i++;
    }
    i=0;
    long long int a=i;
    while(j==0){
        if (d[a]<1000000000){
            two[a]=1;
            if(side[a]==60) a=a-d[a];
            else a=a+d[a];
            if (two[a]==1) j=1;
            if (a<0 || a>=n) j=2;
        }
        else j=2;
    }
    if(j==1) printf("INFINITE");
    if(j==2) printf("FINITE");
}


#include <stdio.h>

int main(){
    long int n, j=0;
    scanf("%i%*i", &n);
    char side[n];
    long int d[n], i=0;
    int two[n];
    while(i<n){
        two[i]=0;
        i++;
    }
    i=0;
    while(i<n){
        scanf("%c", &side[i]);
        i++;
    }
    i=0;
    while(i<n){
        scanf("%i", &d[i]);
        i++;
    }
    i=0;
    while(j==0){
        if (two[i]==1) j=1;
        else{
            two[i]=1;
            if(side[i]==60){
                if (i-d[i]<0) j=2;
                else i=i-d[i];
            }
            else{
                if (i+d[i]>n) j=2;
                else i=i+d[i];
            }
        }
    }
    if(j==1) printf("INFINITE");
    if(j==2) printf("FINITE");
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class pr641A {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);

        int n = Integer.parseInt(br.readLine());
        char[] c = br.readLine().toCharArray();

        StringTokenizer st = new StringTokenizer(br.readLine());

        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = Integer.parseInt(st.nextToken());
        }

        out.println(solve(n, c, a));
        out.flush();
        out.close();
    }

    private static String solve(int n, char[] c, int[] a) {
        int cur = 0;
        boolean[] vis = new boolean[n+1];
        while(cur >= 0 && cur <  n) {
            if(vis[cur]) return "INFINITE";
            vis[cur] = true;
            cur += c[cur] == '<' ? -a[cur] : a[cur];
        }
        return "FINITE";
    }
}


import java.io.*;
import java.util.*;

public class Solution {
    /**
     * author geshpaniec
     * 23.10.2014
     */

    StringTokenizer in;
    BufferedReader inb;
    PrintWriter out;
    static boolean local;
    final String problemname = "success";
    final static String _localArg="geshpaniecz";
    final static byte IO=1;
        /* IO:
         * 1 - standard I/O
         * 2 - input.txt/output.txt
         * 3 - problemname.in/problemname.out
         */

    public void solve() throws Exception {
        int n = nextInt();
        String s = next();
        int[] lens = new int[n];
        for (int i = 0; i < n; i++) {
            lens[i] = nextInt();
        }
        int curPos = 0;
        boolean cycle = false;
        boolean[] beThere = new boolean[n];
        Arrays.fill(beThere,false);
        beThere[0] = true;
        while(!cycle)
        {
            curPos += (s.charAt(curPos) == '>'?1:-1)*lens[curPos];
            if (curPos>=0 && curPos < n)
            {
                if (beThere[curPos])
                    cycle = true;
                else
                    beThere[curPos] = true;
            }
            else
            {
                out.println("FINITE");
                return;
            }
        }
        out.println("INFINITE");
    }

    public static void main(String[] args) throws Exception {
        local = false;
        if (args.length == 1 && args[0].equals(_localArg))
            local = true;
        new Solution().run();

    }

    public void run() throws Exception {
        if (local) {
            inb = new BufferedReader(new FileReader("input.txt"));
            out = new PrintWriter(new OutputStreamWriter(System.out));
        } else {
            switch (IO){
                case 1:
                    inb = new BufferedReader(new InputStreamReader(System.in));
                    out = new PrintWriter(new OutputStreamWriter(System.out));
                    break;
                case 2:
                    inb = new BufferedReader(new FileReader("input.txt"));
                    out = new PrintWriter(new FileWriter("output.txt"));
                    break;
                case 3:
                    inb = new BufferedReader(new FileReader(problemname+".in"));
                    out = new PrintWriter(new FileWriter(problemname+".out"));
                    break;
            }
        }
        in = new StringTokenizer("");
        double Time=System.nanoTime();
        solve();
        if (local){
            Time=System.nanoTime()-Time;
            out.println();
            out.println(" Time work: "+Time/(1e9)+" seconds");
        }
        out.flush();
    }

    int nextInt() throws Exception {
        return Integer.parseInt(next());
    }

    long nextLong() throws Exception{
        return Long.parseLong(next());
    }

    double nextDouble() throws Exception {
        return Double.parseDouble(next());
    }

    String next() throws Exception {
        if (!in.hasMoreTokens())
            in=new StringTokenizer(inb.readLine());
        return in.nextToken();
    }

    int[] nextArray(int n) throws Exception{
        int[] a=new int[n];
        for (int i=0;i<n;i++)
            a[i]=nextInt();
        return a;
    }

    long[] nextLArray(int n) throws Exception{
        long[] a=new long[n];
        for (int i=0;i<n;i++)
            a[i]=nextLong();
        return a;
    }

    double[] nextDArray(int n) throws Exception{
        double[] a=new double[n];
        for (int i=0;i<n;i++)
            a[i]=nextDouble();
        return a;
    }

    String[] nextSArray(int n) throws Exception{
        String[] a=new String[n];
        for (int i=0;i<n;i++)
            a[i]=next();
        return a;
    }

}


import java.io.*;
import java.util.StringTokenizer;

public class Main {
    private final InputReader in;
    private final PrintWriter out;

    public Main(final InputReader in, final PrintWriter out) {
        this.in = in;
        this.out = out;
    }

    private static PrintWriter getOutput(final String filename) throws IOException {
        if (filename == null || filename.isEmpty()) {
            return new PrintWriter(new OutputStreamWriter(System.out));
        } else {
            return new PrintWriter(new FileWriter(filename + ".out"));
        }
    }

    public static void main(final String[] args) throws NumberFormatException, IOException {
        final String filename = "";
        final long time = System.currentTimeMillis();
        try (final InputReader in = new InputReader(filename); final PrintWriter out = getOutput(filename)) {
            new Main(in, out).solve();
        }
//        System.err.println("Running time: " + (System.currentTimeMillis() - time));
    }

    public void solve() throws NumberFormatException, IOException {
        final int n = in.nextInt();
        final char[] dir = in.readLine().toCharArray();
        final int[] d = new int[n];
        final boolean[] visited = new boolean[n];
        for (int i = 0; i < n; i++) d[i] = in.nextInt();

        int i = 0;
        while (true) {
            if (i < 0 || i >= n) {
                out.println("FINITE");
                return;
            }
            if (visited[i]) {
                out.println("INFINITE");
                return;
            }
            visited[i] = true;
            i += dir[i] == '<' ? -d[i] : d[i];
        }
    }

    private void assertTrue(final boolean t) {
        if (!t) throw new RuntimeException();
    }
}

class InputReader implements Closeable {
    private StringTokenizer st;
    private final BufferedReader in;

    public InputReader(final String filename) throws IOException {
        if (filename == null || filename.isEmpty())
            in = new BufferedReader(new InputStreamReader(System.in));
        else
            in = new BufferedReader(new FileReader(filename + ".in"));
    }

    public boolean hasNextToken() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            String line = in.readLine();
            if (line == null)
                return false;
            st = new StringTokenizer(line);
        }
        return true;
    }

    public String nextToken() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            String line = in.readLine();
            if (line == null)
                return null;
            st = new StringTokenizer(line);
        }
        return st.nextToken();
    }

    public String readLine() throws IOException {
        return in.readLine();
    }

    public int nextInt() throws NumberFormatException, IOException {
        return Integer.parseInt(nextToken());
    }

    public long nextLong() throws NumberFormatException, IOException {
        return Long.parseLong(nextToken());
    }

    public double nextDouble() throws NumberFormatException, IOException {
        return Double.parseDouble(nextToken());
    }

    @Override
    public void close() throws IOException {
        in.close();
    }
}


import java.io.*;
import java.util.StringTokenizer;

public class A {

    public static void main(String[] args) throws IOException {
        Scanner in = new Scanner();
        PrintWriter out = new PrintWriter(System.out);
        int n = in.nextInt();
        String s = in.next();
        int arr[] = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = in.nextInt();
        }
        boolean used[] = new boolean[n];
        used[0] = true;
        int curr = 0;
        boolean fin = false;
        while (true) {
            int next = curr + (s.charAt(curr) == '>' ? 1 : -1) * arr[curr];
            if (next >= n || next < 0) {
                fin = true;
                break;
            }
            if (used[next]) {
                break;
            }
            used[next] = true;
            curr = next;
        }
        if (fin) {
            out.println("FINITE");
        } else {
            out.println("INFINITE");
        }

        out.close();
        in.close();
    }

    public static class Scanner {
        private BufferedReader br;
        private StringTokenizer st;

        public Scanner() throws IOException {
            br = new BufferedReader(new InputStreamReader(System.in));
            st = new StringTokenizer(br.readLine());
        }

        public Scanner(File source) throws IOException {
            br = new BufferedReader(new FileReader(source));
            st = new StringTokenizer(br.readLine());
        }

        public int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        public long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        public double nextDouble() throws IOException {
            return Double.parseDouble(next());
        }

        public boolean nextBoolean() throws IOException{
            return next().equals("true");
        }

        public String next() throws IOException {
            while (!st.hasMoreTokens()) {
                String s = br.readLine();
                if (s == null)
                    throw new IOException("No more Strings");
                st = new StringTokenizer(s);
            }
            return st.nextToken();
        }

        public boolean hasNext() throws IOException {
            while (!st.hasMoreTokens()) {
                String s = br.readLine();
                if (s == null)
                    return false;
                st = new StringTokenizer(s);
            }
            return true;
        }

        public void close() throws IOException {
            br.close();
        }
    }

}


import java.io.*;
import java.util.*;

public class Main implements Runnable{

    BufferedReader br;
    StringTokenizer st;
    boolean eof;

    public static void main(String[] args) {
        new Thread(new Main()).start();
    }

    String nextToken()
    {
        while(st == null || !st.hasMoreTokens())
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                eof = true;
                return "0";
            }
        return st.nextToken();
    }

    int nextInt()
    {
        return Integer.parseInt(nextToken());
    }

    void main () {
        int n = nextInt();
        String s = nextToken();
        ArrayList<Integer> a = new ArrayList<>();
        ArrayList<Boolean> used = new ArrayList<>();
        for(int i = 0; i < n; i++) {
            int step = nextInt();
            int dir = 0;
            if (s.charAt(i) == '<') {
                dir = -1;
            } else {
                dir = 1;
            }
            a.add(step * dir);
            used.add(false);
        }
        int pos = 0;
        boolean flag = false;
        while (pos >= 0 && pos < n) {
            if (used.get(pos)) {
                flag = true;
                break;
            }
            used.set(pos, true);
            pos += a.get(pos);
        }
        if (flag) {
            System.out.println("INFINITE");
        } else {
            System.out.println("FINITE");
        }
    }

    @Override
    public void run() {
        br = new BufferedReader(new InputStreamReader(System.in));
        main();
    }

}


import java.io.*;
import java.util.*;

public class B {
    public static void solution(BufferedReader reader, PrintWriter out)
            throws IOException {
        In in = new In(reader);
        int n = in.nextInt();
        String s = in.next();
        int[] len = new int[n];
        for (int i = 0; i < n; i++)
            len[i] = in.nextInt();
        boolean[] used = new boolean[n];
        int cur = 0;
        while (cur >= 0 && cur < n) {
            if (used[cur]) {
                out.println("INFINITE");
                return;
            }
            used[cur] = true;
            if (s.charAt(cur) == '<')
                cur -= len[cur];
            else
                cur += len[cur];
        }
        out.println("FINITE");
    }

    public static void main(String[] args) throws Exception {
        BufferedReader reader = new BufferedReader(
                new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(
                new BufferedWriter(new OutputStreamWriter(System.out)));
        solution(reader, out);
        out.close();
    }

    protected static class In {
        private BufferedReader reader;
        private StringTokenizer tokenizer = new StringTokenizer("");

        public In(BufferedReader reader) {
            this.reader = reader;
        }

        public String next() throws IOException {
            while (!tokenizer.hasMoreTokens())
                tokenizer = new StringTokenizer(reader.readLine());
            return tokenizer.nextToken();
        }

        public int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        public double nextDouble() throws IOException {
            return Double.parseDouble(next());
        }

        public long nextLong() throws IOException {
            return Long.parseLong(next());
        }
    }
}


import java.util.*;
import java.io.*;
import java.math.BigInteger;

import static java.lang.Math.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;

public class Main {
	public static void main(String[] args) throws Exception{
		InputReader in = new InputReader(System.in);
		PrintWriter out = new PrintWriter(System.out);
		TaskA solver = new TaskA();
		solver.solve(1, in, out);
		out.close();
	}

static class TaskA {

  // GCD && LCM
	 long gcd(long a ,long b){return b == 0 ? a : gcd(b , a % b);}
	 long lcm(long a , long b){return a*(b/gcd(a, b));}
 // REverse a String
	String rev(String s){
		return new StringBuilder(s).reverse().toString();
	}

	/*          SOLUTION  IS RIGHT HERE     */

	public void solve(int testNumber, InputReader in, PrintWriter out){
		 // n br = new BufferedReader(new InputStreamReader(System.in));
		 // Scanner sc = new Scanner(System.in);

		int n = in.nextInt();

		char[] ss = ("0"+in.next()).toCharArray();

		int[] a = new int[n+1];

		for(int i = 1; i <= n; i++)a[i] = in.nextInt();

		boolean[] vis = new boolean[n+1];
		int pos = 1;
		for(int i = 0; i <= n+1; i++){
			if( pos <= 0 || pos > n){
				out.println("FINITE");
				return;
			}
			if(ss[pos] == '>'){

				if(vis[pos] ){
					out.println("INFINITE");
					return;
				}

				vis[pos] = true;

				pos = pos + a[pos];

			}else{

				if(vis[pos]){
					out.println("INFINITE");
					return;
				}

				vis[pos] = true;

				pos = pos - a[pos];
			}
		}
	}

}

 // ||||||| INPUT READER ||||||||
 static class InputReader {
	private byte[] buf = new byte[8000];
	private int index;
	private int total;
	private InputStream in;
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	public InputReader(InputStream stream){
		in = stream;
	}

	public int scan(){
		if(total == -1)
			throw new InputMismatchException();
		if(index >= total){
			index = 0;
			try{
			total = in.read(buf);
			}catch(IOException e){
			   throw new InputMismatchException();
			}
			if(total <= 0)
				return -1;
		}
		return buf[index++];
	}
	public long scanlong(){
		long integer = 0;
		int n = scan();
		while(isWhiteSpace(n))
			n = scan();
		int neg = 1;
		if(n == '-'){
			neg = -1;
			n = scan();
		}
		while(!isWhiteSpace(n)){
			if(n >= '0' && n <= '9'){
				integer *= 10;
				integer += n - '0';
				n = scan();
			}
			else throw new InputMismatchException();
		}
		return neg*integer;
	}

	private int scanInt() {
		int integer = 0;
		int n = scan();
		while(isWhiteSpace(n))
			n = scan();
		int neg = 1;
		if(n == '-'){
			neg = -1;
			n = scan();
		}
		while(!isWhiteSpace(n)){
			if(n >= '0' && n <= '9'){
				integer *= 10;
				integer += n - '0';
				n = scan();
			}
			else throw new InputMismatchException();
		}
		return neg*integer;
	}

	public double scandouble(){
		double doubll = 0;
		int n = scan();
		int neg = 1;
		while(isWhiteSpace(n))
			n = scan();
		if(n == '-'){
			neg = -1;
			n = scan();
		}
		while(!isWhiteSpace(n) && n != '.'){
			if(n >= '0' && n <= '9'){
				doubll *= 10;
				doubll += n - '0';
				n = scan();
			}
		}
		if(n == '.'){
			n = scan();
			double temp = 1;
			while(!isWhiteSpace(n)){
				if(n >= '0' && n <= '9'){
					temp /= 10;
					doubll += (n - '0')*temp;
					n = scan();
				}
			}
		}
		return neg*doubll;
	}

	private float scanfloat() {
		float doubll = 0;
		int n = scan();
		int neg = 1;
		while(isWhiteSpace(n))
			n = scan();
		if(n == '-'){
			neg = -1;
			n = scan();
		}
		while(!isWhiteSpace(n) && n != '.'){
			if(n >= '0' && n <= '9'){
				doubll *= 10;
				doubll += n - '0';
				n = scan();
			}
		}
		if(n == '.'){
			n = scan();
			double temp = 1;
			while(!isWhiteSpace(n)){
				if(n >= '0' && n <= '9'){
					temp /= 10;
					doubll += (n - '0')*temp;
					n = scan();
				}
			}
		}
		return neg*doubll;
	}
	public String scanstring(){
		StringBuilder sb = new StringBuilder();
		int n = scan();
		while(isWhiteSpace(n))
			n = scan();
		while(!isWhiteSpace(n)){
			sb.append((char)n);
			n = scan();
		}
		return sb.toString();
	}

	public boolean isWhiteSpace(int n){
		if(n == ' ' || n == '\n' || n == '\r' || n == '\t' || n == -1)
			return true;
		return false;
	}
/// Input module

	public int nextInt(){
	  return scanInt();
	}

	public long nextLong(){
		  return  scanlong();
		}

	public double nextDouble(){
		  return  scandouble();
		}

	public float nextFloat(){
		  return scanfloat();
		}

	public String next(){
		return scanstring();
	}

	public String nextLine(){
		String S = "";
		try {
			S = br.readLine();
			 br.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
		return S;
	}

	public int[] readIntArray(int size)  {
        int[] array = new int[size];
        for (int i = 0; i < size; i++) {
            array[i] = nextInt();
        }
        return array;
    }
}

}


/**
 * Created by Владелец on 24.04.2016.
 */

import java.io.*;
import java.util.*;

public class Jumper {

    public static void main(String[] args) {
        new Jumper().run();
    }

    private void run() {
        IO std = new IO();
        int n = std.nextInt();
        int[] move = new int[n];
        char[] dir = std.next().toCharArray();
        for (int i = 0; i < n; i++) {
            if (dir[i] == '<') {
                move[i] = -1;
            } else {
                move[i] = 1;
            }
        }
        for (int i = 0; i < n; i++) {
            move[i] *= std.nextInt();
        }

        boolean[] visited = new boolean[n];
        int t = 0;
        while (!visited[t]) {
            visited[t] = true;
            if (t + move[t] < 0 || t + move[t] >= n) {
                std.print("FINITE");
                std.close();
                return;
            } else {
                t += move[t];
            }
        }

        std.print("INFINITE");
        std.close();
    }

    private class IO {
        BufferedReader in;
        PrintWriter out;
        StringTokenizer st;

        public IO() {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out, true);
        }

        public IO(String name) {
            try {
                in = new BufferedReader(new FileReader(name + ".in"));
                out = new PrintWriter(name + ".out");
            } catch (IOException e) {
                e.printStackTrace();
                System.exit(1);
            }
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(in.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public void print(Object o) {
            out.print(o);
        }

        public void println(Object o) {
            out.println(o);
        }

        public void close() {
            out.close();
        }
    }

}


import java.util.Arrays;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        int n;
        Scanner sb = new Scanner(System.in);
        String str;
        n = sb.nextInt();
        str = sb.next();
        long[] jump = new long[n];
        int i;
        for(i=0;i<n;i++)
            jump[i] = sb.nextLong();

        int[] visited = new int[n + 1];
        Arrays.fill(visited,0);
        int flag = 0;
        int curr_pos = 0;
        while(1 > 0){
            if(str.charAt(curr_pos) == '>'){
                if(curr_pos + jump[curr_pos] >= n){
                    flag = 1;
                    break;
                }
                if(visited[curr_pos + (int)jump[curr_pos]] == 1){
                    break;
                }
                visited[curr_pos] = 1;
                curr_pos = curr_pos + (int)jump[curr_pos];
            }
            else{
                if(curr_pos - jump[curr_pos] < 0){
                    flag = 1;
                    break;
                }
                if(visited[curr_pos - (int)jump[curr_pos]] == 1){
                    break;
                }
                visited[curr_pos] = 1;
                curr_pos = curr_pos - (int)jump[curr_pos];
            }
        }
        if(flag == 1)
            System.out.println("FINITE\n");
        else
            System.out.println("INFINITE\n");
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class A {

	public static void main(String[] args) throws IOException
	{
		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);

		int n = sc.nextInt(), l[] = new int[n];
		char[] s = sc.next().toCharArray();
		for(int i = 0; i < n; ++i)
			l[i] = sc.nextInt();

		boolean finite = false;
		int cell = 0;
		while(!finite)
		{
			if(l[cell] == -1)
				break;
			int d = l[cell];
			if(s[cell] == '<')
				d *= -1;
			if(cell + d < 0 || cell + d >= n)
				finite = true;
			else
			{
				l[cell] = -1;
				cell += d;
			}
		}

		out.println(finite?"FINITE":"INFINITE");
		out.flush();
		out.close();
	}

	static class Scanner
	{
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}

		public String next() throws IOException
		{
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int nextInt() throws IOException {return Integer.parseInt(next());}

		public long nextLong() throws IOException {return Long.parseLong(next());}

		public String nextLine() throws IOException {return br.readLine();}

		public boolean ready() throws IOException {return br.ready();}

	}
}


import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.NoSuchElementException;

public class A {
	int N;
	String s;
	int[] d;
	boolean[] used;
	public void solve() {
		N = nextInt();
		s = next();
		d = new int[N];
		used = new boolean[N];
		for(int i = 0;i < N;i++){
			d[i] = nextInt();
		}
		int i = 0;
		for(;;){
			if(used[i])break;
			used[i] = true;
			if(s.charAt(i) == '>'){
				if(i + d[i] >= N){
					out.println("FINITE");
					return;
				}
				i = i + d[i];
			}else{
				if(i - d[i] < 0){
					out.println("FINITE");
					return;
				}
				i = i - d[i];
			}
		}
		out.println("INFINITE");
	}

	public static void main(String[] args) {
		out.flush();
		new A().solve();
		out.close();
	}

	/* Input */
	private static final InputStream in = System.in;
	private static final PrintWriter out = new PrintWriter(System.out);
	private final byte[] buffer = new byte[2048];
	private int p = 0;
	private int buflen = 0;

	private boolean hasNextByte() {
		if (p < buflen)
			return true;
		p = 0;
		try {
			buflen = in.read(buffer);
		} catch (IOException e) {
			e.printStackTrace();
		}
		if (buflen <= 0)
			return false;
		return true;
	}

	public boolean hasNext() {
		while (hasNextByte() && !isPrint(buffer[p])) {
			p++;
		}
		return hasNextByte();
	}

	private boolean isPrint(int ch) {
		if (ch >= '!' && ch <= '~')
			return true;
		return false;
	}

	private int nextByte() {
		if (!hasNextByte())
			return -1;
		return buffer[p++];
	}

	public String next() {
		if (!hasNext())
			throw new NoSuchElementException();
		StringBuilder sb = new StringBuilder();
		int b = -1;
		while (isPrint((b = nextByte()))) {
			sb.appendCodePoint(b);
		}
		return sb.toString();
	}

	public int nextInt() {
		return Integer.parseInt(next());
	}

	public long nextLong() {
		return Long.parseLong(next());
	}

	public double nextDouble() {
		return Double.parseDouble(next());
	}
}


import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.NoSuchElementException;

public class A {
	int N;
	String s;
	int[] d;
	public void solve() {
		N = nextInt();
		s = next();
		d = new int[N];
		for(int i = 0;i < N;i++){
			d[i] = nextInt();
		}

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

			if(s.charAt(i) == '>'){
				if(d[i] > N - i){
					out.println("FINITE");
					return;
				}
			}else{
				if(d[i] > i){
					out.println("FINITE");
					return ;
				}
			}
		}
		out.println("INFINITE");
	}

	public static void main(String[] args) {
		out.flush();
		new A().solve();
		out.close();
	}

	/* Input */
	private static final InputStream in = System.in;
	private static final PrintWriter out = new PrintWriter(System.out);
	private final byte[] buffer = new byte[2048];
	private int p = 0;
	private int buflen = 0;

	private boolean hasNextByte() {
		if (p < buflen)
			return true;
		p = 0;
		try {
			buflen = in.read(buffer);
		} catch (IOException e) {
			e.printStackTrace();
		}
		if (buflen <= 0)
			return false;
		return true;
	}

	public boolean hasNext() {
		while (hasNextByte() && !isPrint(buffer[p])) {
			p++;
		}
		return hasNextByte();
	}

	private boolean isPrint(int ch) {
		if (ch >= '!' && ch <= '~')
			return true;
		return false;
	}

	private int nextByte() {
		if (!hasNextByte())
			return -1;
		return buffer[p++];
	}

	public String next() {
		if (!hasNext())
			throw new NoSuchElementException();
		StringBuilder sb = new StringBuilder();
		int b = -1;
		while (isPrint((b = nextByte()))) {
			sb.appendCodePoint(b);
		}
		return sb.toString();
	}

	public int nextInt() {
		return Integer.parseInt(next());
	}

	public long nextLong() {
		return Long.parseLong(next());
	}

	public double nextDouble() {
		return Double.parseDouble(next());
	}
}


import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.NoSuchElementException;

public class A {
	int N;
	String s;
	int[] d;
	public void solve() {
		N = nextInt();
		s = next();
		d = new int[N];
		for(int i = 0;i < N;i++){
			d[i] = nextInt();
		}

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

			if(s.charAt(i) == '>'){
				if(d[i] > N - i - 1){
					out.println("FINITE");
					return;
				}
			}else{
				if(d[i] > i){
					out.println("FINITE");
					return ;
				}
			}
		}
		out.println("INFINITE");
	}

	public static void main(String[] args) {
		out.flush();
		new A().solve();
		out.close();
	}

	/* Input */
	private static final InputStream in = System.in;
	private static final PrintWriter out = new PrintWriter(System.out);
	private final byte[] buffer = new byte[2048];
	private int p = 0;
	private int buflen = 0;

	private boolean hasNextByte() {
		if (p < buflen)
			return true;
		p = 0;
		try {
			buflen = in.read(buffer);
		} catch (IOException e) {
			e.printStackTrace();
		}
		if (buflen <= 0)
			return false;
		return true;
	}

	public boolean hasNext() {
		while (hasNextByte() && !isPrint(buffer[p])) {
			p++;
		}
		return hasNextByte();
	}

	private boolean isPrint(int ch) {
		if (ch >= '!' && ch <= '~')
			return true;
		return false;
	}

	private int nextByte() {
		if (!hasNextByte())
			return -1;
		return buffer[p++];
	}

	public String next() {
		if (!hasNext())
			throw new NoSuchElementException();
		StringBuilder sb = new StringBuilder();
		int b = -1;
		while (isPrint((b = nextByte()))) {
			sb.appendCodePoint(b);
		}
		return sb.toString();
	}

	public int nextInt() {
		return Integer.parseInt(next());
	}

	public long nextLong() {
		return Long.parseLong(next());
	}

	public double nextDouble() {
		return Double.parseDouble(next());
	}
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Nasko
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        public void solve(int testNumber, InputReader in, PrintWriter out) {

            int N = in.nextInt();
            String s = in.nextLine();
            long[] jump = new long[s.length()];
            for (int i = 0; i < s.length(); ++i) jump[i] = in.nextInt();
            int start = 0;
            boolean[] can = new boolean[N + 1];
            can[0] = true;
            while (true) {
                start += (s.charAt(start) == '<') ? -jump[start] : jump[start];
                if (start < 0 || start >= N) {
                    out.println("FINITE");
                    return;
                } else {
                    if (can[start]) {
                        out.println("INFINITE");
                        return;
                    }
                    can[start] = true;
                }
            }

        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public String nextLine() {
            try {
                return reader.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return null;
        }

    }
}


import java.util.Scanner;

public class Saltamontes {

	public static void main(String agrs[]){
		int n;
		Scanner scan=new Scanner(System.in);
		n=Integer.parseInt(scan.nextLine());

		String[] direccion=new String[n];
		int[] saltos=new int[n];

		for(int i=0;i<n;i++){
			direccion[i]=scan.nextLine();
		}
		for(int i=0;i<n;i++){
			saltos[i]=Integer.parseInt(scan.nextLine());
		}
		n=0;
		int na=0;
		while(true){
			na=n;
			if(direccion[n].compareTo("<")==0){
				saltos[n]=saltos[n]*(-1);
			}
			n+=saltos[n];
			if(n>saltos.length || n<0){
				System.out.println("FINITE");
				break;
			}
			if(saltos[n]==0){
				System.out.println("INFINIE");
				break;
			}
			saltos[na]=0;
		}
		scan.close();
	}
}


import java.util.Scanner;

public class Saltamontes {

	public static void main(String agrs[]){
		String x="";
		char w[];
		int y=0;
		int z[];

		Scanner scan=new Scanner(System.in);
		y=Integer.parseInt(scan.nextLine());
		z=new int[y];
		w=new char[y];
		y=0;
		x=scan.nextLine();
		for(int i=0;i<x.length();i++){
			w[i]=x.charAt(i);
		}
		x=scan.nextLine();
		for(int i=0;i<x.length();i++){
			if(x.charAt(i)==' '){
				y++;
			}
			else{
				if(z[y]>0)
					z[y]=z[y]*10+x.charAt(i)-'0';
				else
					z[y]+=x.charAt(i)-'0';
			}
		}

		//-----------------------------------
		int n=0, na=0;
		while(true){
			na=n;
			if(w[n]=='<'){
				z[n]=z[n]*(-1);
			}
			n+=z[n];
			if(n>z.length || n<0){
				System.out.println("FINITE");
				break;
			}
			if(z[n]==0){
				System.out.println("INFINIE");
				break;
			}
			z[na]=0;
		}
		scan.close();
	}
}


import java.util.Scanner;

public class Saltamontes {

	public static void main(String agrs[]){
		String x="";
		char w[];
		int y=0;
		int z[];

		Scanner scan=new Scanner(System.in);
		y=Integer.parseInt(scan.nextLine());
		z=new int[y];
		w=new char[y];
		y=0;
		x=scan.nextLine();
		for(int i=0;i<x.length();i++){
			w[i]=x.charAt(i);
		}
		x=scan.nextLine();
		for(int i=0;i<x.length();i++){
			if(x.charAt(i)==' '){
				y++;
			}
			else{
				if(z[y]>0)
					z[y]=z[y]*10+x.charAt(i)-'0';
				else
					z[y]+=x.charAt(i)-'0';
			}
		}

		//-----------------------------------
		int n=0, na=0;
		while(true){
			na=n;
			if(w[n]=='<'){
				z[n]=z[n]*(-1);
			}
			n+=z[n];
			if(n>z.length || n<0){
				System.out.println("FINITE");
				break;
			}
			if(z[n]==0){
				System.out.println("INFINITE");
				break;
			}
			z[na]=0;
		}
		scan.close();
	}
}


import java.util.Scanner;

public class Saltamontes {

	public static void main(String agrs[]){
		String x="";
		char w[];
		int y=0;
		int z[];

		Scanner scan=new Scanner(System.in);
		y=Integer.parseInt(scan.nextLine());
		z=new int[y];
		w=new char[y];
		y=0;
		x=scan.nextLine();
		for(int i=0;i<x.length();i++){
			w[i]=x.charAt(i);
		}
		x=scan.nextLine();
		for(int i=0;i<x.length();i++){
			if(x.charAt(i)==' '){
				y++;
			}
			else{
				if(z[y]>0)
					z[y]=z[y]*10+x.charAt(i)-'0';
				else
					z[y]+=x.charAt(i)-'0';
			}
		}

		//-----------------------------------
		int n=0, na=0;
		while(true){
			na=n;
			if(w[n]=='<'){
				z[n]=z[n]*(-1);
			}
			n+=z[n];
			if(n>(z.length-1) || n<0){
				System.out.println("FINITE");
				break;
			}
			if(z[n]==0){
				System.out.println("INFINITE");
				break;
			}
			z[na]=0;
		}
		scan.close();
	}
}


#include<iostream>
using namespace std;

int main()
{
    int y,k,n;

    cin>>y>>k>>n;
    if(n-y==0)
    {
        cout<<"-1";
        return 0;
    }

    for(int i=1; i<=100000; i++)
    {   if(k*i<=n)
           {

            if((k*i-y)>0)
                cout<<k*i-y<<" ";
           }
        else
            return 0;
    }

}


#include<iostream>
using namespace std;

int main()
{
    int y,k,n;

    cin>>y>>k>>n;
    if(n-y<=0)
    {
        cout<<"-1";
        return 0;
    }

    for(int i=1; i<=100000; i++)
    {   if(k*i<=n)
           {

            if((k*i-y)>0)
                cout<<k*i-y<<" ";
           }
        else
            return 0;
    }

}


#include<iostream>
using namespace std;

int main()
{
    int y,k,n;
    cin>>y>>k>>n;
    int x=n-y;
    if(x==0)
        {cout<<"-1";
            return 0;}
    for(int i=y; i<=y+x; i++)
    {
        if(i%k==0)
        {   if(i-y>0)
                cout<<i-y<<" ";
        }
    }
}


#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define F first
#define S second
#define ret return
using namespace std ;

int a[105][105] ;

int main(int argc, char **argv)
{ios::sync_with_stdio(0) ;

    int n , k , y , x ;
    bool is = 0 ;

    cin >> y >> k >> n ;

    int i = k - (y % k) ;

    for(; i + y <= n ; i += k)
        if((y + i) % k == 0 && (y + i) <= n)
        {
            cout << i << " " ;
            is = 1 ;
        }

    if(is == 0)
        cout << -1 ;

	ret 0;
}


#include<iostream>
using namespace std;

int main()
{
    int y,k,n;

    cin>>y>>k>>n;
    if(n-y>0)
    {
        cout<<"-1";
        return 0;
    }

    for(int i=1; i<=100000; i++)
    {   if(k*i<=n)
           {

            if((k*i-y)>0)
                cout<<k*i-y<<" ";
           }
        else
            return 0;
    }

}


#include<iostream>
using namespace std;

int main()
{
    long long y,k,n;
    cin>>y>>k>>n;
    long long x=n-y;
    if(x==0)
        {cout<<"-1";
            return 0;}
    for(long long i=y; i<=y+x; i++)
    {
        if(i%k==0)
        {   if(i-y>0)
                cout<<i-y<<" ";
        }
    }
}


#include<iostream>
using namespace std;

int main()
{
    int y,k,n;
    cin>>y>>k>>n;

    for(int i=1; i<=100000; i++)
    {   if(k*i<=n)
           {

            if((k*i-y)>0)
                cout<<k*i-y<<" ";
           }
        else
            return 0;
    }

}


#include<iostream>
using namespace std;

int main()
{
    int y,k,n;
    cin>>y>>k>>n;
    int x=n-y;
    if(x==0)
        {cout<<"-1";
            return 0;}
    for(int i=y; i<=y+x; i++)
    {
        if(i%k==0)
        {
            cout<<i-y<<" ";
        }
    }
}


#include <iostream>
using namespace std;

int main() {
	// your code goes here
	long long int y,k,n,i,flag=0,f,g,l,j;
	cin>>y>>k>>n;
	g=n-y;
	f=g/k;
	for(i=y;i<=n;i++)
	{
	    if(i%k==0)
	    {
	        if((i-y)!=0)
	        {
	            l=i-y;
	            flag++;
	       break;
	    }
	    }
	}
	if(flag!=0)
	for(j=0;j<f;j++)
	{
	    cout<<l<<" ";
	    l=l+k;
	}
	if(flag==0)
	{
	    cout<<"-1";
	}

	return 0;
}


#include <iostream>
using namespace std;

int main() {
	// your code goes here
	long long int y,k,n,i,flag=0;
	cin>>y>>k>>n;
	for(i=y;i<=n;i++)
	{
	    if(i%k==0)
	    {
	        if((i-y)!=0)
	        {
	        cout<<i-y<<" ";
	        flag++;
	    }
	    }
	}
	if(flag==0)
	{
	    cout<<"-1";
	}

	return 0;
}


#include <iostream>
using namespace std;

int main() {
	// your code goes here
	long long int y,k,n,i,flag=0;
	cin>>y>>k>>n;
	for(i=y;i<=n;i++)
	{
	    if(i%k==0)
	    {
	        if((i-y)!=0)
	        {
	        cout<<i-y<<" ";
	        i=i+k-1;
	        flag++;
	    }
	    }
	}
	if(flag==0)
	{
	    cout<<"-1";
	}

	return 0;
}


#include <iostream>
using namespace std;

int main() {
	// your code goes here
	long long int y,k,n,i,flag=0,f,l,j;
	cin>>y>>k>>n;
	f=n/k;
	for(i=y;i<=n;i++)
	{
	    if(i%k==0)
	    {
	        if((i-y)!=0)
	        {
	            l=i-y;
	            flag++;
	       break;
	    }
	    }
	}
	if(flag!=0)
	for(j=1;j<f;j++)
	{
	    cout<<l<<" ";
	    l=l+k;
	}
	if(flag==0)
	{
	    cout<<"-1";
	}

	return 0;
}


#include <iostream>
using namespace std;

int main() {
	// your code goes here
	long long int y,k,n,i,flag=0;
	cin>>y>>k>>n;
	for(i=y;i<=n;i++)
	{
	    if(i%k==0)
	    {
	        cout<<i-y<<" ";
	        flag++;
	    }
	}
	if(flag==0)
	{
	    cout<<"-1";
	}

	return 0;
}


#include <iostream>
using namespace std;

int main() {
	// your code goes here
	long long int y,k,n,i,flag=0;
	cin>>y>>k>>n;
	for(i=y;i<n;i++)
	{
	    if(i%k==0)
	    {
	        cout<<i-y<<" ";
	        flag++;
	    }
	}
	if(flag==0)
	{
	    cout<<"-1";
	}

	return 0;
}


#include <iostream>
using namespace std;

int main() {
	// your code goes here
	long long int y,k,n,i,flag=0;
	cin>>y>>k>>n;
	for(i=y;i<=n;i++)
	{
	    if(i%k==0)
	    {
	        if((i-y)!=0)
	        cout<<i-y<<" ";
	        flag++;
	    }
	}
	if(flag==0)
	{
	    cout<<"-1";
	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long int x,y,n,k,r,m,i,c;
while(cin>>y>>k>>n)
    {
        r=k-y%k;
        m=n-y;
        if(r<=m)
        {
            cout<<r;
            r=r+k;

            while(r<=m)
            {
                cout<<" "<<r;
                r=r+k;
            }
        }
        else
        {
            cout<<"-1";
        }
        cout<<endl;

    }
    return 0;
}


#include<bits/stdc++.h>

using namespace std;
typedef long long ll;

int main()
{
    ios_base::sync_with_stdio(false);
    ll n,y,k;
    cin>>y>>k>>n;
    ll count = n-y;
    if(count < k || k > n)
    {
      cout<<-1;
      return 0;
    }

    ll start = y - (y%k);

      for (size_t i = start+k ; i <= n; i+=k) {
        /* code */

        cout<<i-y<<" ";
      }

    return 0;
  }


#include<bits/stdc++.h>

using namespace std;
typedef long long ll;

int main()
{
    ios_base::sync_with_stdio(false);
    ll n,y,k;
    cin>>y>>k>>n;
    ll count = n-y;
    if(count <= 0 || k > n-1)
    {
      cout<<-1;
      return 0;
    }

    ll start = y - (y%k);

      for (size_t i = start+k ; i <= n; i+=k) {
        /* code */

        cout<<i-y<<" ";
      }

    return 0;
  }


#include<bits/stdc++.h>

using namespace std;
typedef long long ll;

int main()
{
    ios_base::sync_with_stdio(false);
    ll n,y,k;
    cin>>y>>k>>n;
    ll count = n-y;
    ll start = k - (y%k);
    if(start > count)
    {
      cout<<-1;
      return 0;
    }

      for (size_t i = start ; i <= n; i+=k) {
        /* code */

        cout<<i-y<<" ";
      }

    return 0;
  }


#include<bits/stdc++.h>

using namespace std;
typedef long long ll;

int main()
{
    ios_base::sync_with_stdio(false);
    ll n,y,k;
    cin>>y>>k>>n;
    ll count = n-y;
    ll start = k - (y%k);
    if(start > count)
    {
      cout<<-1;
      return 0;
    }

      for (size_t i = start ; i <= count; i+=k) {
        /* code */

        cout<<i<<" ";
      }

    return 0;
  }


#include<bits/stdc++.h>

using namespace std;
typedef long long ll;

int main()
{
    ios_base::sync_with_stdio(false);
    int n,y,k;
    cin>>y>>k>>n;
    int count = n-y;
    if(count == 0 || k < n-1 )
    {
      cout<<-1;
      return 0;
    }

      for (size_t i = 1; i < count; i++) {
        /* code */
        if((i+y)%k == 0)
        cout<<i<<" ";
      }

    return 0;
  }


#include<bits/stdc++.h>

using namespace std;
typedef long long ll;

int main()
{
    ios_base::sync_with_stdio(false);
    int n,y,k;
    cin>>y>>k>>n;
    int count = n-y;
    if(count == 0 || k > n-1 )
    {
      cout<<-1;
      return 0;
    }

    int start = y+(y%k);

      for (size_t i = start+k ; i <= n; i+=k) {
        /* code */

        cout<<i-y<<" ";
      }

    return 0;
  }


#include<bits/stdc++.h>

using namespace std;
typedef long long ll;

int main()
{
    ios_base::sync_with_stdio(false);
    int n,y,k;
    cin>>y>>k>>n;
    int count = n-y;
    if(count == 0 || k > n-1 )
    {
      cout<<-1;
      return 0;
    }

      for (size_t i = 1; i < count; i++) {
        /* code */
        if((i+y)%k == 0)
        cout<<i<<" ";
      }

    return 0;
  }


#include<bits/stdc++.h>

using namespace std;
typedef long long ll;

int main()
{
    ios_base::sync_with_stdio(false);
    ll n,y,k;
    cin>>y>>k>>n;
    ll count = n-y;
    if(count <= 0 || k > n)
    {
      cout<<-1;
      return 0;
    }

    ll start = y - (y%k);

      for (size_t i = start+k ; i <= n; i+=k) {
        /* code */

        cout<<i-y<<" ";
      }

    return 0;
  }


#include<bits/stdc++.h>

using namespace std;
typedef long long ll;

int main()
{
    ios_base::sync_with_stdio(false);
    int n,y,k;
    cin>>y>>k>>n;
    int count = n-y;
    if(count == 0 || k > n-1 )
    {
      cout<<-1;
      return 0;
    }

      for (size_t i = 1; i <= count; i++) {
        /* code */
        if((i+y)%k == 0)
        cout<<i<<" ";
      }

    return 0;
  }


#include<bits/stdc++.h>

using namespace std;
typedef long long ll;

int main()
{
    ios_base::sync_with_stdio(false);
    ll n,y,k;
    cin>>y>>k>>n;
    ll count = n-y;
    if(count == 0 || k > n-1 )
    {
      cout<<-1;
      return 0;
    }

    ll start = y-(y%k);

      for (size_t i = start+k ; i <= n; i+=k) {
        /* code */

        cout<<i-y<<" ";
      }

    return 0;
  }


#include<bits/stdc++.h>

using namespace std;
typedef long long ll;

int main()
{
    ios_base::sync_with_stdio(false);
    int n,y,k;
    cin>>y>>k>>n;
    int count = n-y;
    if(count == 0 || k > n-1 )
    {
      cout<<-1;
      return 0;
    }

    int start = y-(y%k);

      for (size_t i = start+k ; i <= n; i+=k) {
        /* code */

        cout<<i-y<<" ";
      }

    return 0;
  }


#include<bits/stdc++.h>

using namespace std;
typedef long long ll;

int main()
{
    ios_base::sync_with_stdio(false);
    int n,y,k;
    cin>>y>>k>>n;
    int count = n-y;
    if(count == 0 || k > n-1 )
    {
      cout<<-1;
      return 0;
    }

      for (size_t i = 2*k; i <= n; i+=k) {
        /* code */

        cout<<i-y<<" ";
      }

    return 0;
  }


#include<bits/stdc++.h>

using namespace std;
typedef long long ll;

int main()
{
    ios_base::sync_with_stdio(false);
    ll n,y,k;
    cin>>y>>k>>n;
    ll count = n-y;
    if(count <= 0 || k > n || y - (y%k) < k)
    {
      cout<<-1;
      return 0;
    }

    ll start = y - (y%k);

      for (size_t i = start+k ; i <= n; i+=k) {
        /* code */

        cout<<i-y<<" ";
      }

    return 0;
  }


#include<bits/stdc++.h>

using namespace std;
typedef long long ll;

int main()
{
    ios_base::sync_with_stdio(false);
    ll n,y,k;
    cin>>y>>k>>n;
    ll count = n-y;
    if(count <= k || k > n)
    {
      cout<<-1;
      return 0;
    }

    ll start = y - (y%k);

      for (size_t i = start+k ; i <= n; i+=k) {
        /* code */

        cout<<i-y<<" ";
      }

    return 0;
  }


#include <iostream>

using namespace std;

int main()
{
  int long x,y,n,k;
  cin>>y>>k>>n ;
     int i;

     if(n<=y)
     {
         cout<<-1 ;
         return 0 ;
     }
      for (int i=2;i<=n/k;i++)
           {
            x=k*i-y;
      cout <<x<<endl;
      }
return 0;
}


#include <iostream>

using namespace std;

int main()
{int i=1; ;
  int long x,y,n,k;
  cin>>y>>k>>n ;
if (n>y)
  {
      while (x<(n-y))
      {
            x=(k*i)-y;
          i++ ;
      }

      cout<<x<<endl;
      }

else {cout<<-1;}
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
  int long x,y,n,k;

  cin>>y>>k>>n ;
     int i;

     if(n<=y)
     {
         cout<<-1 ;
         return 0 ;
     }
      for (int i=y+1;i<n/k;i++)
           {
            x=k*i-y;
      cout <<x<<endl;
      }
return 0;
}


#include <iostream>

using namespace std;

int main()
{
  int long  x,y,n,k;

  cin>>y>>k>>n ;

     if(y>=n || (y%k)+y>n)
     {
         cout<<-1 ;
         return 0 ;
     }
     else{
      for (int i=1;i<=n/k;i++)
           {
            x=k*i-y;
            if (x>=1){
      cout <<x<<endl;}

      }}
return 0;
}


#include <iostream>

using namespace std;

int main()
{
  int long  x,y,n,k;

  cin>>y>>k>>n ;

     if(y>n || (y%k)+y>=n)
     {
         cout<<-1 ;
         return 0 ;
     }
     else{
      for (int i=1;i<=n/k;i++)
           {
            x=k*i-y;
            if (x>=1){
      cout <<x<<endl;}

      }}
return 0;
}


#include <iostream>

using namespace std;

int main()
{
  int long  x,y,n,k;

  cin>>y>>k>>n ;

     if(y>=n || (y%k)+y>n || k>n)
     {
         cout<<-1 ;
         return 0 ;
     }
     else{
      for (int i=1;i<=n/k;i++)
           {
            x=k*i-y;
            if (x>=1){
      cout <<x<<endl;}

      }}
return 0;
}


#include <iostream>

using namespace std;

int main()
{
  int long  x,y,n,k;

  cin>>y>>k>>n ;
     int i;

     if(y>n-k)
     {
         cout<<-1 ;
         return 0 ;
     }
     else{
      for (int i=1;i<=n/k;i++)
           {
            x=k*i-y;
            if (x>=1){
      cout <<x<<endl;}

      }}
return 0;
}


#include <iostream>

using namespace std;

int main()
{
  int long y,n,k;
  unsigned x ;
  cin>>y>>k>>n ;
     int i;

     if(n<=y)
     {
         cout<<-1 ;
         return 0 ;
     }
      for (int i=2;i<=n/k;i++)
           {
            x=k*i-y;
      cout <<x<<endl;
      }
return 0;
}


#include <iostream>

using namespace std;

int main()
{
  int long  x,y,n,k;

  cin>>y>>k>>n ;

     if(y>=n || (k-(y%k))+y>n || k>n)
     {
         cout<<-1 ;
         return 0 ;
     }
     else{
      for (int i=1;i<=n/k;i++)
           {
            x=k*i-y;
            if (x>=1){
      cout <<x<<endl;}

      }}
return 0;
}


#include <iostream>

using namespace std;

int main()
{
  int long  x,y,n,k;

  cin>>y>>k>>n ;
     int i;

     if(n<=y)
     {
         cout<<-1 ;
         return 0 ;
     }
     else{
      for (int i=k/y;i<=n/k;i++)
           {
            x=k*i-y;
            if (x>=1){
      cout <<x<<endl;}

      }}
return 0;
}


#include <iostream>

using namespace std;

int main()
{
  int long  x,y,n,k;

  cin>>y>>k>>n ;

     if(y>=n || (y%k)+y>n || k>=n)
     {
         cout<<-1 ;
         return 0 ;
     }
     else{
      for (int i=1;i<=n/k;i++)
           {
            x=k*i-y;
            if (x>=1){
      cout <<x<<endl;}

      }}
return 0;
}


#include <iostream>

using namespace std;

int main()
{
  int long  x,y,n,k;

  cin>>y>>k>>n ;
     int i;

     if(n<=y)
     {
         cout<<-1 ;
         return 0 ;
     }
     else{
      for (int i=1;i<=n/k;i++)
           {
            x=k*i-y;
            if (x>=1){
      cout <<x<<endl;}

      }}
return 0;
}


#include <iostream>

using namespace std;

int main()
{
  int long  x,y,n,k;

  cin>>y>>k>>n ;
     int i;

     if(y>n || ((y+1)%k)+y>n)
     {
         cout<<-1 ;
         return 0 ;
     }
     else{
      for (int i=1;i<=n/k;i++)
           {
            x=k*i-y;
            if (x>=1){
      cout <<x<<endl;}

      }}
return 0;
}


#include <iostream>

using namespace std;

int main()
{
  int long  x,y,n,k;

  cin>>y>>k>>n ;
     int i;

     if(n<y)
     {
         cout<<-1 ;
         return 0 ;
     }
     else{
      for (int i=1;i<=n/k;i++)
           {
            x=k*i-y;
            if (x>=1){
      cout <<x<<endl;}

      }}
return 0;
}


#include<bits/stdc++.h>
using namespace std ;
#define Fors(n) for(int i=1;i<=n;i++)
#define For(n) for(i=0;i<n;i++)
#define ll long long
#define vint(s) vector<int> s
#define pb(x)  push_back(x)
#define mpair(x,y) make_pair(x,y)
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

ll x=0,y=0,n=0,i=0;

int main() {

	ll k,b=0;
	cin>>y>>k>>n;
	if(y>=n){

		cout<<"-1"<<endl;
return 0;
	}
	else{
                ll  d = (y/k +1)*k - y;

               // cout << " :: "<<d << endl;
		for(i=k;i<= n ;i+=k){
			if(y<i){
				cout<<(i-y)<<" ";
				b = 1;
			}

		}
	}
	if (b == 0){
		cout << -1<< endl;
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main() {
	int i,x=0,n=0,y=0,k=0;
	cin>>y>>k>>n;
	if(y==n){
		cout<<"-1"<<endl;
	}
	else{
                ll  d = k-y;
                if (d < 0){ll g = 1;
                     d = max(y%k,g);

                }
		for(i=d;i<= n-y ;i+=k){
			//if( (i+y)%k == 0 ){
				cout<<i<<" ";
			//}
		}
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main() {
	int i,x=0,n=0,y=0,k=0;
	cin>>y>>k>>n;
	if(y==n){
		cout<<"-1"<<endl;
	}
	else{
		for(i=1;i<= n-y ;i++){
			if( (i+y)%k == 0 ){
				cout<<i<<" ";
			}
		}
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std ;
#define Fors(n) for(int i=1;i<=n;i++)
#define For(n) for(i=0;i<n;i++)
#define ll long long
#define vint(s) vector<int> s
#define pb(x)  push_back(x)
#define mpair(x,y) make_pair(x,y)
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

ll x=0,y=0,n=0,i=0;

int main() {

	ll k;
	cin>>y>>k>>n;
	if(y>=n){

		cout<<"-1"<<endl;
	}
	else{
                ll  d = (y/k +1)*k - y;

               // cout << " :: "<<d << endl;
		for(i=k;i<= n ;i+=k){
			if(y<i){
				cout<<(i-y)<<" ";
			}
		}
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std ;
#define Fors(n) for(int i=1;i<=n;i++)
#define For(n) for(i=0;i<n;i++)
#define ll long long
#define vint(s) vector<int> s
#define pb(x)  push_back(x)
#define mpair(x,y) make_pair(x,y)
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

ll x=0,y=0,n=0,i=0;

int main() {

	ll k;
	cin>>y>>k>>n;
	if(y>=n){

		cout<<"-1"<<endl;
	}
	else{
                ll  d = (y/k +1)*k - y;

               // cout << " :: "<<d << endl;
		for(i=d;i<= n-y ;i+=k){
			//if( (i+y)%k == 0 ){
				cout<<i<<" ";
			//}
		}
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std ;
#define Fors(n) for(int i=1;i<=n;i++)
#define For(n) for(i=0;i<n;i++)
#define ll long long
#define vint(s) vector<int> s
#define pb(x)  push_back(x)
#define mpair(x,y) make_pair(x,y)
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

ll x=0,y=0,n=0,i=0;

int main() {

	ll k,b=0;
	cin>>y>>k>>n;
	if(y>=n){

		cout<<"-1"<<endl;
	}
	else{
                ll  d = (y/k +1)*k - y;

               // cout << " :: "<<d << endl;
		for(i=k;i<= n ;i+=k){
			if(y<i){
				cout<<(i-y)<<" ";
				b = 1;
			}

		}
	}
	if (b == 0){
		cout << -1<< endl;
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std ;
#define Fors(n) for(int i=1;i<=n;i++)
#define For(n) for(i=0;i<n;i++)
#define ll long long
#define vint(s) vector<int> s
#define pb(x)  push_back(x)
#define mpair(x,y) make_pair(x,y)
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

ll x=0,y=0,n=0,i=0;

int main() {

	ll k;
	cin>>y>>k>>n;
	if(y==n){

		cout<<"-1"<<endl;
	}
	else{
                ll  d = (y/k +1)*k - y;

               // cout << " :: "<<d << endl;
		for(i=d;i<= n-y ;i+=k){
			//if( (i+y)%k == 0 ){
				cout<<i<<" ";
			//}
		}
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main() {
	int i,x=0,n=0,y=0,k=0;
	cin>>y>>k>>n;
	if(y==n){
		cout<<"-1"<<endl;
	}
	else{
		for(i=0;i< n-y ;i++){
			if( (i+y)%k == 0 ){
				cout<<i<<" ";
			}
		}
	}
	return 0;
}


//  https://codeforces.com/contest/239/problem/A

#include<bits/stdc++.h>
using namespace std ;
#define Fors(n) for(int i=1;i<=n;i++)
#define For(n) for(i=0;i<n;i++)
#define ll long long
#define vint(s) vector<int> s
#define pb(x)  push_back(x)
#define mpair(x,y) make_pair(x,y)
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

ll x=0,y=0,n=0,i=0;

int main() {

	ll k,b = 0;
	cin>>y>>k>>n;
	if(y>=n){

		cout<<"-1"<<endl;
		return 0;
	}
	else{
                ll  d = (y/k +1)*k - y;

               // cout << " :: "<<d << endl;
		for(i=d;i<= n-y ;i+=k){
			//if( (i+y)%k == 0 ){
				cout<<i<<" ";
				b = 1;
			//}
		}
	}
	if (b == 0){
		cout << -1<< endl;
	}
	return 0;
}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main(){
ll y,k,n;
cin>>y>>k>>n;ll count=0;ll flag=0;ll i;
if(k==n && y<n){
    cout<<k-y;
}
else if(y==k && n==2*k){
    cout<<y;
}
else if(k>n){
    cout<<-1;
}

else if(k>(y+n)/2){
        for(i=n;i>=y+1;i--){
                if(i%k==0){

             count+=1;
             cout<<i-y;
          break;
        }
    }}
else{
         if(k>y && n>k){
                 count+=1;
    i=k;
}
else{
for( i=y+1;i<=n;i++){
	if(i%k==0 && flag==0){
            flag=1;
          count+=1;
          break;
	}
}}
ll h=i;
if(count>0 ){
    while(h<=n){
        cout<<h-y<<" ";
        h=h+k;
    }
}}
if(count==0){
	cout<<-1;
}
}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main(){
ll y,k,n;
cin>>y>>k>>n;ll count=0;ll flag=0;ll i;
if(k==n && y<n){
    cout<<k-y;
}
else if(y==k && n==2*k){
    cout<<y;
}
else if(k>n){
    cout<<-1;
}

else if(k>(y+n)/2){
        for(i=n;i>=y+1;i--){
                if(i%k==0){

             count+=1;
             cout<<i-y;
          break;
        }
    }}
else{
         if(k>y && n>k){
                 count+=1;
    i=k;
}
else{
for( i=y+1;i<=n;i++){
	if(i%k==0 && flag==0){
            flag=1;
          count+=1;
          break;
	}
}}
ll h=i;
if(count>0 ){
    while(h<=n){
        cout<<h-y<<" ";
        h=h+k;
    }
}
if(count==0){
	cout<<-1;
}
}
}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main(){
int y,k,n;
cin>>y>>k>>n;int count=0;int flag=0;int i;
if(k==n){
    cout<<k-y;
}
else if(y==k && n==2*k){
    cout<<y;
}
else{
    if(k>(y+n)/2){
        for(i=n;i>=y+1;i--){
                if(i%k==0){

             count+=1;
             cout<<i-y;
          break;
        }
    }}
else{
for( i=y+1;i<=n;i++){
	if(i%k==0 && flag==0){
            flag=1;
          count+=1;
          break;
	}
}
int h=i;
if(count>0 ){
    while(h<=n){
        cout<<h-y<<" ";
        h=h+k;
    }
}}
if(count==0){
	cout<<-1;
}
}

}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main(){
ll y,k,n;
cin>>y>>k>>n;ll count=0;ll flag=0;ll i;
if(k==n && y<n){
    cout<<k-y;
}
else if(y==k && n==2*k){
    cout<<y;
}
else if(k>n){
    cout<<-1;
}

else if(k>(y+n)/2){
        for(i=n;i>=y+1;i--){
                if(i%k==0){

             count+=1;
             cout<<i-y;
          break;
        }
    }}
else{
         if(k>y && n>k){
                 count+=1;
    i=k;
}
else{
        if(k< y && n>k){
            ll b=y%k;
            i=y+k-b;
             count+=1;
        }
}
ll h=i;
if(count>0 ){
    while(h<=n){
            flag=1;
        cout<<h-y<<" ";
        h=h+k;
    }
    if(flag==0){
        count=0;
    }
}
if(count==0){
	cout<<-1;
}
}
}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main(){
ll y,k,n;
cin>>y>>k>>n;ll count=0;ll flag=0;ll i;
for( i=y+1;i<=n;i++){
	if(i%k==0 && flag==0){
            flag=1;
          count+=1;
          break;
	}
}
ll h=i;
if(count>0 ){
    while(h<=n){
        cout<<h-y<<" ";
        h=h+k;
    }
}
if(count==0){
	cout<<-1;
}

}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main(){
ll y,k,n;
cin>>y>>k>>n;ll count=0;
for(ll i=y+1;i<n;i++){
	if(i%k==0){
		cout<<i-y<<" ";
          count+=1;
	}
}

if(count==0){
	cout<<-1;
}

}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main(){
ll y,k,n;
cin>>y>>k>>n;ll count=0;ll flag=0;ll i;
if(k==n && y<n){
    cout<<k-y;
}
else if(y==k && n==2*k){
    cout<<y;
}
else if(k>n){
    cout<<-1;
}

else if(k>(y+n)/2){
        for(i=n;i>=y+1;i--){
                if(i%k==0){

             count+=1;
             cout<<i-y;
          break;
        }
    }}
else{
         if(k>y && n>k){
                 count+=1;
    i=k;
}
else{
        if(k< y && n>k){
            ll b=y%k;
            i=y+k-b;
             count+=1;
        }
}
ll h=i;
if(count>0 ){
    while(h<=n){
        cout<<h-y<<" ";
        h=h+k;
    }
}
if(count==0){
	cout<<-1;
}
}
}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main(){
ll y,k,n;
cin>>y>>k>>n;ll count=0;ll flag=0;ll i;
if(k==n && y<n){
    cout<<k-y;
}
else if(y==k && n==2*k){
    cout<<y;
}
else if(k>n){
    cout<<-1;
}
else{
    if(k>(y+n)/2){
        for(i=n;i>=y+1;i--){
                if(i%k==0){

             count+=1;
             cout<<i-y;
          break;
        }
    }}
else{
for( i=y+1;i<=n;i++){
	if(i%k==0 && flag==0){
            flag=1;
          count+=1;
          break;
	}
}
ll h=i;
if(count>0 ){
    while(h<=n){
        cout<<h-y<<" ";
        h=h+k;
    }
}}
if(count==0){
	cout<<-1;
}
}

}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main(){
int y,k,n;
cin>>y>>k>>n;int count=0;int flag=0;int i;
if(k==n){
    cout<<k-y;
}
else{
for( i=y+1;i<=n;i++){
	if(i%k==0 && flag==0){
            flag=1;
          count+=1;
          break;
	}
}
int h=i;
if(count>0 ){
    while(h<=n){
        cout<<h-y<<" ";
        h=h+k;
    }
}
if(count==0){
	cout<<-1;
}
}

}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main(){
int y,k,n;
cin>>y>>k>>n;int count=0;int flag=0;int i;
if(k==n){
    cout<<k-y;
}
else if(y==k && n==2*k){
    cout<<y;
}
else if(k>n){
    cout<<-1;
}
else{
    if(k>(y+n)/2){
        for(i=n;i>=y+1;i--){
                if(i%k==0){

             count+=1;
             cout<<i-y;
          break;
        }
    }}
else{
for( i=y+1;i<=n;i++){
	if(i%k==0 && flag==0){
            flag=1;
          count+=1;
          break;
	}
}
int h=i;
if(count>0 ){
    while(h<=n){
        cout<<h-y<<" ";
        h=h+k;
    }
}}
if(count==0){
	cout<<-1;
}
}

}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main(){
int y,k,n;
cin>>y>>k>>n;int count=0;
for(int i=y+1;i<=n;i++){
	if(i%k==0){
		cout<<i-y<<" ";
          count+=1;
	}
}

if(count==0){
	cout<<-1;
}

}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main(){
int y,k,n;
cin>>y>>k>>n;int count=0;int flag=0;int i;
if(k==n){
    cout<<k-y;
}
else{
    if(k>(y+n)/2){
        for(i=n;i>y+1;i--){
                if(i%k==0){

             count+=1;
             cout<<i-y;
          break;
        }
    }}
else{
for( i=y+1;i<=n;i++){
	if(i%k==0 && flag==0){
            flag=1;
          count+=1;
          break;
	}
}
int h=i;
if(count>0 ){
    while(h<=n){
        cout<<h-y<<" ";
        h=h+k;
    }
}}
if(count==0){
	cout<<-1;
}
}

}


#include <iostream>
#include <stdio.h>

using namespace std;

int main()
{
int y,k,n,x=0; cin>>y>>k>>n;
bool f=false;
if(n-y>=k)
{
    while((x+y)%k!=0)
        x++;
    for(int i=x;i<=n-y;i+=k)
    if((i+y)%k==0)
    {
        f=true;
        cout<<i<<" ";
    }
}
if (f==false) cout<<-1;
return 0;
}


#include <iostream>
#include <stdio.h>

using namespace std;

int main()
{
int y,k,n,x=1; cin>>y>>k>>n;
bool f=false;
if(n-y>=k)
{
    while((x+y)%k!=0)
        x++;
    for(int i=x;i<=n-y;i+=k)
    if((i+y)%k==0)
    {
        f=true;
        cout<<i<<" ";
    }
}
    if(f==false and (2*y)%k==0 and n-y>=k)
    {
        f=true;
        cout<<y<<" ";
    }
if (f==false) cout<<-1;
return 0;
}


#include<iostream>
using namespace std;
int  main()
{
int y,k,n; cin>>y>>k>>n;
bool f=0;
for(int x= k- (y%k); x+y<=n;x+=k)
    {cout<<x<<" "; f=1;}
if (f==0) cout<<-1;
return 0;
}


#include <iostream>
#include <stdio.h>

using namespace std;

int main()
{
int y,k,n,x=1; cin>>y>>k>>n;
bool f=false;
if(n-y>=k)
{
    while((x+y)%k!=0)
        x++;
    for(int i=x;i<=n-y;i+=k)
    if((i+y)%k==0)
    {
        f=true;
        cout<<i<<" ";
    }
}
    if(f==false and (2*y)%k==0 and n>y)
    {
        f=true;
        cout<<y<<" ";
    }
if (f==false) cout<<-1;
return 0;
}


#include <iostream>
#include <stdio.h>

using namespace std;

int main()
{
int y,k,n,x=1; cin>>y>>k>>n;
bool f=false;
if(n-y>=k)
{
    while((x+y)%k!=0)
        x++;
    for(int i=x;i<=n-y+1;i+=k)
    if((i+y)%k==0)
    {
        f=true;
        cout<<i<<" ";
    }
}
    if(f==false and (2*y)%k==0 and n-y>=k)
    {
        f=true;
        cout<<y<<" ";
    }
if (f==false) cout<<-1;
return 0;
}


#include <iostream>
#include <stdio.h>

using namespace std;

int main()
{
int y,k,n,x=1; cin>>y>>k>>n;
bool f=false;
if(n-y>=k)
{
    while((x+y)%k!=0)
        x++;
    for(int i=x;i<=n-y+1;i+=k)
    if((i+y)%k==0)
    {
        f=true;
        cout<<i<<" ";
    }
}
    if(f==false and (2*y)%k==0)
    {
        f=true;
        cout<<y<<" ";
    }
if (f==false) cout<<-1;
return 0;
}


#include <iostream>
#include <stdio.h>

using namespace std;

int main()
{
int y,k,n,x=1; cin>>y>>k>>n;
bool f=false;
if(n-y>=k)
{
    while((x+y)%k!=0)
        x++;
    for(int i=x;i<=n-y;i+=k)
    if((i+y)%k==0)
    {
        f=true;
        cout<<i<<" ";
    }
}
if (f==false) cout<<-1;
return 0;
}


#include <iostream>
#include <stdio.h>

using namespace std;

int main() {
char c;
int y,k,n; cin>>y>>k>>n;
bool f=false;
for (int x=1; x+y<=n;x++)
  if ((x+y)%k==0) {f=true; cout<<x<<" ";}
if (f==false) cout<<-1;
return 0;
}


#include<bits/stdc++.h>
#define fast ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define all(v)     v.begin(),v.end()
using namespace std;
int main()
{
fast;
long y,k,n;
int count=0;
cin>>y>>k>>n;
if(k-y>0)
{
 for(long x=k-y;x<=(n-y);x+=k)
{
if((x+y)%k==0)
{
count++;
cout<<x<<" ";
}
}
}
else
{
for(long x=1;x<=(n-y);)
{
if((x+y)%k==0)
{
count++;
cout<<x<<" ";
x+=k;
}
else
x++;
}
}
if(count==0)
cout<<"-1";
return 0;
}


#include<bits/stdc++.h>
#define fast ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define all(v)     v.begin(),v.end()
using namespace std;
int main()
{
fast;
long y,k,n;
int count=0;
cin>>y>>k>>n;
if(k-y>=0)
{
 for(long x=k-y;x<=(n-y);x+=k)
{
if((x+y)%k==0 && x!=0)
{
count++;
cout<<x<<" ";
}
}
}
else
{
for(long x=1;x<=(n-y);)
{
if((x+y)%k==0)
{
count++;
cout<<x<<" ";
x+=k;
}
else
x++;
}
}
if(count==0)
cout<<"-1";
return 0;
}


#include<bits/stdc++.h>
#define fast ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define all(v)     v.begin(),v.end()
using namespace std;
int main()
{
fast;
long y,k,n;
int count=0;
cin>>y>>k>>n;
for(long x=1;x<=(n-y);x++)
{
if((x+y)%k==0)
{
count++;
cout<<x<<" ";
}
}
if(count==0)
cout<<"-1";
return 0;
}


#include<bits/stdc++.h>
#define fast ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define all(v)     v.begin(),v.end()
using namespace std;
int main()
{
fast;
long y,k,n;
int count=0;
cin>>y>>k>>n;
if(k-y>=0)
{
 for(long x=k-y;x<=(n-y);x+=k)
{
if((x+y)%k==0)
{
count++;
cout<<x<<" ";
}
}
}
else
{
for(long x=1;x<=(n-y);)
{
if((x+y)%k==0)
{
count++;
cout<<x<<" ";
x+=k;
}
else
x++;
}
}
if(count==0)
cout<<"-1";
return 0;
}


#include<bits/stdc++.h>
#define fast ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define all(v)     v.begin(),v.end()
using namespace std;
int main()
{
fast;
long y,k,n;
int count=0;
cin>>y>>k>>n;
if(k-y>0)
{
 for(long x=k-y;x<=(n-y);x+=k)
{
if((x+y)%k==0)
{
count++;
cout<<x<<" ";
}
}
}
else
{
for(long x=1;x<=(n-y);x++)
{
if((x+y)%k==0)
{
count++;
cout<<x<<" ";
}
}
}
if(count==0)
cout<<"-1";
return 0;
}


#include<bits/stdc++.h>
#define fast ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define all(v)     v.begin(),v.end()
using namespace std;
int main()
{
fast;
long y,k,n;
int count=0;
cin>>y>>k>>n;
if(k-y>=0)
{
 for(long x=k-y;x<=(n-y);x+=k)
{
if((x+y)%k==0 && x!=0)
{
count++;
cout<<x<<" ";
}
}
}
else
{
    if((2*k-y)>0)
    {
for(long x=(2*k-y);x<=(n-y);)
{
if((x+y)%k==0)
{
count++;
cout<<x<<" ";
x+=k;
}
}
}
else if((3*k-y)>0)
{
for(long x=(3*k-y);x<=(n-y);)
{
if((x+y)%k==0)
{
count++;
cout<<x<<" ";
x+=k;
}
}
}
}
if(count==0)
cout<<"-1";
return 0;
}


#include<bits/stdc++.h>
#define fast ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define all(v)     v.begin(),v.end()
using namespace std;
int main()
{
fast;
long y,k,n;
int count=0;
cin>>y>>k>>n;
if(k-y>=0)
{
 for(long x=k-y;x<=(n-y);x+=k)
{
if((x+y)%k==0 && x!=0)
{
count++;
cout<<x<<" ";
}
}
}
else
{
for(long x=(k-y);x<=(n-y);x+=k)
{
if(x>0)
{
if((x+y)%k==0)
{
count++;
cout<<x<<" ";
}
}
}
}

if(count==0)
cout<<"-1";
return 0;
}


#include<bits/stdc++.h>
#define fast ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define all(v)     v.begin(),v.end()
using namespace std;
int main()
{
fast;
long y,k,n;
int count=0;
cin>>y>>k>>n;
if(k-y>0)
{
 for(long x=k-y;x<=(n-y);x++)
{
if((x+y)%k==0)
{
count++;
cout<<x<<" ";
}
}
}
else
{
for(long x=1;x<=(n-y);x++)
{
if((x+y)%k==0)
{
count++;
cout<<x<<" ";
}
}
}
if(count==0)
cout<<"-1";
return 0;
}


#include<bits/stdc++.h>
#define fast ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define all(v)     v.begin(),v.end()
using namespace std;
int main()
{
fast;
long y,k,n;
int count=0;
cin>>y>>k>>n;
if(k-y>0)
{
 for(long x=k-y;x<=(n-y);x+=k)
{
if((x+y)%k==0)
{
count++;
cout<<x<<" ";
}
}
}
else
{
for(long x=1;x<=(n-y);x+=k)
{
if((x+y)%k==0)
{
count++;
cout<<x<<" ";
}
}
}
if(count==0)
cout<<"-1";
return 0;
}


#include <iostream>
using namespace std;

int main() {
	int y,k,n,x,c=0;
	cin>>y>>k>>n;
	for(int i=y;i<n;i++)
	{
	    c=5;
	    if(i%k==0)
	    cout<<i-y<<" ";
	}
	if(c==5)
	cout<<endl;
	if(y==n)
	cout<<"-1"<<endl;
	return 0;
}


#include <iostream>
using namespace std;

int main() {
long int y,k,n,x,c=0;
	cin>>y>>k>>n;
	if(y==n)
	cout<<"-1\n";
	else
	{
	int i=y;
	while(i%k!=0)
	{
	    c++;
	    i++;
	}
	for(i=c;i<=n-y;i=i+k)
	{
	    cout<<i<<" ";
	}
	cout<<endl;
	}
	return 0;
}


 #include <iostream>
using namespace std;

int main() {
long int y,k,n,x,c=0,i,p=0;
	cin>>y>>k>>n;
	if(k<=n)
	{
	    if(y<k)
	    {
	        if(k-y<=n)
	        {
	    c=k-y;
	        }
	    }
	    else
	    {
	i=y;
	if(i%k==0)
	c=1;
	else
	c=0;
	while(i%k!=0)
	{
	    c++;
	    i++;
	}
	    }
	    if(c+k<=n-y)
	    {
	for(i=c;i<=n-y;i=i+k)
	{
	    p=5;
	    cout<<i<<" ";
	}
	    }
	if(p==5)
	cout<<endl;
	}
	if(p!=5)
	cout<<"-1\n";
	return 0;
}


#include <iostream>
using namespace std;

int main() {
long int y,k,n,x,c=0;
	cin>>y>>k>>n;
	for(int i=y+1;i<=n;i++)
	{
	    c=5;
	    if(i%k==0)
	    cout<<i-y<<" ";
	}
	if(c==5)
	cout<<endl;
	if(y==n)
	cout<<"-1"<<endl;
	return 0;
}


 #include<iostream>
 using namespace std;
 int main()
 {
     long y,k,n,i,c=0,p=0;
     cin>>y>>k>>n;
     if(y<n)
     {
     p=y;
     c=p%k;
     p=p+(k-c);
     c=0;
     for(i=p;i<=n;i=i+k)
     {
         if(i-y!=0)
         {
         cout<<i-y<<" ";
         c=5;
         }
     }
     if(c==5)
     cout<<endl;
     }
     if(c!=5)
     cout<<"-1\n";
 }


#include <iostream>
using namespace std;

int main() {
long int y,k,n,x,c=1;
	cin>>y>>k>>n;
	if(y>=n)
	cout<<"-1\n";
	else if(y>k)
	{
	    cout<<n-y<<endl;
	}
	else
	{
	int i=y;
	if(i%k==0)
	c=1;
	else
	c=0;
	while(i%k!=0)
	{
	    c++;
	    i++;
	}
	for(i=c;i<=n-y;i=i+k)
	{
	    cout<<i<<" ";
	}
	cout<<endl;
	}
	return 0;
}


#include <iostream>
using namespace std;

int main() {
long int y,k,n,x,c=0,i,p=0;
	cin>>y>>k>>n;
	if(k<=n)
	{
	    if(y<k)
	    {
	        if(k-y<=n)
	        {
	        p=5;
	    cout<<k-y<<" ";
	    i=k-y;
	    c=i+k;
	        }
	    }
	    else
	    {
	i=y;
	if(i%k==0)
	c=1;
	else
	c=0;
	while(i%k!=0)
	{
	    c++;
	    i++;
	}
	    }
	for(i=c;i<=n-y;i=i+k)
	{
	    p=5;
	    cout<<i<<" ";
	}
	if(p==5)
	cout<<endl;
	}
	if(p!=5)
	cout<<"-1\n";
	return 0;
}


#include <iostream>
using namespace std;

int main() {
long int y,k,n,x,c=0,i,p=0;
	cin>>y>>k>>n;
	if(k<n)
	{
	    if(y<k)
	    {
	        if(k-y<=n)
	        {
	        p=5;
	    cout<<k-y<<" ";
	    i=k-y;
	    c=i+k;
	        }
	    }
	    else
	    {
	i=y;
	if(i%k==0)
	c=1;
	else
	c=0;
	while(i%k!=0)
	{
	    c++;
	    i++;
	}
	    }
	for(i=c;i<=n-y;i=i+k)
	{
	    p=5;
	    cout<<i<<" ";
	}
	if(p==5)
	cout<<endl;
	}
	if(p!=5)
	cout<<"-1\n";
	return 0;
}


#include <iostream>
using namespace std;

int main() {
long int y,k,n,x,c=0,i,p=0;
	cin>>y>>k>>n;
	if(k<=n)
	{
	    if(y<k)
	    {
	        if(k-y<=n)
	        {
	        p=5;
	    cout<<k-y<<" ";
	    i=k-y;
	    c=i+k;
	        }
	    }
	    else
	    {
	i=y;
	if(i%k==0)
	c=1;
	else
	c=0;
	while(i%k!=0)
	{
	    c++;
	    i++;
	}
	    }
	    if(c+y<=n)
	    {
	for(i=c;i<=n-y;i=i+k)
	{
	    p=5;
	    cout<<i<<" ";
	}
	    }
	if(p==5)
	cout<<endl;
	}
	if(p!=5)
	cout<<"-1\n";
	return 0;
}


#include <iostream>
using namespace std;

int main() {
long int y,k,n,x,c=1,i,p=0;
	cin>>y>>k>>n;
	if(y<n)
	{
	    if(y<k)
	    {
	        if(k-y<=n)
	        {
	        p=5;
	    cout<<k-y<<" ";
	    i=k-y;
	    c=i+k;
	        }
	    }
	    else
	    {
	i=y;
	if(i%k==0)
	c=1;
	else
	c=0;
	while(i%k!=0)
	{
	    c++;
	    i++;
	}
	    }
	for(i=c;i<=n-y;i=i+k)
	{
	    p=5;
	    cout<<i<<" ";
	}
	if(p==5)
	cout<<endl;
	}
	if(p!=5)
	cout<<"-1\n";
	return 0;
}


 #include<iostream>
 using namespace std;
 int main()
 {
     long y,k,n,i,c=0,p=0;
     cin>>y>>k>>n;
     if(y<n)
     {
     p=y;
     while(p%k!=0)
     {
         p++;
     }
     for(i=p;i<=n;i=i+k)
     {
         if(i-y!=0)
         {
         cout<<i-y<<" ";
         c=5;
         }
     }
     if(c==5)
     cout<<endl;
     }
     if(c!=5)
     cout<<"-1\n";
 }


#include <iostream>
using namespace std;

int main() {
long int y,k,n,x,c=1;
	cin>>y>>k>>n;
	if(y>=n)
	cout<<"-1\n";
	else if(y<k)
	{
	    cout<<n-y<<endl;
	}
	else
	{
	int i=y;
	if(i%k==0)
	c=1;
	else
	c=0;
	while(i%k!=0)
	{
	    c++;
	    i++;
	}
	for(i=c;i<=n-y;i=i+k)
	{
	    cout<<i<<" ";
	}
	cout<<endl;
	}
	return 0;
}


#include <iostream>
using namespace std;

int main() {
long int y,k,n,x,c=1,i,p=0;
	cin>>y>>k>>n;
	if(y<n)
	{
	    if(y<k)
	    {
	    cout<<k-y<<" ";
	    i=k-y;
	    c=i+k;
	    }
	    else
	    {
	i=y;
	if(i%k==0)
	c=1;
	else
	c=0;
	while(i%k!=0)
	{
	    c++;
	    i++;
	}
	    }
	for(i=c;i<=n-y;i=i+k)
	{
	    p=5;
	    cout<<i<<" ";
	}
	if(p==5)
	cout<<endl;
	}
	if(p!=5)
	cout<<"-1\n";
	return 0;
}


#include <iostream>
using namespace std;

int main() {
long int y,k,n,x,c=1;
	cin>>y>>k>>n;
	if(y==n)
	cout<<"-1\n";
	else
	{
	int i=y;
	if(i%k==0)
	c=1;
	else
	c=0;
	while(i%k!=0)
	{
	    c++;
	    i++;
	}
	for(i=c;i<=n-y;i=i+k)
	{
	    cout<<i<<" ";
	}
	cout<<endl;
	}
	return 0;
}


 #include <iostream>
using namespace std;

int main() {
long int y,k,n,x,c=0,i,p=0;
	cin>>y>>k>>n;
	if(k<=n)
	{
	    if(y<k)
	    {
	        if(k-y<=n)
	        {
	        p=5;
	    cout<<k-y<<" ";
	    i=k-y;
	    c=i+k;
	        }
	    }
	    else
	    {
	i=y;
	if(i%k==0)
	c=1;
	else
	c=0;
	while(i%k!=0)
	{
	    c++;
	    i++;
	}
	    }
	    if(c+k<=n)
	    {
	for(i=c;i<=n-y;i=i+k)
	{
	    p=5;
	    cout<<i<<" ";
	}
	    }
	if(p==5)
	cout<<endl;
	}
	if(p!=5)
	cout<<"-1\n";
	return 0;
}


#include <iostream>
using namespace std;

int main() {
long int y,k,n,x,c=1;
	cin>>y>>k>>n;
	if(y>=n)
	cout<<"-1\n";
	else
	{
	int i=y;
	if(i%k==0)
	c=1;
	else
	c=0;
	while(i%k!=0)
	{
	    c++;
	    i++;
	}
	for(i=c;i<=n-y;i=i+k)
	{
	    cout<<i<<" ";
	}
	cout<<endl;
	}
	return 0;
}


#include <iostream>
using namespace std;

int main() {
long int y,k,n,x,c=0,i,p=0;
	cin>>y>>k>>n;
	if(k<=n)
	{
	    if(y<k)
	    {
	        if(k-y<=n)
	        {
	        p=5;
	    cout<<k-y<<" ";
	    i=k-y;
	    c=i+k;
	        }
	    }
	    else
	    {
	i=y;
	if(i%k==0)
	c=1;
	else
	c=0;
	while(i%k!=0)
	{
	    c++;
	    i++;
	}
	    }
	    if(c+y+k<=n)
	    {
	for(i=c;i<=n-y;i=i+k)
	{
	    p=5;
	    cout<<i<<" ";
	}
	    }
	if(p==5)
	cout<<endl;
	}
	if(p!=5)
	cout<<"-1\n";
	return 0;
}