#include <bits/stdc++.h>
using namespace std;
template <typename _T>
inline void _DBG(const char *s, _T x) {
  cerr << s << " = " << x << "\n";
}
template <typename _T, typename... args>
void _DBG(const char *s, _T x, args... a) {
  while (*s != ',') cerr << *s++;
  cerr << " = " << x << ',';
  _DBG(s + 1, a...);
}
const int MAX = 1 << 19;
const int C = 1e5;
pair<int, int> tree[2 * MAX + 7];
void update(int l, int r, pair<int, int> v) {
  l += C, r += C;
  if (l > r) return;
  l += MAX, r += MAX;
  tree[l] = v;
  tree[r] = v;
  while (l / 2 != r / 2) {
    if (l % 2 == 0) tree[l + 1] = v;
    if (r % 2 == 1) tree[r - 1] = v;
    l /= 2, r /= 2;
  }
}
bool rev = 0;
bool query(int e) {
  e += C;
  e += MAX;
  pair<int, int> ans = {-1, 0};
  while (e) {
    ans = max(ans, tree[e]);
    e /= 2;
  }
  bool a = ans.second;
  return a ^ rev;
}
const int N = 2e5 + 7;
int n, q, T[N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> q;
  for (int i = 0; i < n; i++) {
    cin >> T[i];
  }
  for (int i = 1; i <= q; i++) {
    char c;
    int x;
    cin >> c >> x;
    if (c == '>') {
      x++;
      (c, x);
      if (x > 0) {
        update(x, C, {i, 1 ^ rev});
        update(-C, -x, {i, 0 ^ rev});
      } else {
        rev ^= 1;
        update(-x + 1, C, {i, 1 ^ rev});
        update(-C, x - 1, {i, 0 ^ rev});
      }
    } else {
      x--;
      (c, x);
      if (x < 0) {
        update(-x, C, {i, 0 ^ rev});
        update(-C, x, {i, 1 ^ rev});
      } else {
        rev ^= 1;
        update(-C, -x - 1, {i, 1 ^ rev});
        update(x + 1, C, {i, 0 ^ rev});
      }
    }
  }
  for (int i = 0; i < n; i++) {
    bool b = query(T[i]);
    if (b) T[i] *= -1;
    cout << T[i] << " ";
  }
  return 0;
}
