#include <bits/stdc++.h>
using namespace std;
int n, q;
int a[200005];
int neg[200005 * 4], pos[200005 * 4];
bool lzp[200005 * 4], lzg[200005 * 4], lzs[200005 * 4];
void merge(int node) {
  neg[node] = neg[node << 1] + neg[node << 1 | 1];
  pos[node] = pos[node << 1] + pos[node << 1 | 1];
}
void makeswap(int node) {
  swap(neg[node], pos[node]);
  lzs[node] ^= 1;
}
void makepos(int node) {
  pos[node] += neg[node];
  neg[node] = 0;
  lzg[node] = lzs[node] = 0;
  lzp[node] = 1;
}
void makeneg(int node) {
  neg[node] += pos[node];
  pos[node] = 0;
  lzp[node] = lzs[node] = 0;
  lzg[node] = 1;
}
void push(int node) {
  if (lzp[node]) {
    makepos(node << 1);
    makepos(node << 1 | 1);
    lzp[node] = 0;
  }
  if (lzg[node]) {
    makeneg(node << 1);
    makeneg(node << 1 | 1);
    lzg[node] = 0;
  }
  if (lzs[node]) {
    makeswap(node << 1);
    makeswap(node << 1 | 1);
    lzs[node] = 0;
  }
}
int isneg(int node, int bas, int son, int x) {
  if (bas > x || son < x) return 0;
  if (bas == x && son == x) return neg[node];
  push(node);
  return isneg(node << 1, bas, ((bas + son) / 2), x) |
         isneg(node << 1 | 1, ((bas + son) / 2) + 1, son, x);
}
void swp(int node, int bas, int son, int x, int y) {
  if (bas > y || son < x) return;
  if (bas >= x && son <= y) {
    makeswap(node);
    return;
  }
  push(node);
  swp(node << 1, bas, ((bas + son) / 2), x, y);
  swp(node << 1 | 1, ((bas + son) / 2) + 1, son, x, y);
  merge(node);
}
void setpos(int node, int bas, int son, int x, int y) {
  if (bas > y || son < x) return;
  if (bas >= x && son <= y) {
    makepos(node);
    return;
  }
  push(node);
  setpos(node << 1, bas, ((bas + son) / 2), x, y);
  setpos(node << 1 | 1, ((bas + son) / 2) + 1, son, x, y);
  merge(node);
}
void setneg(int node, int bas, int son, int x, int y) {
  if (bas > y || son < x) return;
  if (bas >= x && son <= y) {
    makeneg(node);
    return;
  }
  push(node);
  setneg(node << 1, bas, ((bas + son) / 2), x, y);
  setneg(node << 1 | 1, ((bas + son) / 2) + 1, son, x, y);
  merge(node);
}
void build(int node, int bas, int son) {
  if (bas == son) {
    neg[node] = (bas - 100000 < 0);
    pos[node] = (bas - 100000 > 0);
    return;
  }
  build(node << 1, bas, ((bas + son) / 2));
  build(node << 1 | 1, ((bas + son) / 2) + 1, son);
  merge(node);
}
int main() {
  build(1, 0, 100000 << 1);
  scanf("%d %d", &n, &q);
  for (int i = 1; i <= n; i++) scanf("%d", a + i);
  while (q--) {
    char c;
    int x;
    scanf(" %c %d", &c, &x);
    if (x > 0) {
      if (c == '>') {
        setneg(1, 0, 100000 << 1, -100000 + 100000, -x - 1 + 100000);
        setneg(1, 0, 100000 << 1, x + 1 + 100000, 100000 + 100000);
      } else {
        swp(1, 0, 100000 << 1, -x + 1 + 100000, x - 1 + 100000);
        setpos(1, 0, 100000 << 1, -100000 + 100000, -x + 100000);
        setpos(1, 0, 100000 << 1, x + 100000, 100000 + 100000);
      }
    } else {
      if (c == '>') {
        swp(1, 0, 100000 << 1, x + 1 + 100000, -x - 1 + 100000);
        setneg(1, 0, 100000 << 1, -x + 100000, 100000 + 100000);
        setneg(1, 0, 100000 << 1, -100000 + 100000, x + 100000);
      } else {
        setpos(1, 0, 100000 << 1, -100000 + 100000, x - 1 + 100000);
        setpos(1, 0, 100000 << 1, -x + 1 + 100000, 100000 + 100000);
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    int ng = isneg(1, 0, 100000 << 1, a[i] + 100000);
    if (!ng)
      a[i] = abs(a[i]);
    else
      a[i] = (a[i] > 0 ? -a[i] : a[i]);
    printf("%d ", a[i]);
  }
}
