#include <bits/stdc++.h>
using namespace std;
const int N = 100000;
const double pi = acos(-1.0);
int n, q, a[100100], seg[1700000], rev[1700000], tag[1700000];
char s[10];
int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while ((ch < '0') || (ch > '9')) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while ((ch >= '0') && (ch <= '9')) {
    x = x * 10 + (ch - '0');
    ch = getchar();
  }
  return x * f;
}
void pushdown(int id, int l, int r) {
  if (tag[id] != -1) {
    seg[id << 1] = tag[id];
    seg[id << 1 | 1] = tag[id];
    tag[id << 1] = tag[id];
    tag[id << 1 | 1] = tag[id];
    rev[id << 1] = 0;
    rev[id << 1 | 1] = 0;
    tag[id] = -1;
  }
  if (rev[id]) {
    rev[id << 1] ^= 1;
    rev[id << 1 | 1] ^= 1;
    seg[id << 1] ^= 1;
    seg[id << 1 | 1] ^= 1;
    rev[id] = 0;
  }
}
void modify_val(int id, int l, int r, int ql, int qr, int val) {
  if (ql > qr) return;
  pushdown(id, l, r);
  if ((l >= ql) && (r <= qr)) {
    seg[id] = val;
    tag[id] = val;
    return;
  }
  int mid = (l + r) >> 1;
  if (ql <= mid) modify_val(id << 1, l, mid, ql, qr, val);
  if (qr > mid) modify_val(id << 1 | 1, mid + 1, r, ql, qr, val);
}
void modify_rev(int id, int l, int r, int ql, int qr) {
  if (ql > qr) return;
  pushdown(id, l, r);
  if ((l >= ql) && (r <= qr)) {
    seg[id] ^= 1;
    rev[id] = 1;
    return;
  }
  int mid = (l + r) >> 1;
  if (ql <= mid) modify_rev(id << 1, l, mid, ql, qr);
  if (qr > mid) modify_rev(id << 1 | 1, mid + 1, r, ql, qr);
}
int query(int id, int l, int r, int pos) {
  pushdown(id, l, r);
  if (l == r) return seg[id];
  int mid = (l + r) >> 1;
  if (pos <= mid)
    return query(id << 1, l, mid, pos);
  else
    return query(id << 1 | 1, mid + 1, r, pos);
}
int main() {
  n = read();
  q = read();
  for (int i = 1; i <= n; i++) a[i] = read();
  memset(tag, -1, sizeof(tag));
  while (q--) {
    scanf("%s", s);
    int x = read();
    if (s[0] == '>') {
      if (x >= 0) {
        modify_val(1, -N, N, x + 1, N, 1);
        modify_val(1, -N, N, -N, -x - 1, 0);
      } else {
        modify_val(1, -N, N, -x, N, 1);
        modify_val(1, -N, N, -N, x, 0);
        modify_rev(1, -N, N, x + 1, -x - 1);
      }
    } else {
      if (x <= 0) {
        modify_val(1, -N, N, -N, x - 1, 1);
        modify_val(1, -N, N, -x + 1, N, 0);
      } else {
        modify_val(1, -N, N, x, N, 0);
        modify_val(1, -N, N, -N, -x, 1);
        modify_rev(1, -N, N, -x + 1, x - 1);
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    if (query(1, -N, N, a[i])) a[i] *= -1;
    printf("%d ", a[i]);
  }
  return 0;
}
