#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 5;
long long n, q, k = 1e5, m = k * 2 + 1, a[N], x, cov[N << 2], rev[N << 2],
                ans[N];
char c;
long long get(long long x) { return x + k + 1; }
void pushdown(long long p) {
  if (cov[p] != 0)
    cov[p << 1] = cov[p << 1 | 1] = cov[p], cov[p] = 0,
             rev[p << 1] = rev[p << 1 | 1] = 0;
  if (rev[p]) rev[p << 1] ^= 1, rev[p << 1 | 1] ^= 1, rev[p] = 0;
}
void modify_rev(long long p, long long l, long long r, long long lx,
                long long rx) {
  if (l >= lx && r <= rx) {
    rev[p] ^= 1;
    return;
  }
  long long mid = (l + r) / 2;
  pushdown(p);
  if (lx <= mid) modify_rev(p << 1, l, mid, lx, rx);
  if (rx > mid) modify_rev(p << 1 | 1, mid + 1, r, lx, rx);
}
void modify_cov(long long p, long long l, long long r, long long lx,
                long long rx, long long v) {
  if (l >= lx && r <= rx) {
    rev[p] = 0, cov[p] = v;
    return;
  }
  long long mid = (l + r) / 2;
  pushdown(p);
  if (lx <= mid) modify_cov(p << 1, l, mid, lx, rx, v);
  if (rx > mid) modify_cov(p << 1 | 1, mid + 1, r, lx, rx, v);
}
void getans(long long p, long long l, long long r) {
  if (l == r) {
    if (cov[p] != 0)
      ans[l] = cov[p] * abs(l - k - 1);
    else
      ans[l] = l - k - 1;
    if (rev[p]) ans[l] = -ans[l];
    return;
  }
  long long mid = (l + r) / 2;
  pushdown(p);
  getans(p << 1, l, mid);
  getans(p << 1 | 1, mid + 1, r);
}
signed main() {
  scanf("%lld%lld", &n, &q);
  for (long long i = 1; i <= n; i++) scanf("%lld", &a[i]);
  while (q--) {
    scanf(" %c%lld", &c, &x);
    if (c == '>') {
      if (x >= k) continue;
      if (x >= 0)
        modify_cov(1, 1, m, get(x + 1), get(k), -1),
            modify_cov(1, 1, m, get(-k), get(-x - 1), -1);
      else {
        modify_rev(1, 1, m, get(x + 1), get(-x - 1));
        modify_cov(1, 1, m, get(-x), get(k), -1),
            modify_cov(1, 1, m, get(-k), get(x), -1);
      }
    } else {
      if (x <= -k) continue;
      if (x <= 0)
        modify_cov(1, 1, m, get(-k), get(x - 1), 1),
            modify_cov(1, 1, m, get(-x + 1), get(k), 1);
      else {
        modify_rev(1, 1, m, get(-x + 1), get(x - 1));
        modify_cov(1, 1, m, get(x), get(k), 1),
            modify_cov(1, 1, m, get(-k), get(-x), 1);
      }
    }
  }
  getans(1, 1, m);
  for (long long i = 1; i <= n; i++)
    printf("%lld%c", ans[get(a[i])], i == n ? '\n' : ' ');
  return 0;
}
