#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 7;
bool inv[4 * N];
int ass[4 * N];
int n, arr[N], q;
void update(int v, int l, int r) {
  if (l == r) {
    return;
  }
  if (ass[v]) {
    ass[2 * v] = ass[2 * v + 1] = ass[v];
    inv[2 * v] = inv[2 * v + 1] = 0;
    ass[v] = 0;
  }
  if (inv[v]) {
    inv[2 * v] = !inv[2 * v];
    inv[2 * v + 1] = !inv[2 * v + 1];
    inv[v] = 0;
  }
}
void assign(int v, int l, int r, int lt, int rt, int val) {
  if (lt > rt || l > r || lt < l || rt > r) {
    return;
  }
  update(v, l, r);
  if (l == lt && r == rt) {
    inv[v] = 0;
    ass[v] = val;
    return;
  }
  int half = (l + r) >> 1;
  assign(2 * v, l, half, lt, min(half, rt), val);
  assign(2 * v + 1, half + 1, r, max(half + 1, lt), rt, val);
}
void invert(int v, int l, int r, int lt, int rt) {
  if (l > r || lt > rt || lt < l || rt > r) {
    return;
  }
  update(v, l, r);
  if (l == lt && r == rt) {
    inv[v] = !inv[v];
    return;
  }
  int half = (l + r) >> 1;
  invert(2 * v, l, half, lt, min(half, rt));
  invert(2 * v + 1, half + 1, r, max(half + 1, lt), rt);
}
int get(int v, int l, int r, int trg) {
  if (l > r || trg < l || trg > r) {
    return 0;
  }
  update(v, l, r);
  if (l == r) {
    int res = 1;
    if (ass[v]) {
      res = ass[v];
    }
    if (inv[v]) {
      res *= -1;
    }
    return res;
  }
  int half = (l + r) >> 1;
  return get(2 * v, l, half, trg) + get(2 * v + 1, half + 1, r, trg);
}
int main() {
  ios::sync_with_stdio(0);
  cout.tie(0);
  cin.tie(0);
  cin >> n >> q;
  for (int i = 0; i < n; ++i) {
    cin >> arr[i];
  }
  for (int i = 0; i < q; ++i) {
    string query;
    int x;
    cin >> query >> x;
    if (query == "<" && x <= 0) {
      assign(1, -1e5, 1e5, -1e5, x - 1, -1);
      assign(1, -1e5, 1e5, -x + 1, 1e5, 1);
    } else if (query == ">" && x >= 0) {
      assign(1, -1e5, 1e5, -1e5, -x - 1, 1);
      assign(1, -1e5, 1e5, x + 1, 1e5, -1);
    } else if (query == "<" && x >= 0) {
      invert(1, -1e5, 1e5, -x + 1, x - 1);
      assign(1, -1e5, 1e5, -1e5, -x, -1);
      assign(1, -1e5, 1e5, x, 1e5, 1);
    } else {
      invert(1, -1e5, 1e5, x + 1, -x - 1);
      assign(1, -1e5, 1e5, -1e5, x, 1);
      assign(1, -1e5, 1e5, -x, 1e5, -1);
    }
  }
  for (int i = 0; i < n; ++i) {
    cout << arr[i] * get(1, -1e5, 1e5, arr[i]) << " ";
  }
  return 0;
}
