#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline T read(register T& t) {
  register T f = 1;
  register char ch = getchar();
  t = 0;
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -f;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') t = t * 10 + ch - '0', ch = getchar();
  t *= f;
  return t;
}
template <typename T, typename... Args>
inline void read(T& t, Args&... args) {
  read(t);
  read(args...);
}
const long long p = 998244353;
inline long long power(register long long x, register long long k = p - 2) {
  register long long re = 1;
  for (; k; k >>= 1, x = x * x % p)
    if (k & 1) re = re * x % p;
  return re;
}
struct SGT {
  int lcs, rcs;
  int value;
  bool rever;
} v[400005];
int tot;
void build(int l, int r, int& p) {
  p = ++tot;
  v[p].value = 0;
  if (l == r) return v[p].value = 1, void();
  build(l, ((l + r) >> 1), v[p].lcs);
  build(((l + r) >> 1) + 1, r, v[p].rcs);
}
void push_down(int p) {
  if (v[p].rever) {
    v[v[p].lcs].rever ^= 1;
    v[v[p].rcs].rever ^= 1;
    v[v[p].lcs].value *= -1;
    v[v[p].rcs].value *= -1;
    v[p].rever = 0;
  }
  if (v[p].value) {
    v[v[p].lcs].rever = 0;
    v[v[p].rcs].rever = 0;
    v[v[p].lcs].value = v[p].value;
    v[v[p].rcs].value = v[p].value;
    v[p].value = 0;
  }
}
void revise(int l, int r, int p, int nl, int nr, int vals) {
  if (nl > nr) return;
  if (nl <= l && r <= nr) return v[p].rever = 0, v[p].value = vals, void();
  push_down(p);
  if (nl <= ((l + r) >> 1)) revise(l, ((l + r) >> 1), v[p].lcs, nl, nr, vals);
  if (((l + r) >> 1) + 1 <= nr)
    revise(((l + r) >> 1) + 1, r, v[p].rcs, nl, nr, vals);
}
void revise(int l, int r, int p, int nl, int nr) {
  if (nl > nr) return;
  if (nl <= l && r <= nr) return v[p].rever ^= 1, v[p].value *= -1, void();
  push_down(p);
  if (nl <= ((l + r) >> 1)) revise(l, ((l + r) >> 1), v[p].lcs, nl, nr);
  if (((l + r) >> 1) + 1 <= nr) revise(((l + r) >> 1) + 1, r, v[p].rcs, nl, nr);
}
int enquire(int l, int r, int p, int pos) {
  if (l == r) return v[p].value;
  push_down(p);
  if (pos <= ((l + r) >> 1)) return enquire(l, ((l + r) >> 1), v[p].lcs, pos);
  if (((l + r) >> 1) + 1 <= pos)
    return enquire(((l + r) >> 1) + 1, r, v[p].rcs, pos);
}
void solve(int x) {
  if (x >= 0) {
    revise(-1e5, 1e5, 1, -1e5, -x - 1, 1);
    revise(-1e5, 1e5, 1, x + 1, 1e5, -1);
  } else {
    revise(-1e5, 1e5, 1, x + 1, -x - 1);
    revise(-1e5, 1e5, 1, -1e5, x, 1);
    revise(-1e5, 1e5, 1, -x, 1e5, -1);
  }
}
void solve2(int x) {
  if (x <= 0) {
    revise(-1e5, 1e5, 1, -1e5, x - 1, -1);
    revise(-1e5, 1e5, 1, -x + 1, 1e5, 1);
  } else {
    revise(-1e5, 1e5, 1, -x + 1, x - 1);
    revise(-1e5, 1e5, 1, -1e5, -x, -1);
    revise(-1e5, 1e5, 1, x, 1e5, 1);
  }
}
int n, Q;
int a[100005];
int main() {
  read(n, Q);
  for (int i = 1; i <= n; i++) read(a[i]);
  int root;
  build(-1e5, 1e5, root);
  while (Q--) {
    char c[5];
    int x;
    scanf("%s", c);
    read(x);
    if (c[0] == '>')
      solve(x);
    else
      solve2(x);
  }
  for (int i = 1; i <= n; i++)
    printf("%d ", a[i] * enquire(-1e5, 1e5, 1, a[i]));
  return 0;
}
