#ifdef __LOCAL
#define _GLIBCXX_DEBUG
#endif
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int,int>;
using PIL = pair<int,ll>;
using PLI = pair<ll,int>;
using PLL = pair<ll,ll>;
using Graph = vector<vector<int>>;
using Cost_Graph = vector<vector<PIL>>;

template<class T> bool chmin(T &a, T b) {if(a>b){a=b;return 1;}return 0;}
template<class T> bool chmax(T &a, T b) {if(a<b){a=b;return 1;}return 0;}
template<class T> void show_vec(T v) {for (int i=0;i<v.size();i++) cout<<v[i]<<endl;}
template<class T> void show_pair(T p) {cout<<p.first<<" "<<p.second<<endl;}
#define REP(i,n) for(int i=0;i<int(n);i++)
#define ROUNDUP(a,b) ((a+b-1)/b)
#define YESNO(T) cout<<(T?"YES":"NO")<<endl
#define yesno(T) cout<<(T?"yes":"no")<<endl
#define YesNo(T) cout<<(T?"Yes":"No")<<endl

const int INFint = 1 << 29;
const ll INFLL = 1LL << 60;
const ll MOD = 1000000007LL;
const double pi = 3.14159265358979;



int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(15);

    int t;
    ll n;
    cin >> t >> n;

    vector<ll> bac(100 + t,0);
    for (int i = 0; i < 100; i++){
        bac[(100 + t) * i / 100]++;
    }
    vector<ll> ans;
    for (int i = 1; i < 100 + t; i++){
        if (bac[i] <= 0) ans.push_back(i);
    }

    // show_vec(ans);

    ll x = ans.size();
    ll r = 100 + t;
    n--;

    cout << ((n / x) * r) + ans[n % x] << endl;
}
#include<bits/stdc++.h>
using namespace std;

#define int         long long
#define ull         unsigned long long
#define ll          long long
#define M           998244353
#define pb          push_back
#define p_q         priority_queue
#define pii         pair<ll,ll>
#define vi          vector<ll>
#define vii         vector<pii>
#define mi          map<ll,ll>
#define mii         map<pii,ll>
#define all(a)      (a).begin(),(a).end()
#define sz(x)       (ll)x.size()
#define endl        '\n'
#define gcd(a,b)    __gcd((a),(b))
#define lcm(a,b)    ((a)*(b)) / gcd((a),(b))
#define ios         ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define mp          make_pair
#define lb          lower_bound
#define ub          upper_bound
#define F           first
#define S           second
#define rep(i, begin, end) for (int i=begin;i<end;i++)
#define repd(i, begin, end) for (int i=end-1;i>=begin;i--)
#define ini(a,n,b)  for(ll int i=0;i<n;i++) a[i]=0;
#define cset(a)     __builtin_popcountll(a)
#define hell        1000000007
#define re          resize
const int INF=1e18;
const int N=1e2+5;


int powm(int a,int b)
{
  int res=1;
  while(b)
  {
    if(b&1) 
    res=(res*a)%M;
      a=(a*a)%M;
      b>>=1;
  }
 
  return res;
}

int pow(int a,int b)
{
  int res=1;
  while(b)
  {
    if(b&1) 
    res=(res*a);
      a=(a*a);
      b>>=1;
  }
 
  return res;
}

vi a[N],vis(N,0),len(N,0);
set<pair<int,int> > s;

void dfs(int node,int par)
{
  vis[node]=1;
  for(auto j:a[node])
  {
    if(!vis[j])
    {
       len[j]=len[node]+1;
       s.insert({node,j});
       dfs(j,node);
    }
    else if(j!=par&&len[j]<len[node])
    {
       s.insert({node,j});
    }
  } 
}
signed main(void)
{ios
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);freopen("answer.txt", "w", stdout);
    #endif

    
    int n,m;
    cin>>n>>m;
    vi u(m),v(m);
    rep(i,0,m)
    {
       cin>>u[i]>>v[i];
    }

    vi c(n+1);
    rep(i,1,n+1) cin>>c[i];
    vi dir(m,0);
    rep(i,0,m)
    {
       if(c[u[i]]>c[v[i]])
       {
         dir[i]=1;
       }
       else if(c[v[i]]>c[u[i]])
       {
         dir[i]=0;
       }
       else 
       {

         a[u[i]].pb(v[i]);
         a[v[i]].pb(u[i]);
       }
    }

    rep(i,1,n+1)
    {
       if(!vis[i])
       {
         dfs(i,0);
       }
    }

    rep(i,0,m)
    {
       if(c[u[i]]==c[v[i]])
       {
         if(s.find({u[i],v[i]})!=s.end()) dir[i]=1;
         else dir[i]=0;
       }
    }

    rep(i,0,m)
    {
       if(dir[i]==1) cout<<"->"<<endl;
       else cout<<"<-"<<endl;
    }
    
      
    
    

  
}