#include <bits/stdc++.h>
using ll = long long;
using ld = long double;
using namespace std;
const int N = 1e5 + 64;
int XOR[4 * N], ass_[4 * N];
int ls(int v) { return 2 * v + 1; }
int rs(int v) { return 2 * v + 2; }
void push(int v) {
  if (ass_[v]) {
    ass_[ls(v)] = ass_[v];
    XOR[ls(v)] = 0;
    ass_[rs(v)] = ass_[v];
    XOR[rs(v)] = 0;
    ass_[v] = 0;
  }
  XOR[ls(v)] ^= XOR[v];
  XOR[rs(v)] ^= XOR[v];
  XOR[v] = 0;
}
inline void set_(int v, int vl, int vr, int ql, int qr, int val) {
  if (qr <= vl || vr <= ql) {
    return;
  }
  if (ql <= vl && vr <= qr) {
    XOR[v] = 0;
    ass_[v] = val;
    return;
  }
  int vm = (vl + vr) / 2;
  push(v);
  set_(ls(v), vl, vm, ql, qr, val);
  set_(rs(v), vm, vr, ql, qr, val);
}
void set_(int l, int r, int v) { set_(0, 0, N, l, r + 1, v); }
inline void xr(int v, int vl, int vr, int ql, int qr, int val) {
  if (qr <= vl || vr <= ql) {
    return;
  }
  if (ql <= vl && vr <= qr) {
    XOR[v] ^= val;
    return;
  }
  int vm = (vl + vr) / 2;
  push(v);
  xr(ls(v), vl, vm, ql, qr, val);
  xr(rs(v), vm, vr, ql, qr, val);
}
void xr(int l, int r, int v) { xr(0, 0, N, l, r + 1, v); }
inline int find(int v, int vl, int vr, int pos) {
  assert(vl <= pos && pos < vr);
  if (vr - vl == 1) {
    return ass_[v] ^ XOR[v];
  }
  int vm = (vl + vr) / 2;
  push(v);
  if (pos < vm) {
    return find(ls(v), vl, vm, pos);
  } else {
    return find(rs(v), vm, vr, pos);
  }
}
int find(int pos) { return find(0, 0, N, pos); }
int n, q;
int a[N];
void print() {
  for (int i = 0; i < n; ++i) {
    int val = find(abs(a[i]));
    if (val == 0) {
      cout << a[i] << " ";
    } else if (val == 1) {
      cout << -a[i] << " ";
    } else if (val == 2) {
      cout << -abs(a[i]) << " ";
    } else {
      assert(val == 3);
      cout << abs(a[i]) << " ";
    }
  }
  cout << "\n";
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> q;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  while (q--) {
    char c;
    int x;
    cin >> c >> x;
    if (c == '<') {
      if (x > 0) {
        xr(0, x - 1, 1);
        set_(x, N - 1, 3);
      } else {
        set_(-x + 1, N - 1, 3);
      }
    } else {
      assert(c == '>');
      if (x < 0) {
        xr(0, -x - 1, 1);
        set_(-x, N - 1, 2);
      } else {
        set_(x + 1, N - 1, 2);
      }
    }
  }
  print();
  return 0;
}
