#include <bits/stdc++.h>
using namespace std;
const int LEN = (int)1e5 + 1;
int n, q;
int a[LEN];
struct SegTree {
  int val;
  SegTree *lc, *rc;
  SegTree(int l = 0, int r = LEN) : val(-1), lc(nullptr), rc(nullptr) {
    if (l == r) {
      val = 0;
      return;
    }
    int mid = (l + r) >> 1;
    lc = new SegTree(l, mid);
    rc = new SegTree(mid + 1, r);
  }
  int flip(int val) {
    if (val < 2) return !val;
    return (((val & 1) + 1) & 1) + 2;
  }
  void push() {
    if (val != -1) {
      lc->val = val;
      rc->val = val;
      val = -1;
    }
  }
  void reverse(int L, int R, int l = 0, int r = LEN) {
    if (l == L && r == R && val != -1) {
      val = flip(val);
      return;
    }
    push();
    int mid = (l + r) >> 1;
    if (L <= mid) lc->reverse(L, min(R, mid), l, mid);
    if (R > mid) rc->reverse(max(L, mid + 1), R, mid + 1, r);
    if (lc->val == rc->val) val = lc->val;
  }
  void change(int to, int L, int R, int l = 0, int r = LEN) {
    if (l == L && r == R) {
      val = to;
      return;
    }
    push();
    int mid = (l + r) >> 1;
    if (L <= mid) lc->change(to, L, min(R, mid), l, mid);
    if (R > mid) rc->change(to, max(L, mid + 1), R, mid + 1, r);
    if (lc->val == rc->val) val = lc->val;
  }
  int get(int pos, int l = 0, int r = LEN) {
    if (val != -1) return val;
    int mid = (l + r) >> 1;
    if (pos <= mid) return lc->get(pos, l, mid);
    return rc->get(pos, mid + 1, r);
  }
} t;
int solve(int x) {
  int ret = t.get(abs(x));
  if (ret == 1)
    x = -x;
  else if (ret == 2)
    x = abs(x);
  else if (ret == 3)
    x = -abs(x);
  return x;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  t.val = 0;
  cin >> n >> q;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < q; i++) {
    char s;
    int x;
    cin >> s >> x;
    if (s == '<') {
      if (x > 0) {
        t.reverse(0, x - 1);
        t.change(2, x, LEN);
      } else {
        t.change(2, abs(x) + 1, LEN);
      }
    } else {
      if (x > 0) {
        t.change(3, x + 1, LEN);
      } else {
        t.reverse(0, abs(x));
        t.change(3, abs(x), LEN);
      }
    }
  }
  for (int i = 0; i < n; i++) cout << solve(a[i]) << " ";
  return 0;
}
