#include <bits/stdc++.h>
const int mod = 998244353;
const int inf = 1000000009;
const long long int INF = 1000000000000000009;
const long long big = 1000000000000000;
const long double eps = 0.0000000001;
using namespace std;
int T[100005], F[2000000], U[2000000];
int suma = 1;
void lazy(int u) {
  if (2 * u + 1 > suma) return;
  if (U[u]) {
    U[2 * u] = U[u];
    F[2 * u] = 0;
    U[2 * u + 1] = U[u];
    F[2 * u + 1] = 0;
  }
  if (F[u]) {
    if (U[2 * u]) {
      if (U[2 * u] == 1)
        U[2 * u] = 2;
      else
        U[2 * u] = 1;
    } else
      F[2 * u] = (F[2 * u] + F[u]) % 2;
    if (U[2 * u + 1]) {
      if (U[2 * u + 1] == 1)
        U[2 * u + 1] = 2;
      else
        U[2 * u + 1] = 1;
    } else
      F[2 * u + 1] = (F[2 * u + 1] + F[u]) % 2;
  }
  F[u] = 0;
  U[u] = 0;
}
int getwart(int a, int b, int lo, int hi, int u) {
  if (b <= a) return -1;
  lazy(u);
  if (a == lo && b == hi) {
    if (F[u]) return 3;
    return U[u];
  }
  int mid = (lo + hi) / 2;
  int L = getwart(a, min(b, mid), lo, mid, 2 * u);
  int P = getwart(max(a, mid), b, mid, hi, 2 * u + 1);
  return max(L, P);
}
void ustaw(int a, int b, int lo, int hi, int u, int r) {
  if (b <= a) return;
  lazy(u);
  if (a == lo && b == hi) {
    if (r == 3) {
      if (U[u]) {
        if (U[u] == 1)
          U[u] = 2;
        else
          U[u] = 1;
      } else {
        F[u]++;
        F[u] %= 2;
      }
    } else
      U[u] = r, F[u] = 0;
    return;
  }
  int mid = (lo + hi) / 2;
  ustaw(a, min(b, mid), lo, mid, 2 * u, r);
  ustaw(max(a, mid), b, mid, hi, 2 * u + 1, r);
}
int maks = 100001;
int main() {
  int n, q;
  cin >> n >> q;
  while (suma < maks) suma *= 2;
  suma *= 2;
  suma--;
  for (int i = 1; i <= n; i++) cin >> T[i];
  for (int i = 1; i <= q; i++) {
    char c;
    int x;
    cin >> c >> x;
    if (c == '>') {
      ustaw(1, -x + 1, 1, suma / 2 + 2, 1, 3);
      int l;
      if (x < 0)
        l = -x + 1;
      else
        l = x + 2;
      ustaw(l, maks + 1, 1, suma / 2 + 2, 1, 1);
    } else {
      ustaw(1, x + 1, 1, suma / 2 + 2, 1, 3);
      int l;
      if (x < 0)
        l = -x + 2;
      else
        l = x + 1;
      ustaw(l, maks + 1, 1, suma / 2 + 2, 1, 2);
    }
  }
  for (int i = 1; i <= n; i++) {
    int a = abs(T[i]);
    int x = getwart(a + 1, a + 2, 1, suma / 2 + 2, 1);
    if (x == 0) cout << T[i];
    if (x == 1) cout << -(abs(T[i]));
    if (x == 2) cout << abs(T[i]);
    if (x == 3) cout << -T[i];
    cout << "\n";
  }
  return 0;
}
