#pragma GCC target("sse,sse2,sse3,ssse3,sse4")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")

// hloya template v26

// ░░░░░░░▄▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▄░░░░░░
// ░░░░░░█░░▄▀▀▀▀▀▀▀▀▀▀▀▀▀▄░░█░░░░░
// ░░░░░░█░█░▀░░░░░▀░░▀░░░░█░█░░░░░
// ░░░░░░█░█░░░░░░░░▄▀▀▄░▀░█░█▄▀▀▄░
// █▀▀█▄░█░█░░▀░░░░░█░░░▀▄▄█▄▀░░░█░
// ▀▄▄░▀██░█▄░▀░░░▄▄▀░░░░░░░░░░░░▀▄
// ░░▀█▄▄█░█░░░░▄░░█░░░▄█░░░▄░▄█░░█
// ░░░░░▀█░▀▄▀░░░░░█░██░▄░░▄░░▄░███
// ░░░░░▄█▄░░▀▀▀▀▀▀▀▀▄░░▀▀▀▀▀▀▀░▄▀░
// ░░░░█░░▄█▀█▀▀█▀▀▀▀▀▀█▀▀█▀█▀▀█░░░
// ░░░░▀▀▀▀░░▀▀▀░░░░░░░░▀▀▀░░▀▀░░░░

#include <bits/stdc++.h>
using namespace std;

bool dbg = 0;

clock_t start_time = clock();
#define current_time fixed<<setprecision(6)<<(ld)(clock()-start_time)/CLOCKS_PER_SEC

#define f first
#define s second
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define eb emplace_back
#define all(v) (v).begin(), (v).end()
#define sz(v) ((int)(v).size())
#define sqr(x) ((x) * (x))

#define ull unsigned long long
#define ll long long
#define ld long double
#define pii pair<int,int>
#define umap unordered_map<int, int>

#define files1 freopen("input.txt","r",stdin)
#define files2 freopen("output.txt","w",stdout)
#define files files1;files2
#define fast_io ios_base::sync_with_stdio(0);cin.tie(0)

#define endl '\n'
#define ln(i,n) " \n"[(i) == (n) - 1]

void bad(string mes = "Impossible"){cout << mes;exit(0);}
void bad(int mes){cout << mes;exit(0);}

template<typename T>
string bin(T x, int st = 2){
    string ans = "";
    while (x > 0){
        ans += char('0' + x % st);
        x /= st;
    }
    reverse(ans.begin(), ans.end());
    return ans.empty() ? "0" : ans;
}

mt19937_64 mt_rand(
    chrono::system_clock::now().time_since_epoch().count()
);

template<typename T1, typename T2> inline bool upmax(T1& a, T2 b) { return (a < b ? (a = b, true) : false); }
template<typename T1, typename T2> inline bool upmin(T1& a, T2 b) { return (b < a ? (a = b, true) : false); }

// inline int popcount(int x){
//     int count = 0;
//     __asm__ volatile("POPCNT %1, %0;":"=r"(count):"r"(x):);
//     return count;
// }

template<typename T>
T input(){
    T ans = 0, m = 1;
    char c = ' ';

    while (!((c >= '0' && c <= '9') || c == '-')) {
        c = getchar();
    }

    if (c == '-')
        m = -1, c = getchar();
    while (c >= '0' && c <= '9'){
        ans = ans * 10 + (c - '0'), c = getchar();
    }
    return ans * m;
}

template<typename T>
T gcd (T a, T b) { while (b) { a %= b; swap (a, b); } return a; }

template<typename T> void read(T& a) { a = input<T>(); }
template<typename T> void read(T& a, T& b) { read(a), read(b); }
template<typename T> void read(T& a, T& b, T& c) { read(a, b), read(c); }
template<typename T> void read(T& a, T& b, T& c, T& d) { read(a, b), read(c, d); }

 int inf = 1e9 + 20;
const short short_inf = 3e4 + 20;
const long double eps = 1e-12;
const int maxn = (int)1e5 + 12, base = 1e9 + 7;
const ll llinf = 2e18 + 5;

template<typename T>
T binpow(T n, T s)
{
    if (s <= 0)
        return 1LL;
    if (s % 2 == 0){
        T b = binpow(n, s / 2);
        return ( 1LL * b * b ) % base;
    } else {
        return (1LL* binpow(n, s - 1) * n) % base;
    }
}

#define abs(x) (x)>0?(x):-(x)

ull kek = 0;

struct sset {
    ull data[1570];

    sset() {
        memset(data, 0, sizeof(data));
    }

    void set(int pos, int val) {
        // assert(pos >= 0);
        if (val) {
            data[pos / 64] |= 1ULL << (pos % 64);
        }
    }

    int get(int pos) {
        // assert(pos >= 0);
        ull mda = data[pos / 64] & (1ULL << (pos % 64));
        if (mda)
            return 1;
        return 0;
    }

    void flipsingle(int b, int l, int r) {
        // assert(l <= r);
        // assert(l >= 0);
        // assert(r < 64);
        cout << b << ' ' << l << ' ' << r << endl;

        int len = r - l + 1;
        ull mda = (1ULL << len) - 1ULL;
        mda = mda << l;
        data[b] ^= mda;
    }

    void setsingle(int b, int l, int r, int val) {
        // assert(l <= r);
        // assert(l >= 0);
        // assert(r < 64);
        cout << b << ' ' << l << ' ' << r << ' ' << val << endl;
        int len = r - l + 1;

        ull mda = (1ULL << len) - 1ULL;

        mda = mda << l;
        // cout << mda << endl;

        if (val == 0) {
            mda ^= kek;
            data[b] &= mda;
        } else {
            data[b] |= mda;
        }
    }

    void flip(int l, int r) {
        // assert(l <= r);
        // assert(l >= 0);
        int lb = l / 64;
        int rb = r / 64;
        // assert(lb <= rb);
        if (lb == rb) {
            flipsingle(lb, l % 64, r % 64);
        } else {
            flipsingle(lb, l % 64, 63);
            flipsingle(rb, 0, r % 64);
            for (int i = lb + 1; i < rb; i++) {
                // cout << "mda" << endl;
                data[i] ^= kek;
            }
        }
    }

    void upd(int l, int r, int val) {
        // assert(l <= r);
        // assert(l >= 0);
        int lb = l / 64;
        int rb = r / 64;
        if (lb == rb) {
            setsingle(lb, l % 64, r % 64, val);
        } else {
            setsingle(lb, l % 64, 63, val);
            setsingle(rb, 0, r % 64, val);
            for (int i = lb + 1; i < rb; i++) {

                if (val)
                    data[i] = 0;
                else
                    data[i] = kek;
            }
        }
    }
};

int ans[maxn];

int main() {
    kek -= 1;

    // files1;
    fast_io;

    int n, q;
    cin >> n >> q;

    vector<tuple<int, int, int> > e;
    vector<int> a;

    e.reserve(n);
    a.reserve(n);

    for (int i = 0; i < n; i++) {
        int x;
        cin >> x;
        if (x != 0) {
            a.pb(abs(x));
            e.pb(mt(abs(x), (x > 0) ? 0 : 1, i));
        }
    }

    sort(all(e));
    sort(all(a));

    sset bs;

    for (int i = 0; i < e.size(); i++) {
        bs.set(i, get<1>(e[i]));
        // cerr << get<1>(e[i]) << ' ';
    }

    // cerr << endl;
    // for (auto e : a)
    //     cerr << e << ' ';
    // cerr << endl;

    for (int i = 0; i < q; i++) {
        char c;
        int x;
        cin >> c >> x;

        int z = x > 0 ? 0 : 1;

        int y = abs(x);
        int it = lower_bound(all(a), y) - a.begin();
        it--;
        // [0, it]
        // cerr << i << endl;

        if ((z == 0 && c == '<') || (z == 1 && c == '>')) {
            if (it >= 0) {
                // cerr << "flip " << 0 << ' ' << it << endl;
                bs.flip(0, it);
            }
        }

        int it2 = upper_bound(all(a), y) - a.begin();

        it2--;
        it++;

        // [it, it2]
        if (it <= it2) {
            if ((z == 0 && c == '<') || (z == 1 && c == '>')) {
                // cerr << "set " << it << ' ' << it2 << ' ' << z << endl;
                bs.upd(it, it2, z);
            }
        }

        if (c == '<') {
            if (it2 + 1 < e.size()) {
                // cerr << "set " << it2 + 1 << ' ' << e.size() - 1 << ' ' << 0 << endl;
                bs.upd(it2 + 1, (int)e.size() - 1, 0);
            }
        } else {
            if (it2 + 1 < e.size()) {
                // cerr << "set " << it2 + 1 << ' ' << e.size() - 1 << ' ' << 1 << endl;
                bs.upd(it2 + 1, (int)e.size() - 1, 1);
            }
        }
    }

    for (int i = 0; i < e.size(); i++) {
        int x, t, j;
        tie(x, t, j) = e[i];

        ans[j] = bs.get(i);
        // cout << ans[j] << ' ';
        if (ans[j] == 0)
            ans[j] = x;
        else
            ans[j] = -x;
    }
    // cout << endl;

    for (int i = 0; i < n; i++)
        cout << ans[i] << ' ';
}


#pragma GCC target("sse,sse2,sse3,ssse3,sse4")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")

// hloya template v26

// ░░░░░░░▄▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▄░░░░░░
// ░░░░░░█░░▄▀▀▀▀▀▀▀▀▀▀▀▀▀▄░░█░░░░░
// ░░░░░░█░█░▀░░░░░▀░░▀░░░░█░█░░░░░
// ░░░░░░█░█░░░░░░░░▄▀▀▄░▀░█░█▄▀▀▄░
// █▀▀█▄░█░█░░▀░░░░░█░░░▀▄▄█▄▀░░░█░
// ▀▄▄░▀██░█▄░▀░░░▄▄▀░░░░░░░░░░░░▀▄
// ░░▀█▄▄█░█░░░░▄░░█░░░▄█░░░▄░▄█░░█
// ░░░░░▀█░▀▄▀░░░░░█░██░▄░░▄░░▄░███
// ░░░░░▄█▄░░▀▀▀▀▀▀▀▀▄░░▀▀▀▀▀▀▀░▄▀░
// ░░░░█░░▄█▀█▀▀█▀▀▀▀▀▀█▀▀█▀█▀▀█░░░
// ░░░░▀▀▀▀░░▀▀▀░░░░░░░░▀▀▀░░▀▀░░░░

#include <bits/stdc++.h>
using namespace std;

bool dbg = 0;

clock_t start_time = clock();
#define current_time fixed<<setprecision(6)<<(ld)(clock()-start_time)/CLOCKS_PER_SEC

#define f first
#define s second
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define eb emplace_back
#define all(v) (v).begin(), (v).end()
#define sz(v) ((int)(v).size())
#define sqr(x) ((x) * (x))

#define ull unsigned long long
#define ll long long
#define ld long double
#define pii pair<int,int>
#define umap unordered_map<int, int>

#define files1 freopen("input.txt","r",stdin)
#define files2 freopen("output.txt","w",stdout)
#define files files1;files2
#define fast_io ios_base::sync_with_stdio(0);cin.tie(0)

#define endl '\n'
#define ln(i,n) " \n"[(i) == (n) - 1]

void bad(string mes = "Impossible"){cout << mes;exit(0);}
void bad(int mes){cout << mes;exit(0);}

template<typename T>
string bin(T x, int st = 2){
    string ans = "";
    while (x > 0){
        ans += char('0' + x % st);
        x /= st;
    }
    reverse(ans.begin(), ans.end());
    return ans.empty() ? "0" : ans;
}

mt19937_64 mt_rand(
    chrono::system_clock::now().time_since_epoch().count()
);

template<typename T1, typename T2> inline bool upmax(T1& a, T2 b) { return (a < b ? (a = b, true) : false); }
template<typename T1, typename T2> inline bool upmin(T1& a, T2 b) { return (b < a ? (a = b, true) : false); }

// inline int popcount(int x){
//     int count = 0;
//     __asm__ volatile("POPCNT %1, %0;":"=r"(count):"r"(x):);
//     return count;
// }

template<typename T>
T input(){
    T ans = 0, m = 1;
    char c = ' ';

    while (!((c >= '0' && c <= '9') || c == '-')) {
        c = getchar();
    }

    if (c == '-')
        m = -1, c = getchar();
    while (c >= '0' && c <= '9'){
        ans = ans * 10 + (c - '0'), c = getchar();
    }
    return ans * m;
}

template<typename T>
T gcd (T a, T b) { while (b) { a %= b; swap (a, b); } return a; }

template<typename T> void read(T& a) { a = input<T>(); }
template<typename T> void read(T& a, T& b) { read(a), read(b); }
template<typename T> void read(T& a, T& b, T& c) { read(a, b), read(c); }
template<typename T> void read(T& a, T& b, T& c, T& d) { read(a, b), read(c, d); }

 int inf = 1e9 + 20;
const short short_inf = 3e4 + 20;
const long double eps = 1e-12;
const int maxn = (int)1e5 + 12, base = 1e9 + 7;
const ll llinf = 2e18 + 5;

template<typename T>
T binpow(T n, T s)
{
    if (s <= 0)
        return 1LL;
    if (s % 2 == 0){
        T b = binpow(n, s / 2);
        return ( 1LL * b * b ) % base;
    } else {
        return (1LL* binpow(n, s - 1) * n) % base;
    }
}

#define abs(x) (x)>0?(x):-(x)

ull kek = 0;

struct sset {
    ull data[1570];

    sset() {
        memset(data, 0, sizeof(data));
    }

    void set(int pos, int val) {
        // assert(pos >= 0);
        if (val) {
            data[pos / 64] |= 1ULL << (pos % 64);
        }
    }

    int get(int pos) {
        // assert(pos >= 0);
        ull mda = data[pos / 64] & (1ULL << (pos % 64));
        if (mda)
            return 1;
        return 0;
    }

    void flipsingle(int b, int l, int r) {
        // assert(l <= r);
        // assert(l >= 0);
        // assert(r < 64);
        // cout << b << ' ' << l << ' ' << r << endl;

        int len = r - l + 1;
        ull mda = (1ULL << len) - 1ULL;
        mda = mda << l;
        data[b] ^= mda;
    }

    void setsingle(int b, int l, int r, int val) {
        // assert(l <= r);
        // assert(l >= 0);
        // assert(r < 64);
        // cout << b << ' ' << l << ' ' << r << ' ' << val << endl;
        int len = r - l + 1;

        ull mda = (1ULL << len) - 1ULL;

        mda = mda << l;
        // cout << mda << endl;

        if (val == 0) {
            mda ^= kek;
            data[b] &= mda;
        } else {
            data[b] |= mda;
        }
    }

    void flip(int l, int r) {
        // assert(l <= r);
        // assert(l >= 0);
        int lb = l / 64;
        int rb = r / 64;
        // assert(lb <= rb);
        if (lb == rb) {
            flipsingle(lb, l % 64, r % 64);
        } else {
            flipsingle(lb, l % 64, 63);
            flipsingle(rb, 0, r % 64);
            for (int i = lb + 1; i < rb; i++) {
                // cout << "mda" << endl;
                data[i] ^= kek;
            }
        }
    }

    void upd(int l, int r, int val) {
        // assert(l <= r);
        // assert(l >= 0);
        int lb = l / 64;
        int rb = r / 64;
        if (lb == rb) {
            setsingle(lb, l % 64, r % 64, val);
        } else {
            setsingle(lb, l % 64, 63, val);
            setsingle(rb, 0, r % 64, val);
            for (int i = lb + 1; i < rb; i++) {

                if (val)
                    data[i] = 0;
                else
                    data[i] = kek;
            }
        }
    }
};

int ans[maxn];

int main() {
    kek -= 1;

    // files1;
    fast_io;

    int n, q;
    cin >> n >> q;

    vector<tuple<int, int, int> > e;
    vector<int> a;

    e.reserve(n);
    a.reserve(n);

    for (int i = 0; i < n; i++) {
        int x;
        cin >> x;
        if (x != 0) {
            a.pb(abs(x));
            e.pb(mt(abs(x), (x > 0) ? 0 : 1, i));
        }
    }

    sort(all(e));
    sort(all(a));

    sset bs;

    for (int i = 0; i < e.size(); i++) {
        bs.set(i, get<1>(e[i]));
        // cerr << get<1>(e[i]) << ' ';
    }

    // cerr << endl;
    // for (auto e : a)
    //     cerr << e << ' ';
    // cerr << endl;

    for (int i = 0; i < q; i++) {
        char c;
        int x;
        cin >> c >> x;

        int z = x > 0 ? 0 : 1;

        int y = abs(x);
        int it = lower_bound(all(a), y) - a.begin();
        it--;
        // [0, it]
        // cerr << i << endl;

        if ((z == 0 && c == '<') || (z == 1 && c == '>')) {
            if (it >= 0) {
                // cerr << "flip " << 0 << ' ' << it << endl;
                bs.flip(0, it);
            }
        }

        int it2 = upper_bound(all(a), y) - a.begin();

        it2--;
        it++;

        // [it, it2]
        if (it <= it2) {
            if ((z == 0 && c == '<') || (z == 1 && c == '>')) {
                // cerr << "set " << it << ' ' << it2 << ' ' << z << endl;
                bs.upd(it, it2, z);
            }
        }

        if (c == '<') {
            if (it2 + 1 < e.size()) {
                // cerr << "set " << it2 + 1 << ' ' << e.size() - 1 << ' ' << 0 << endl;
                bs.upd(it2 + 1, (int)e.size() - 1, 0);
            }
        } else {
            if (it2 + 1 < e.size()) {
                // cerr << "set " << it2 + 1 << ' ' << e.size() - 1 << ' ' << 1 << endl;
                bs.upd(it2 + 1, (int)e.size() - 1, 1);
            }
        }
    }

    for (int i = 0; i < e.size(); i++) {
        int x, t, j;
        tie(x, t, j) = e[i];

        ans[j] = bs.get(i);
        // cout << ans[j] << ' ';
        if (ans[j] == 0)
            ans[j] = x;
        else
            ans[j] = -x;
    }
    // cout << endl;

    for (int i = 0; i < n; i++)
        cout << ans[i] << ' ';
}


// #pragma GCC target("sse,sse2,sse3,ssse3,sse4")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")

// hloya template v26

// ░░░░░░░▄▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▄░░░░░░
// ░░░░░░█░░▄▀▀▀▀▀▀▀▀▀▀▀▀▀▄░░█░░░░░
// ░░░░░░█░█░▀░░░░░▀░░▀░░░░█░█░░░░░
// ░░░░░░█░█░░░░░░░░▄▀▀▄░▀░█░█▄▀▀▄░
// █▀▀█▄░█░█░░▀░░░░░█░░░▀▄▄█▄▀░░░█░
// ▀▄▄░▀██░█▄░▀░░░▄▄▀░░░░░░░░░░░░▀▄
// ░░▀█▄▄█░█░░░░▄░░█░░░▄█░░░▄░▄█░░█
// ░░░░░▀█░▀▄▀░░░░░█░██░▄░░▄░░▄░███
// ░░░░░▄█▄░░▀▀▀▀▀▀▀▀▄░░▀▀▀▀▀▀▀░▄▀░
// ░░░░█░░▄█▀█▀▀█▀▀▀▀▀▀█▀▀█▀█▀▀█░░░
// ░░░░▀▀▀▀░░▀▀▀░░░░░░░░▀▀▀░░▀▀░░░░

#include <bits/stdc++.h>
using namespace std;

bool dbg = 0;

clock_t start_time = clock();
#define current_time fixed<<setprecision(6)<<(ld)(clock()-start_time)/CLOCKS_PER_SEC

#define f first
#define s second
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define eb emplace_back
#define all(v) (v).begin(), (v).end()
#define sz(v) ((int)(v).size())
#define sqr(x) ((x) * (x))

#define ull unsigned long long
#define ll long long
#define ld long double
#define pii pair<int,int>
#define umap unordered_map<int, int>

#define files1 freopen("input.txt","r",stdin)
#define files2 freopen("output.txt","w",stdout)
#define files files1;files2
#define fast_io ios_base::sync_with_stdio(0);cin.tie(0)

#define endl '\n'
#define ln(i,n) " \n"[(i) == (n) - 1]

void bad(string mes = "Impossible"){cout << mes;exit(0);}
void bad(int mes){cout << mes;exit(0);}

template<typename T>
string bin(T x, int st = 2){
    string ans = "";
    while (x > 0){
        ans += char('0' + x % st);
        x /= st;
    }
    reverse(ans.begin(), ans.end());
    return ans.empty() ? "0" : ans;
}

mt19937_64 mt_rand(
    chrono::system_clock::now().time_since_epoch().count()
);

template<typename T1, typename T2> inline bool upmax(T1& a, T2 b) { return (a < b ? (a = b, true) : false); }
template<typename T1, typename T2> inline bool upmin(T1& a, T2 b) { return (b < a ? (a = b, true) : false); }

// inline int popcount(int x){
//     int count = 0;
//     __asm__ volatile("POPCNT %1, %0;":"=r"(count):"r"(x):);
//     return count;
// }

template<typename T>
T input(){
    T ans = 0, m = 1;
    char c = ' ';

    while (!((c >= '0' && c <= '9') || c == '-')) {
        c = getchar();
    }

    if (c == '-')
        m = -1, c = getchar();
    while (c >= '0' && c <= '9'){
        ans = ans * 10 + (c - '0'), c = getchar();
    }
    return ans * m;
}

template<typename T>
T gcd (T a, T b) { while (b) { a %= b; swap (a, b); } return a; }

template<typename T> void read(T& a) { a = input<T>(); }
template<typename T> void read(T& a, T& b) { read(a), read(b); }
template<typename T> void read(T& a, T& b, T& c) { read(a, b), read(c); }
template<typename T> void read(T& a, T& b, T& c, T& d) { read(a, b), read(c, d); }

 int inf = 1e9 + 20;
const short short_inf = 3e4 + 20;
const long double eps = 1e-12;
const int maxn = (int)1e5 + 12, base = 1e9 + 7;
const ll llinf = 2e18 + 5;

template<typename T>
T binpow(T n, T s)
{
    if (s <= 0)
        return 1LL;
    if (s % 2 == 0){
        T b = binpow(n, s / 2);
        return ( 1LL * b * b ) % base;
    } else {
        return (1LL* binpow(n, s - 1) * n) % base;
    }
}

#define abs(x) (x)>0?(x):-(x)

ull kek = -1;

struct sset {
    ull data[1570];
    sset() {
    }

    void set(int pos, int val) {
        if (val)
            data[pos / 64] |= 1ULL << (pos % 64);
    }

    int get(int pos) {
        ull mda = data[pos / 64] & (1ULL << (pos % 64));
        if (mda)
            return 1;
        return 0;
    }

    void flipsingle(int b, int l, int r) {
        assert(l <= r);
        assert(l >= 0);
        int len = r - l + 1;
        ull mda = (1ULL << len) - 1ULL;
        mda = mda << l;
        data[b] ^= mda;
    }

    void setsingle(int b, int l, int r, int val) {
        assert(l <= r);
        assert(l >= 0);
        int len = r - l + 1;
        ull mda = (1ULL << len) - 1ULL;
        mda = mda << l;

        if (val == 0) {
            mda ^= kek;
            data[b] &= mda;
        } else {
            data[b] |= mda;
        }
    }

    void flip(int l, int r) {
        assert(l <= r);
        assert(l >= 0);
        int lb = l / 64;
        int rb = r / 64;
        if (lb == rb) {
            flipsingle(lb, l % 64, r % 64);
        } else {
            flipsingle(lb, l % 64, 63);
            flipsingle(rb, 0, r % 64);
            for (int i = lb + 1; i < rb; i++)
                data[i] ^= kek;
        }
    }

    void upd(int l, int r, int val) {
        assert(l <= r);
        assert(l >= 0);
        int lb = l / 64;
        int rb = r / 64;
        if (lb == rb) {
            setsingle(lb, l % 64, r % 64, val);
        } else {
            setsingle(lb, l % 64, 63, val);
            setsingle(rb, 0, r % 64, val);
            for (int i = lb + 1; i < rb; i++) {
                if (val)
                    data[i] = 0;
                else
                    data[i] = kek;
            }
        }
    }
};

int ans[maxn];

int main() {
    // files1;
    fast_io;

    int n, q;
    cin >> n >> q;

    vector<tuple<int, int, int> > e;
    vector<int> a;

    e.reserve(n);
    a.reserve(n);

    for (int i = 0; i < n; i++) {
        int x;
        cin >> x;
        if (x != 0) {
            a.pb(abs(x));
            e.pb(mt(abs(x), (x > 0) ? 0 : 1, i));
        }
    }

    sort(all(e));
    sort(all(a));

    sset bs;

    for (int i = 0; i < e.size(); i++) {
        bs.set(i, get<1>(e[i]));
        // cerr << get<1>(e[i]) << ' ';
    }

    // cerr << endl;
    // for (auto e : a)
    //     cerr << e << ' ';
    // cerr << endl;

    for (int i = 0; i < q; i++) {
        char c;
        int x;
        cin >> c >> x;

        int z = x > 0 ? 0 : 1;

        int y = abs(x);
        int it = lower_bound(all(a), y) - a.begin();
        it--;
        // [0, it]
        // cerr << i << endl;

        if ((z == 0 && c == '<') || (z == 1 && c == '>')) {
            if (it >= 0) {
                // cerr << "flip " << 0 << ' ' << it << endl;
                bs.flip(0, it);
            }
        }

        int it2 = upper_bound(all(a), y) - a.begin();

        it2--;
        it++;

        // [it, it2]
        if (it <= it2) {
            if ((z == 0 && c == '<') || (z == 1 && c == '>')) {
                // cerr << "set " << it << ' ' << it2 << ' ' << z << endl;
                bs.upd(it, it2, z);
            }
        }

        if (c == '<') {
            if (it2 + 1 < e.size()) {
                // cerr << "set " << it2 + 1 << ' ' << e.size() - 1 << ' ' << 0 << endl;
                bs.upd(it2 + 1, e.size() - 1, 0);
            }
        } else {
            if (it2 + 1 < e.size()) {
                // cerr << "set " << it2 + 1 << ' ' << e.size() - 1 << ' ' << 1 << endl;
                bs.upd(it2 + 1, e.size() - 1, 1);
            }
        }
    }

    for (int i = 0; i < e.size(); i++) {
        int x, t, j;
        tie(x, t, j) = e[i];

        // cout << x << ' ' << t << ' ' << j << ' ' << bs.get(i) << endl;

        ans[j] = bs.get(i);
        if (ans[j] == 0)
            ans[j] = x;
        else
            ans[j] = -x;
    }

    for (int i = 0; i < n; i++)
        cout << ans[i] << ' ';
}


#pragma GCC target("sse,sse2,sse3,ssse3,sse4")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")

// hloya template v26

// ░░░░░░░▄▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▄░░░░░░
// ░░░░░░█░░▄▀▀▀▀▀▀▀▀▀▀▀▀▀▄░░█░░░░░
// ░░░░░░█░█░▀░░░░░▀░░▀░░░░█░█░░░░░
// ░░░░░░█░█░░░░░░░░▄▀▀▄░▀░█░█▄▀▀▄░
// █▀▀█▄░█░█░░▀░░░░░█░░░▀▄▄█▄▀░░░█░
// ▀▄▄░▀██░█▄░▀░░░▄▄▀░░░░░░░░░░░░▀▄
// ░░▀█▄▄█░█░░░░▄░░█░░░▄█░░░▄░▄█░░█
// ░░░░░▀█░▀▄▀░░░░░█░██░▄░░▄░░▄░███
// ░░░░░▄█▄░░▀▀▀▀▀▀▀▀▄░░▀▀▀▀▀▀▀░▄▀░
// ░░░░█░░▄█▀█▀▀█▀▀▀▀▀▀█▀▀█▀█▀▀█░░░
// ░░░░▀▀▀▀░░▀▀▀░░░░░░░░▀▀▀░░▀▀░░░░

#include <bits/stdc++.h>
using namespace std;

bool dbg = 0;

clock_t start_time = clock();
#define current_time fixed<<setprecision(6)<<(ld)(clock()-start_time)/CLOCKS_PER_SEC

#define f first
#define s second
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define eb emplace_back
#define all(v) (v).begin(), (v).end()
#define sz(v) ((int)(v).size())
#define sqr(x) ((x) * (x))

#define ull unsigned long long
#define ll long long
#define ld long double
#define pii pair<int,int>
#define umap unordered_map<int, int>

#define files1 freopen("input.txt","r",stdin)
#define files2 freopen("output.txt","w",stdout)
#define files files1;files2
#define fast_io ios_base::sync_with_stdio(0);cin.tie(0)

#define endl '\n'
#define ln(i,n) " \n"[(i) == (n) - 1]

void bad(string mes = "Impossible"){cout << mes;exit(0);}
void bad(int mes){cout << mes;exit(0);}

template<typename T>
string bin(T x, int st = 2){
    string ans = "";
    while (x > 0){
        ans += char('0' + x % st);
        x /= st;
    }
    reverse(ans.begin(), ans.end());
    return ans.empty() ? "0" : ans;
}

mt19937_64 mt_rand(
    chrono::system_clock::now().time_since_epoch().count()
);

template<typename T1, typename T2> inline bool upmax(T1& a, T2 b) { return (a < b ? (a = b, true) : false); }
template<typename T1, typename T2> inline bool upmin(T1& a, T2 b) { return (b < a ? (a = b, true) : false); }

// inline int popcount(int x){
//     int count = 0;
//     __asm__ volatile("POPCNT %1, %0;":"=r"(count):"r"(x):);
//     return count;
// }

template<typename T>
T input(){
    T ans = 0, m = 1;
    char c = ' ';

    while (!((c >= '0' && c <= '9') || c == '-')) {
        c = getchar();
    }

    if (c == '-')
        m = -1, c = getchar();
    while (c >= '0' && c <= '9'){
        ans = ans * 10 + (c - '0'), c = getchar();
    }
    return ans * m;
}

template<typename T>
T gcd (T a, T b) { while (b) { a %= b; swap (a, b); } return a; }

template<typename T> void read(T& a) { a = input<T>(); }
template<typename T> void read(T& a, T& b) { read(a), read(b); }
template<typename T> void read(T& a, T& b, T& c) { read(a, b), read(c); }
template<typename T> void read(T& a, T& b, T& c, T& d) { read(a, b), read(c, d); }

 int inf = 1e9 + 20;
const short short_inf = 3e4 + 20;
const long double eps = 1e-12;
const int maxn = (int)1e5 + 12, base = 1e9 + 7;
const ll llinf = 2e18 + 5;

template<typename T>
T binpow(T n, T s)
{
    if (s <= 0)
        return 1LL;
    if (s % 2 == 0){
        T b = binpow(n, s / 2);
        return ( 1LL * b * b ) % base;
    } else {
        return (1LL* binpow(n, s - 1) * n) % base;
    }
}

#define abs(x) (x)>0?(x):-(x)

ull kek = 0;

struct sset {
    ull data[1570];

    sset() {
        memset(data, 0, sizeof(data));
    }

    void set(int pos, int val) {
        // assert(pos >= 0);
        if (val) {
            data[pos / 64] |= 1ULL << (pos % 64);
        }
    }

    int get(int pos) {
        // assert(pos >= 0);
        ull mda = data[pos / 64] & (1ULL << (pos % 64));
        if (mda)
            return 1;
        return 0;
    }

    void flipsingle(int b, int l, int r) {
        // assert(l <= r);
        // assert(l >= 0);
        // assert(r < 64);
        // cout << b << ' ' << l << ' ' << r << endl;

        int len = r - l + 1;
        ull mda = (1ULL << len) - 1ULL;

        if (len == 64)
            mda = kek;

        mda = mda << l;
        data[b] ^= mda;
    }

    void setsingle(int b, int l, int r, int val) {
        // assert(l <= r);
        // assert(l >= 0);
        // assert(r < 64);
        // cout << b << ' ' << l << ' ' << r << ' ' << val << endl;
        int len = r - l + 1;

        ull mda = (1ULL << len) - 1ULL;

        if (len == 64)
            mda = kek;

        mda = mda << l;
        // cout << mda << endl;

        if (val == 0) {
            mda ^= kek;
            data[b] &= mda;
        } else {
            data[b] |= mda;
        }
    }

    void flip(int l, int r) {
        // assert(l <= r);
        // assert(l >= 0);
        int lb = l / 64;
        int rb = r / 64;
        // assert(lb <= rb);
        if (lb == rb) {
            flipsingle(lb, l % 64, r % 64);
        } else {
            flipsingle(lb, l % 64, 63);
            flipsingle(rb, 0, r % 64);
            for (int i = lb + 1; i < rb; i++) {
                // cout << "mda" << endl;
                data[i] ^= kek;
            }
        }
    }

    void upd(int l, int r, int val) {
        // assert(l <= r);
        // assert(l >= 0);
        int lb = l / 64;
        int rb = r / 64;
        if (lb == rb) {
            setsingle(lb, l % 64, r % 64, val);
        } else {
            setsingle(lb, l % 64, 63, val);
            setsingle(rb, 0, r % 64, val);
            for (int i = lb + 1; i < rb; i++) {
                if (val)
                    data[i] = kek;
                else
                    data[i] = 0;
            }
        }
    }
};

int ans[maxn];

int main() {
    kek -= 1;

    // files1;
    fast_io;

    int n, q;
    cin >> n >> q;

    vector<tuple<int, int, int> > e;
    vector<int> a;

    e.reserve(n);
    a.reserve(n);

    for (int i = 0; i < n; i++) {
        int x;
        cin >> x;
        if (x != 0) {
            a.pb(abs(x));
            e.pb(mt(abs(x), (x > 0) ? 0 : 1, i));
        }
    }

    sort(all(e));
    sort(all(a));

    sset bs;

    for (int i = 0; i < e.size(); i++) {
        bs.set(i, get<1>(e[i]));
        // cerr << get<1>(e[i]) << ' ';
    }

    // cerr << endl;
    // for (auto e : a)
    //     cerr << e << ' ';
    // cerr << endl;

    if (a.size())
    for (int i = 0; i < q; i++) {
        char c;
        int x;
        cin >> c >> x;

        int z = x > 0 ? 0 : 1;

        int y = abs(x);
        int it = lower_bound(all(a), y) - a.begin();
        it--;
        // [0, it]
        // cerr << i << endl;

        if ((z == 0 && c == '<') || (z == 1 && c == '>')) {
            if (it >= 0) {
                // cerr << "flip " << 0 << ' ' << it << endl;
                bs.flip(0, it);
            }
        }

        int it2 = upper_bound(all(a), y) - a.begin();

        it2--;
        it++;

        // [it, it2]
        if (it <= it2) {
            if ((z == 0 && c == '<') || (z == 1 && c == '>')) {
                // cerr << "set " << it << ' ' << it2 << ' ' << z << endl;
                bs.upd(it, it2, z);
            }
        }

        if (c == '<') {
            if (it2 + 1 < e.size()) {
                // cerr << "set " << it2 + 1 << ' ' << e.size() - 1 << ' ' << 0 << endl;
                bs.upd(it2 + 1, (int)e.size() - 1, 0);
            }
        } else {
            if (it2 + 1 < e.size()) {
                // cerr << "set " << it2 + 1 << ' ' << e.size() - 1 << ' ' << 1 << endl;
                bs.upd(it2 + 1, (int)e.size() - 1, 1);
            }
        }
    }

    for (int i = 0; i < e.size(); i++) {
        int x, t, j;
        tie(x, t, j) = e[i];

        ans[j] = bs.get(i);
        // cout << ans[j] << ' ';
        if (ans[j] == 0)
            ans[j] = x;
        else
            ans[j] = -x;
    }
    // cout << endl;

    for (int i = 0; i < n; i++)
        cout << ans[i] << ' ';
}


#include <bits/stdc++.h>

#define FOR(i,n)    for(lli i=0;i<(lli)(n);++i)
#define FORU(i,j,k) for(lli i=(j);i<=(lli)(k);++i)
#define FORD(i,j,k) for(lli i=(j);i>=(lli)(k);--i)

#define pb push_back
#define mt make_tuple

using namespace std;

using lli = long long int;
using pll = pair<lli, lli>;

using vi = vector<lli>;
using vvi = vector<vi>;
using pii = tuple<lli, lli>;
using vii = vector<pii>;
using vvii = vector<vii>;

#define X(a) get<0>(a)
#define Y(a) get<1>(a)
#define Z(a) get<2>(a)

string TYPE(const int*)          { return "%d";   }
string TYPE(const lli*)          { return "%lld"; }
string TYPE(const double*)       { return "%lf";  }
string TYPE(const char*)         { return "%c";   }
string TYPE(const char**)        { return "%s";   }
string TYPE(const unsigned int*) { return "%u";   }

const int MAX_BUF = 100*1000+42;
char buf[MAX_BUF];

void RD() {}
template<typename T, typename... Args>
void RD(T* v, Args... args)
{
    scanf((" " + TYPE(v)).c_str(), v);
    RD(args...);
}
template<typename... Args>
void RD(string* v, Args... args)
{
    scanf(" %s", buf);
    (*v) = buf;
    RD(args...);
}

void PR(bool nl = true)
{ if(nl) printf("\n"); }
template<typename T, typename... Args>
void PR(bool nl, T v, Args... args)
{
    printf((TYPE(&v) + " ").c_str(), v);
    PR(nl, args...);
}
template<typename... Args>
void PR(bool nl, string& v, Args... args)
{
    printf("%s", v.c_str());
    PR(nl, args...);
}
template<typename... Args>
void PR(Args... args)
{ PR(true, args...); }

const long long int oo = 1000*1000*1000;

struct Coord {
    int x, y;
    Coord(int x = 0, int y = 0) : x(x), y(y) {}
    Coord operator + (const Coord& droite) const
    { return Coord(x + droite.x, y + droite.y); }
};

const lli MAX_N = 100*1000+42;
const lli OFF = 100*1000+42;

lli v[MAX_N];

struct AB {
    int k; vector<pair<lli, lli>> arbre;
    AB(int _k = 20) { k = _k;
        FOR(i, 1 << k)
            arbre.push_back(i < (1 << (k-1)) ? pair<lli, lli>({0, 1}) : pair<lli, lli>({1, 1}));
    }
    //lli get(int i) {
    //    return sum(i, i+1);
    //}
    //void set(int i, lli x) { int feuille = i + (1 << (k-1));
    //    arbre[feuille] = x;
    //    iset(feuille >> 1);
    //}
    //void iset(int noeud) {
    //    if(noeud) {
    //        arbre[noeud] = arbre[noeud << 1] + arbre[(noeud << 1)  ^ 1];
    //        iset(noeud >> 1);
    //}   }
    //lli sum(int deb, int fin, int noeud = 1, int p = 0, int q = -1) {
    //    if(q < p) q = 1 << (k-1);
    //    if(deb <= p && q <= fin) return arbre[noeud];
    //    if(deb >= q || fin <= p) return 0LL;
    //    int mil = (p + q) / 2;
    //    return sum(deb, fin, noeud << 1, p, mil) + sum(deb, fin, (noeud << 1) ^ 1, mil, q);
    //}
    lli get(int i) { int noeud = i + (1 << (k-1));
        int v = arbre[noeud].first * arbre[noeud].second;
        while(noeud != 1) {
            noeud >>= 1;
            if(arbre[noeud].first) v = arbre[noeud].first;
            v *= arbre[noeud].second;
        }
        return v;
    }
    void mul(int deb, int fin, lli m = -1, int noeud = 1, int p = 0, int q = -1) {
        if(q < p) q = 1 << (k-1);
        if(deb <= p && q <= fin) {
            arbre[noeud].second *= m;
            return;
        }
        if(deb >= q || fin <= p) return;
        int mil = (p + q) / 2;
        if(arbre[noeud].first) {
            arbre[noeud << 1].first = arbre[noeud].first;
            arbre[noeud << 1].second = 1;
            arbre[(noeud << 1) ^ 1].first = arbre[noeud].first;
            arbre[(noeud << 1) ^ 1].second = 1;
            arbre[noeud].first = 0;
        }
        mul(deb, fin, m, noeud << 1, p, mil);
        mul(deb, fin, m, (noeud << 1) ^ 1, mil, q);
    }
    void set(int deb, int fin, lli v, int noeud = 1, int p = 0, int q = -1) {
        if(q < p) q = 1 << (k-1);
        if(deb <= p && q <= fin) {
            arbre[noeud].first = v;
            arbre[noeud].second = 1;
            return;
        }
        if(deb >= q || fin <= p) return;
        int mil = (p + q) / 2;
        if(arbre[noeud].first) {
            arbre[noeud << 1].first = arbre[noeud].first;
            arbre[noeud << 1].second = arbre[noeud].second;
            arbre[(noeud << 1) ^ 1].first = arbre[noeud].first;
            arbre[(noeud << 1) ^ 1].second = arbre[noeud].second;
            arbre[noeud].first = 0;
            arbre[noeud].second = 1;
        }
        set(deb, fin, v, noeud << 1, p, mil);
        set(deb, fin, v, (noeud << 1) ^ 1, mil, q);
    }
};

int main()
{
    AB a = AB();
    int n, q; RD(&n, &q);
    FOR(i, n)
        RD(v+i);
    char t; int x;
    FOR(i, q) {
        RD(&t, &x);
        if(t == '<') {
            if(x <= 0) {
                a.set(0, OFF+x, -1);
                a.set(OFF-x+1, 2*OFF, 1);
            } else {
                a.set(0, OFF-x+1, -1);
                a.set(OFF+x, 2*OFF, 1);
                a.mul(OFF-x+1, OFF+x, -1);
            }
        } else {
            if(x >= 0) {
                a.set(OFF+x+1, 2*OFF, -1);
                a.set(0, OFF-x, 1);
            } else {
                a.set(OFF-x, 2*OFF, -1);
                a.set(0, OFF+x+1, 1);
                a.mul(OFF+x+1, OFF-x, -1);
            }
        }
    }
    FOR(i, n) PR(i==n-1, v[i] * a.get(v[i]+OFF));
    return 0;
}


#include <bits/stdc++.h>

#define FOR(i,n)    for(lli i=0;i<(lli)(n);++i)
#define FORU(i,j,k) for(lli i=(j);i<=(lli)(k);++i)
#define FORD(i,j,k) for(lli i=(j);i>=(lli)(k);--i)

#define pb push_back
#define mt make_tuple

using namespace std;

using lli = long long int;
using pll = pair<lli, lli>;

using vi = vector<lli>;
using vvi = vector<vi>;
using pii = tuple<lli, lli>;
using vii = vector<pii>;
using vvii = vector<vii>;

#define X(a) get<0>(a)
#define Y(a) get<1>(a)
#define Z(a) get<2>(a)

string TYPE(const int*)          { return "%d";   }
string TYPE(const lli*)          { return "%lld"; }
string TYPE(const double*)       { return "%lf";  }
string TYPE(const char*)         { return "%c";   }
string TYPE(const char**)        { return "%s";   }
string TYPE(const unsigned int*) { return "%u";   }

const int MAX_BUF = 100*1000+42;
char buf[MAX_BUF];

void RD() {}
template<typename T, typename... Args>
void RD(T* v, Args... args)
{
    scanf((" " + TYPE(v)).c_str(), v);
    RD(args...);
}
template<typename... Args>
void RD(string* v, Args... args)
{
    scanf(" %s", buf);
    (*v) = buf;
    RD(args...);
}

void PR(bool nl = true)
{ if(nl) printf("\n"); }
template<typename T, typename... Args>
void PR(bool nl, T v, Args... args)
{
    printf((TYPE(&v) + " ").c_str(), v);
    PR(nl, args...);
}
template<typename... Args>
void PR(bool nl, string& v, Args... args)
{
    printf("%s", v.c_str());
    PR(nl, args...);
}
template<typename... Args>
void PR(Args... args)
{ PR(true, args...); }

const long long int oo = 1000*1000*1000;

struct Coord {
    int x, y;
    Coord(int x = 0, int y = 0) : x(x), y(y) {}
    Coord operator + (const Coord& droite) const
    { return Coord(x + droite.x, y + droite.y); }
};

const lli MAX_N = 100*1000+42;
const lli OFF = 100*1000+42;

lli v[MAX_N];

struct AB {
    int k; vector<pair<lli, lli>> arbre;
    AB(int _k = 20) { k = _k;
        FOR(i, 1 << k)
            arbre.push_back(i < (1 << (k-1)) ? pair<lli, lli>({0, 1}) : pair<lli, lli>({1, 1}));
    }
    //lli get(int i) {
    //    return sum(i, i+1);
    //}
    //void set(int i, lli x) { int feuille = i + (1 << (k-1));
    //    arbre[feuille] = x;
    //    iset(feuille >> 1);
    //}
    //void iset(int noeud) {
    //    if(noeud) {
    //        arbre[noeud] = arbre[noeud << 1] + arbre[(noeud << 1)  ^ 1];
    //        iset(noeud >> 1);
    //}   }
    //lli sum(int deb, int fin, int noeud = 1, int p = 0, int q = -1) {
    //    if(q < p) q = 1 << (k-1);
    //    if(deb <= p && q <= fin) return arbre[noeud];
    //    if(deb >= q || fin <= p) return 0LL;
    //    int mil = (p + q) / 2;
    //    return sum(deb, fin, noeud << 1, p, mil) + sum(deb, fin, (noeud << 1) ^ 1, mil, q);
    //}
    lli get(int i) { int noeud = i + (1 << (k-1));
        int v = arbre[noeud].first * arbre[noeud].second;
        while(noeud != 1) {
            noeud >>= 1;
            if(arbre[noeud].first) v = arbre[noeud].first;
            v *= arbre[noeud].second;
        }
        return v;
    }
    void mul(int deb, int fin, lli m = -1, int noeud = 1, int p = 0, int q = -1) {
        if(q < p) q = 1 << (k-1);
        if(deb <= p && q <= fin) {
            arbre[noeud].second *= m;
            return;
        }
        if(deb >= q || fin <= p) return;
        int mil = (p + q) / 2;
        if(arbre[noeud].first) {
            arbre[noeud << 1].first = arbre[noeud].first;
            arbre[noeud << 1].second = 1;
            arbre[(noeud << 1) ^ 1].first = arbre[noeud].first;
            arbre[(noeud << 1) ^ 1].second = 1;
            arbre[noeud].first = 0;
        }
        mul(deb, fin, m, noeud << 1, p, mil);
        mul(deb, fin, m, (noeud << 1) ^ 1, mil, q);
    }
    void set(int deb, int fin, lli v, int noeud = 1, int p = 0, int q = -1) {
        if(q < p) q = 1 << (k-1);
        if(deb <= p && q <= fin) {
            arbre[noeud].first = v;
            arbre[noeud].second = 1;
            return;
        }
        if(deb >= q || fin <= p) return;
        int mil = (p + q) / 2;
        if(arbre[noeud].first) {
            arbre[noeud << 1].first = arbre[noeud].first;
            arbre[noeud << 1].second = arbre[noeud].second;
            arbre[(noeud << 1) ^ 1].first = arbre[noeud].first;
            arbre[(noeud << 1) ^ 1].second = arbre[noeud].second;
            arbre[noeud].first = 0;
            arbre[noeud].second = 1;
        } else if(arbre[noeud].second != 1) {
            arbre[noeud << 1].second = arbre[noeud].second;
            arbre[(noeud << 1) ^ 1].second = arbre[noeud].second;
            arbre[noeud].second = 1;
        }
        set(deb, fin, v, noeud << 1, p, mil);
        set(deb, fin, v, (noeud << 1) ^ 1, mil, q);
    }
};

int main()
{
    AB a = AB();
    int n, q; RD(&n, &q);
    FOR(i, n)
        RD(v+i);
    char t; int x;
    FOR(i, q) {
        RD(&t, &x);
        if(t == '<') {
            if(x <= 0) {
                a.set(0, OFF+x, -1);
                a.set(OFF-x+1, 2*OFF, 1);
            } else {
                a.set(0, OFF-x+1, -1);
                a.set(OFF+x, 2*OFF, 1);
                a.mul(OFF-x+1, OFF+x, -1);
            }
        } else {
            if(x >= 0) {
                a.set(OFF+x+1, 2*OFF, -1);
                a.set(0, OFF-x, 1);
            } else {
                a.set(OFF-x, 2*OFF, -1);
                a.set(0, OFF+x+1, 1);
                a.mul(OFF+x+1, OFF-x, -1);
            }
        }
    }
    FOR(i, n) PR(i==n-1, v[i] * a.get(v[i]+OFF));
    return 0;
}


#include <bits/stdc++.h>

#define FOR(i,n)    for(lli i=0;i<(lli)(n);++i)
#define FORU(i,j,k) for(lli i=(j);i<=(lli)(k);++i)
#define FORD(i,j,k) for(lli i=(j);i>=(lli)(k);--i)

#define pb push_back
#define mt make_tuple

using namespace std;

using lli = long long int;
using pll = pair<lli, lli>;

using vi = vector<lli>;
using vvi = vector<vi>;
using pii = tuple<lli, lli>;
using vii = vector<pii>;
using vvii = vector<vii>;

#define X(a) get<0>(a)
#define Y(a) get<1>(a)
#define Z(a) get<2>(a)

string TYPE(const int*)          { return "%d";   }
string TYPE(const lli*)          { return "%lld"; }
string TYPE(const double*)       { return "%lf";  }
string TYPE(const char*)         { return "%c";   }
string TYPE(const char**)        { return "%s";   }
string TYPE(const unsigned int*) { return "%u";   }

const int MAX_BUF = 100*1000+42;
char buf[MAX_BUF];

void RD() {}
template<typename T, typename... Args>
void RD(T* v, Args... args)
{
    scanf((" " + TYPE(v)).c_str(), v);
    RD(args...);
}
template<typename... Args>
void RD(string* v, Args... args)
{
    scanf(" %s", buf);
    (*v) = buf;
    RD(args...);
}

void PR(bool nl = true)
{ if(nl) printf("\n"); }
template<typename T, typename... Args>
void PR(bool nl, T v, Args... args)
{
    printf((TYPE(&v) + " ").c_str(), v);
    PR(nl, args...);
}
template<typename... Args>
void PR(bool nl, string& v, Args... args)
{
    printf("%s", v.c_str());
    PR(nl, args...);
}
template<typename... Args>
void PR(Args... args)
{ PR(true, args...); }

const long long int oo = 1000*1000*1000;

struct Coord {
    int x, y;
    Coord(int x = 0, int y = 0) : x(x), y(y) {}
    Coord operator + (const Coord& droite) const
    { return Coord(x + droite.x, y + droite.y); }
};

const lli MAX_N = 100*1000+42;
const lli OFF = 100*1000+42;

lli v[MAX_N];

struct AB {
    int k; vector<pair<lli, lli>> arbre;
    AB(int _k = 20) { k = _k;
        FOR(i, 1 << k)
            arbre.push_back(i < (1 << (k-1)) ? pair<lli, lli>({0, 1}) : pair<lli, lli>({1, 1}));
    }
    //lli get(int i) {
    //    return sum(i, i+1);
    //}
    //void set(int i, lli x) { int feuille = i + (1 << (k-1));
    //    arbre[feuille] = x;
    //    iset(feuille >> 1);
    //}
    //void iset(int noeud) {
    //    if(noeud) {
    //        arbre[noeud] = arbre[noeud << 1] + arbre[(noeud << 1)  ^ 1];
    //        iset(noeud >> 1);
    //}   }
    //lli sum(int deb, int fin, int noeud = 1, int p = 0, int q = -1) {
    //    if(q < p) q = 1 << (k-1);
    //    if(deb <= p && q <= fin) return arbre[noeud];
    //    if(deb >= q || fin <= p) return 0LL;
    //    int mil = (p + q) / 2;
    //    return sum(deb, fin, noeud << 1, p, mil) + sum(deb, fin, (noeud << 1) ^ 1, mil, q);
    //}
    lli get(int i) { int noeud = i + (1 << (k-1));
        int v = arbre[noeud].first * arbre[noeud].second;
        while(noeud != 1) {
            noeud >>= 1;
            if(arbre[noeud].first) v = arbre[noeud].first;
            v *= arbre[noeud].second;
        }
        return v;
    }
    void mul(int deb, int fin, lli m = -1, int noeud = 1, int p = 0, int q = -1) {
        if(q < p) q = 1 << (k-1);
        if(deb <= p && q <= fin) {
            arbre[noeud].second *= m;
            return;
        }
        if(deb >= q || fin <= p) return;
        int mil = (p + q) / 2;
        if(arbre[noeud].first) {
            arbre[noeud << 1].first = arbre[noeud].first;
            arbre[noeud << 1].second = 1;
            arbre[(noeud << 1) ^ 1].first = arbre[noeud].first;
            arbre[(noeud << 1) ^ 1].second = 1;
            arbre[noeud].first = 0;
        }
        mul(deb, fin, m, noeud << 1, p, mil);
        mul(deb, fin, m, (noeud << 1) ^ 1, mil, q);
    }
    void set(int deb, int fin, lli v, int noeud = 1, int p = 0, int q = -1) {
        if(q < p) q = 1 << (k-1);
        if(deb <= p && q <= fin) {
            arbre[noeud].first = v;
            arbre[noeud].second = 1;
            return;
        }
        if(deb >= q || fin <= p) return;
        int mil = (p + q) / 2;
        if(arbre[noeud].first) {
            arbre[noeud << 1].first = arbre[noeud].first;
            arbre[noeud << 1].second = arbre[noeud].second;
            arbre[(noeud << 1) ^ 1].first = arbre[noeud].first;
            arbre[(noeud << 1) ^ 1].second = arbre[noeud].second;
            arbre[noeud].first = 0;
            arbre[noeud].second = 1;
        }
        if(arbre[noeud].second != 1) {
            arbre[noeud << 1].second *= arbre[noeud].second;
            arbre[(noeud << 1) ^ 1].second *= arbre[noeud].second;
            arbre[noeud].second = 1;
        }
        set(deb, fin, v, noeud << 1, p, mil);
        set(deb, fin, v, (noeud << 1) ^ 1, mil, q);
    }
};

int main()
{
    AB a = AB();
    int n, q; RD(&n, &q);
    FOR(i, n)
        RD(v+i);
    char t; int x;
    FOR(i, q) {
        RD(&t, &x);
        if(t == '<') {
            if(x <= 0) {
                a.set(0, OFF+x, -1);
                a.set(OFF-x+1, 2*OFF, 1);
            } else {
                a.set(0, OFF-x+1, -1);
                a.set(OFF+x, 2*OFF, 1);
                a.mul(OFF-x+1, OFF+x, -1);
            }
        } else {
            if(x >= 0) {
                a.set(OFF+x+1, 2*OFF, -1);
                a.set(0, OFF-x, 1);
            } else {
                a.set(OFF-x, 2*OFF, -1);
                a.set(0, OFF+x+1, 1);
                a.mul(OFF+x+1, OFF-x, -1);
            }
        }
    }
    FOR(i, n) PR(i==n-1, v[i] * a.get(v[i]+OFF));
    return 0;
}


#include <bits/stdc++.h>

#define FOR(i,n)    for(lli i=0;i<(lli)(n);++i)
#define FORU(i,j,k) for(lli i=(j);i<=(lli)(k);++i)
#define FORD(i,j,k) for(lli i=(j);i>=(lli)(k);--i)

#define pb push_back
#define mt make_tuple

using namespace std;

using lli = long long int;
using pll = pair<lli, lli>;

using vi = vector<lli>;
using vvi = vector<vi>;
using pii = tuple<lli, lli>;
using vii = vector<pii>;
using vvii = vector<vii>;

#define X(a) get<0>(a)
#define Y(a) get<1>(a)
#define Z(a) get<2>(a)

string TYPE(const int*)          { return "%d";   }
string TYPE(const lli*)          { return "%lld"; }
string TYPE(const double*)       { return "%lf";  }
string TYPE(const char*)         { return "%c";   }
string TYPE(const char**)        { return "%s";   }
string TYPE(const unsigned int*) { return "%u";   }

const int MAX_BUF = 100*1000+42;
char buf[MAX_BUF];

void RD() {}
template<typename T, typename... Args>
void RD(T* v, Args... args)
{
    scanf((" " + TYPE(v)).c_str(), v);
    RD(args...);
}
template<typename... Args>
void RD(string* v, Args... args)
{
    scanf(" %s", buf);
    (*v) = buf;
    RD(args...);
}

void PR(bool nl = true)
{ if(nl) printf("\n"); }
template<typename T, typename... Args>
void PR(bool nl, T v, Args... args)
{
    printf((TYPE(&v) + " ").c_str(), v);
    PR(nl, args...);
}
template<typename... Args>
void PR(bool nl, string& v, Args... args)
{
    printf("%s", v.c_str());
    PR(nl, args...);
}
template<typename... Args>
void PR(Args... args)
{ PR(true, args...); }

const long long int oo = 1000*1000*1000;

struct Coord {
    int x, y;
    Coord(int x = 0, int y = 0) : x(x), y(y) {}
    Coord operator + (const Coord& droite) const
    { return Coord(x + droite.x, y + droite.y); }
};

const lli MAX_N = 100*1000+42;
const lli OFF = 100*1000+42;

lli v[MAX_N];

struct AB {
    int k; vector<pair<lli, lli>> arbre;
    AB(int _k = 20) { k = _k;
        FOR(i, 1 << k)
            arbre.push_back(i < (1 << (k-1)) ? pair<lli, lli>({0, 1}) : pair<lli, lli>({1, 1}));
    }
    //lli get(int i) {
    //    return sum(i, i+1);
    //}
    //void set(int i, lli x) { int feuille = i + (1 << (k-1));
    //    arbre[feuille] = x;
    //    iset(feuille >> 1);
    //}
    //void iset(int noeud) {
    //    if(noeud) {
    //        arbre[noeud] = arbre[noeud << 1] + arbre[(noeud << 1)  ^ 1];
    //        iset(noeud >> 1);
    //}   }
    //lli sum(int deb, int fin, int noeud = 1, int p = 0, int q = -1) {
    //    if(q < p) q = 1 << (k-1);
    //    if(deb <= p && q <= fin) return arbre[noeud];
    //    if(deb >= q || fin <= p) return 0LL;
    //    int mil = (p + q) / 2;
    //    return sum(deb, fin, noeud << 1, p, mil) + sum(deb, fin, (noeud << 1) ^ 1, mil, q);
    //}
    lli get(int i) { int noeud = i + (1 << (k-1));
        int v = arbre[noeud].first * arbre[noeud].second;
        while(noeud != 1) {
            noeud >>= 1;
            if(arbre[noeud].first) v = arbre[noeud].first;
            v *= arbre[noeud].second;
        }
        return v;
    }
    void mul(int deb, int fin, lli m = -1, int noeud = 1, int p = 0, int q = -1) {
        if(q < p) q = 1 << (k-1);
        if(deb <= p && q <= fin) {
            arbre[noeud].second *= m;
            return;
        }
        if(deb >= q || fin <= p) return;
        int mil = (p + q) / 2;
        if(arbre[noeud].first) {
            arbre[noeud << 1].first = arbre[noeud].first;
            arbre[noeud << 1].second = 1;
            arbre[(noeud << 1) ^ 1].first = arbre[noeud].first;
            arbre[(noeud << 1) ^ 1].second = 1;
            arbre[noeud].first = 0;
        }
        mul(deb, fin, m, noeud << 1, p, mil);
        mul(deb, fin, m, (noeud << 1) ^ 1, mil, q);
    }
    void set(int deb, int fin, lli v, int noeud = 1, int p = 0, int q = -1) {
        if(q < p) q = 1 << (k-1);
        if(deb <= p && q <= fin) {
            arbre[noeud].first = v;
            arbre[noeud].second = 1;
            return;
        }
        if(deb >= q || fin <= p) return;
        int mil = (p + q) / 2;
        if(arbre[noeud].first) {
            arbre[noeud << 1].first = arbre[noeud].first;
            arbre[noeud << 1].second = arbre[noeud].second;
            arbre[(noeud << 1) ^ 1].first = arbre[noeud].first;
            arbre[(noeud << 1) ^ 1].second = arbre[noeud].second;
            arbre[noeud].first = 0;
            arbre[noeud].second = 1;
        }
        set(deb, fin, v, noeud << 1, p, mil);
        set(deb, fin, v, (noeud << 1) ^ 1, mil, q);
    }
};

int main()
{
    AB a = AB();
    int n, q; RD(&n, &q);
    FOR(i, n)
        RD(v+i);
    char t; int x;
    FOR(i, q) {
        RD(&t, &x);
        if(t == '<') {
            if(x <= 0) {
                a.set(0, OFF+x-1, -1);
                a.set(OFF-x+1, 2*OFF, 1);
            } else {
                a.set(0, OFF-x+1, -1);
                a.set(OFF+x, 2*OFF, 1);
                a.mul(OFF-x+1, OFF+x, -1);
            }
        } else {
            if(x >= 0) {
                a.set(OFF+x+1, 2*OFF, -1);
                a.set(0, OFF-x, 1);
            } else {
                a.set(OFF-x, 2*OFF, -1);
                a.set(0, OFF+x+1, 1);
                a.mul(OFF+x+1, OFF-x, -1);
            }
        }
    }
    FOR(i, n) PR(i==n-1, v[i] * a.get(v[i]+OFF));
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int N = 1e5 + 100;

typedef pair<int,int> pii;

int seg[4 * N], t[4 * N], a[N], res[N];
vector<pii> vec;
int n, q;

void change(int l, int r, int pos, int tm, int i = 1, int L = 0, int R = N) {
    if (r <= L || R <= l)
	return;
    if (l <= L && R <= r) {
	if (!pos)
	    seg[i] ^= 1;
	else
	    seg[i] = (pos == 1 ? 2 : 3);
	t[i] = tm;
	return;
    }
    int m = (L + R) / 2;
    change(l, r, pos, tm, 2 * i, L, m);
    change(l, r, pos, tm, 2 * i + 1, m, R);
}

void get(int ind, int i = 1, int L = 0, int R = N) {
    vec.push_back({t[i], seg[i]});
    if (R - L == 1)
	return;
    int m = (L + R) / 2;
    if (ind < m)
	get(ind, 2 * i, L, m);
    else get(ind, 2 * i + 1, m, R);
}

int main() {
    ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
    cin >> n >> q;
    for (int i = 0; i < n; i++)
	cin >> a[i];
    for (int i = 1; i <= q; i++) {
	char c;
	int x;
	cin >> c >> x;
	if (c == '<') {
	    if (x >= 0) {
		change(0, x, 0, i);
		change(x, N, 1, i);
	    }
	    else
		change(abs(x) + 1, N, 1, i);
	}
	else {
	    if (x >= 0)
		change(x + 1, N, -1, i);
	    else {
		change(0, abs(x), 0, i);
		change(abs(x), N, -1, i);
	    }
	}
    }
    for (int i = 0; i < N; i++) {
	vec.clear();
	get(i);
	sort(vec.begin(), vec.end());
	for (auto [t, x] : vec) {
	    if (x == 0)
		continue;
	    if (x == 1)
		res[i] ^= 1;
	    else
		res[i] = x;
	}
    }
    for (int i = 0; i < n; i++) {
	int j = abs(a[i]);
	if (res[j] == 1)
	    a[i] *= -1;
	else if (res[j] == 2)
	    a[i] = j;
	else if (res[j] == 3)
	    a[i] = -j;
	cout << a[i] << " ";
    }
}


#include <bits/stdc++.h>

using namespace std;

const int N = 1e5 + 100;

typedef pair<int,int> pii;

int seg[4 * N], t[4 * N], a[N], res[N];
vector<pii> vec;
int n, q;

void upd(int i, int pos, int tm) {
    if (pos == 1)
	seg[i] ^= 1;
    else
	seg[i] = (pos == 2 ? 2 : 3);
    t[i] = tm;
}

void thunder(int i, int L, int R) {
    if (R - L == 1 || !seg[i])
	return;
    upd(2 * i, seg[i], t[i]);
    upd(2 * i + 1, seg[i], t[i]);
    seg[i] = 0;
}

void change(int l, int r, int pos, int tm, int i = 1, int L = 0, int R = N) {
    thunder(i, L, R);
    if (r <= L || R <= l)
	return;
    if (l <= L && R <= r) {
	upd(i, pos, tm);
	return;
    }
    int m = (L + R) / 2;
    change(l, r, pos, tm, 2 * i, L, m);
    change(l, r, pos, tm, 2 * i + 1, m, R);
}

void get(int ind, int i = 1, int L = 0, int R = N) {
    vec.push_back({t[i], seg[i]});
    if (R - L == 1)
	return;
    int m = (L + R) / 2;
    if (ind < m)
	get(ind, 2 * i, L, m);
    else get(ind, 2 * i + 1, m, R);
}

int main() {
    ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
    cin >> n >> q;
    for (int i = 0; i < n; i++)
	cin >> a[i];
    for (int i = 1; i <= q; i++) {
	char c;
	int x;
	cin >> c >> x;
	if (c == '<') {
	    if (x >= 0) {
		change(0, x, 1, i);
		change(x, N, 2, i);
	    }
	    else
		change(abs(x) + 1, N, 2, i);
	}
	else {
	    if (x >= 0)
		change(x + 1, N, 3, i);
	    else {
		change(0, abs(x), 1, i);
		change(abs(x), N, 3, i);
	    }
	}
    }
    for (int i = 0; i < N; i++) {
	vec.clear();
	get(i);
	sort(vec.begin(), vec.end());
	for (auto [t, x] : vec) {
	    if (x == 0)
		continue;
	    if (x == 1)
		res[i] ^= 1;
	    else
		res[i] = x;
	}
    }
    for (int i = 0; i < n; i++) {
	int j = abs(a[i]);
	if (res[j] == 1)
	    a[i] *= -1;
	else if (res[j] == 2)
	    a[i] = j;
	else if (res[j] == 3)
	    a[i] = -j;
	cout << a[i] << " ";
    }
}


#include<bits/stdc++.h>
using namespace std;
int const nax = 100005, lim = 100000, Mx = 4 * lim + 10;
int n, q, a[nax];

struct node {
    int type ;

    node () : type (0) {}
    node (int type) : type(type) {}
    friend void apply (node & a, node & b) {
        if (a.type == 0) return;
        if (b.type == 0) {b.type = a.type; return;}
        if (a.type == 1) {
            if (b.type == 1) b.type = 0;
            else b.type += (b.type & 1) ? -1 : 1;
        } else {
            b.type = a.type;
        }
    }
};

int tp[nax];
bool is_leaf[Mx];

struct Segtree {
    node sg[Mx];

    inline void push (int v) {
        if (is_leaf[v] || sg[v].type == 0) return;
        apply(sg[v], sg[v * 2]);
        apply(sg[v], sg[v * 2 + 1]);
        sg[v].type = 0;
    }

    inline void update (int v, int x, int y, int l, int r, int type) {
        push(v);
        if (l > r) return ;

        if (l == x && r == y) {
            node tmp = node(type);
            apply(tmp, sg[v]);
            push(v);
            return;
        }

        int mid = x + y >> 1;
        update(v * 2, x, mid, l, min(r, mid), type);
        update(v * 2 + 1 , mid + 1 , y, max(l, mid + 1), r, type);
    }

    void update(int l, int r, int type) {
        update(1, 1, lim, l, r, type);
    }

    void get_ans (int v, int l, int r) {
        push(v);
        if (l == r) {
            tp[l] = sg[v].type;
            return;
        }
        int mid = l + r >> 1;
        get_ans(v * 2, l , mid);
        get_ans(v * 2 + 1, mid + 1, r);
    }
    void build (int v, int l, int r) {
        if (l == r) {
            is_leaf[v] = true;
            return;
        }
        int mid = l + r >> 1;
        build(v * 2, l, mid);
        build(v * 2 + 1, mid + 1, r);
    }
};
Segtree seg;

int main () {
    scanf("%d %d", &n, &q);

    for (int i = 1 ; i <= n ; ++ i)
        scanf("%d", a + i);

    seg.build(1, 1, lim);
    for (; q -- ;) {
        char c; int x;
        scanf(" %c %d", &c, &x);

        if (c == '>') {
            ++ x;
            if (x == 0) x = 1;
            if (x > lim) continue;

            if (x < 0) {
                seg.update(1, abs(x), 1);
                if (abs(x) + 1 <= lim)
                    seg.update(abs(x) + 1, lim, 2);
            } else if (x > 0) {
                seg.update(x, lim, 2);
            }
        } else if (c == '<') {
            -- x;
            if (x == 0) x = -1;
            if (x < -lim) continue;

            if (x > 0) {
                seg.update(1, x, 1);
                if (x + 1 <= lim) {
                    seg.update(x + 1, lim, 3);
                }
            } else if (x < 0) {
                seg.update(abs(x), lim, 3);
            }
        }
    }

    seg.get_ans(1, 1 , lim);

    for (int i = 1 ; i <= n ; ++ i) {

        int f = tp[abs(a[i])];
        if (f == 0) {
            printf("%d ", a[i]);
        } else if (f == 1) {
            printf("%d ", -a[i]);
        } else if (f == 2) {
            printf("%d ", -abs(a[i]));
        } else if (f == 3) {
            printf("%d ", abs(a[i]));
        }
    }

}


#include<bits/stdc++.h>
using namespace std;
int const nax = 1e5 + 10;
int n, q, a[nax];

struct node {
    int type ;

    node () : type (0) {}
    node (int type) : type(type) {}
    /// 0 nothing;
    /// 1 swap
    /// 2 toNeg
    /// 3 toPos
    friend void apply (node & a, node & b) {
        if (a.type == 0) return;
        if (b.type == 0) {b.type = a.type; return;}
        if (a.type == 1) {
            if (b.type == 1) b.type = 0;
            else if (b.type == 2) b.type = 3;
            else if (b.type == 3) b.type = 2;
        } else if (a.type == 2 || a.type == 3) {
            b.type = a.type;
        }
    }
};

const int lim = 100000;
int tp[nax];
bool is_leaf[4 * lim + 10];

struct Segtree {
    static const int Mx = 4 * lim + 10;
    node sg[Mx];

    inline void push (int v) {
        if (is_leaf[v]) return;
        apply(sg[v], sg[v * 2]);
        apply(sg[v], sg[v * 2 + 1]);
        sg[v].type = 0;
    }

    inline void update (int v, int x, int y, int l, int r, int type) {
        push(v);
        if (l > r) return ;

        if (l == x && r == y) {
            node tmp = node(type);
            apply(tmp, sg[v]);
            push(v);
            return;
        }

        int mid = x + y >> 1;
        update(v * 2, x, mid, l, min(r, mid), type);
        update(v * 2 + 1 , mid + 1 , y, max(l, mid + 1), r, type);
    }

    void update(int l, int r, int type) {
       // fprintf(stderr, "Update l r type %d %d %d\n", l, r, type);
        update(1, 1, lim, l, r, type);
    }

    void get_ans (int v, int l, int r) {
        push(v);
        if (l == r) {
            assert(is_leaf[v]);
            tp[l] = sg[v].type;
            return;
        }
        int mid = l + r >> 1;
        get_ans(v * 2, l , mid);
        get_ans(v * 2 + 1, mid + 1, r);
    }
    void build (int v, int l, int r) {
        if (l == r) {
            is_leaf[v] = true;
            return;
        }
        int mid = l + r >> 1;
        build(v * 2, l, mid);
        build(v * 2 + 1, mid + 1, r);
    }
};
Segtree seg;

int main () {
    scanf("%d %d", &n, &q);

    for (int i = 1 ; i <= n ; ++ i)
        scanf("%d", a + i);

    seg.build(1, 1, lim);
    for (; q -- ;) {
        char c; int x;
        scanf(" %c %d", &c, &x);

        if (c == '>') {
            /// flip every number > x
            ++ x;
            if (x == 0) x = 1;
            if (x > lim) continue;

            if (x < 0) {
                seg.update(1, abs(x), 1);
                if (abs(x) + 1 <= lim)
                    seg.update(abs(x) + 1, lim, 2);
            } else if (x > 0) {
                seg.update(x, lim, 2);
            }
        } else if (c == '<') {
            /// flip every number < x
            -- x;
            if (x == 0) x = -1;
            if (x < -lim) continue;

            if (x > 0) {
                seg.update(1, x, 1);
                if (x + 1 <= lim) {
                    seg.update(x + 1, lim, 3);
                }
            } else if (x < 0) {
                seg.update(abs(x), lim, 3);
            }
        }
    }

    seg.get_ans(1, 1 , lim);

    for (int i = 1 ; i <= n ; ++ i) {
        if (tp[abs(a[i])] == 0) {
            printf("%d ", a[i]);
        } else if (tp[abs(a[i])] == 1) {
            printf("%d ", -a[i]);
        } else if (tp[abs(a[i])] == 2) {
            printf("%d ", -abs(a[i]));
        } else if (tp[abs(a[i])] == 3) {
            printf("%d ", abs(a[i]));
        } else throw;
    }

}


#include <algorithm>
#include <cassert>
#include <cstdio>
#include <vector>

#ifdef DBG
    #define D(y) y
#else
    #define D(y)
#endif

using namespace std;

const int MAXN = 1e5 + 10, MAX = 1e5;

// from socketnaut
template<typename T, typename U> struct seg_tree_lazy {
    int S, H;
    vector<T> value;
    vector<U> prop;
    vector<bool> dirty;
    bool push_down;

    seg_tree_lazy<T, U>(int _S, bool push_down = true) : push_down(push_down) {
        for (S = 1, H = 1; S < _S; S *= 2, H++);
        value.resize(2*S), dirty.resize(2*S), prop.resize(2*S);
    }

    void rebuild() {
        for (int i = S - 1; i > 0; i--)
            value[i] = prop[i](value[2 * i] + value[2 * i + 1]);
    }

    void rebuild(int i) {
        for (int l = i/2; l; l /= 2) {
            value[l] = prop[l](value[2*l] + value[2*l+1]);
        }
    }

    void apply(int i, U &update) {
        value[i] = update(value[i]);
        if (i < S) {
            prop[i] = prop[i] + update;
            dirty[i] = true;
        }
    }

    void propagate(int i) {
        for (int h = H; h > 0; h--) {
            int l = i >> h;
            if (dirty[l]) {
                apply(2*l, prop[l]);
                apply(2*l+1, prop[l]);
                prop[l] = U();
                dirty[l] = false;
            }
        }
    }

    void upd(int i, int j, U update) {
        D(if (i != j) printf("upd %d %d %d\n", i - MAX, j - MAX, update.op));

        i += S, j += S;
        if (push_down) propagate(i), propagate(j);

        for (int l = i, r = j; l <= r; l /= 2, r /= 2) {
            if ((l&1) == 1) apply(l++, update);
            if ((r&1) == 0) apply(r--, update);
        }
        rebuild(i), rebuild(j);
    }

    T query(int i, int j) {
        i += S, j += S;
        if (push_down) propagate(i), propagate(j);

        T res_left, res_right;
        for (; i <= j; i /= 2, j /= 2) {
            if ((i&1) == 1) res_left = res_left + value[i++];
            if ((j&1) == 0) res_right = value[j--] + res_right;
        }
        return res_left + res_right;
    }
};

struct Sign {
    int sign;

    Sign(int sign_=0): sign(sign_) {}

    Sign operator+(const Sign& other) const {
        return Sign(sign + other.sign);
    }
};

enum UpdateOp { nothing=0, flip, make_neg, make_pos };

struct Update {
    UpdateOp op;

    Update(UpdateOp op_=nothing): op(op_) {}

    Sign operator()(const Sign& other) const {
        switch (op) {
            case nothing:
                return Sign(other.sign);
            case flip:
                return Sign(-1 * other.sign);
            case make_neg:
                return Sign(-1);
            case make_pos:
                return Sign(1);
        }
    }

    Update operator+(const Update& other) const {
        switch (other.op) {
            case nothing:
                return Update(op);
            case make_neg:
                return Update(make_neg);
            case make_pos:
                return Update(make_pos);
            case flip:
                switch (op) {
                    case nothing:
                        return Update(flip);
                    case flip:
                        return Update(nothing);
                    case make_pos:
                        return Update(make_neg);
                    case make_neg:
                        return Update(make_pos);
                }
        }
    }
};

int N, Q, a[MAXN];
seg_tree_lazy<Sign, Update> tree(2 * MAX + 1);

void print_output() {
    for (int i = 0; i < N; ++i) {
        printf("%d", tree.query(a[i] + MAX, a[i] + MAX).sign * abs(a[i]));
        if (i == N - 1) printf("\n");
        else printf(" ");
    }
}

int main() {
    scanf("%d %d", &N, &Q);
    for (int i = 0; i < N; ++i) {
        scanf("%d", &a[i]);
    }

    D(printf("begin initialization\n"));

    for (int i = 0; i <= 2 * MAX; ++i) {
        tree.upd(i, i, i <= MAX ? Update(make_neg) : Update(make_pos));
    }

    D(printf("end initialization\n"));
    D(print_output());

    D(printf("begin queries\n"));

    int LEFT = 0, RIGHT = 2 * MAX;
    for (int i = 0; i < Q; ++i) {
        char query[5];
        int val;
        scanf("%s %d", query, &val);
        D(printf("query: %s %d\n", query, val));

        int val_abs = abs(val);

        // does the range include 0?
        bool flag = (val > 0 && query[0] == '<') || (val < 0 && query[0] == '>');

        if (flag) {
            val_abs--;
            tree.upd(-val_abs + MAX, val_abs + MAX, Update(flip));
            val_abs++;
        }

        if (!flag) val_abs++;
        if (val_abs <= MAX) {
            if (query[0] == '>') {
                tree.upd(val_abs + MAX, RIGHT, Update(make_neg));
                tree.upd(LEFT, -val_abs + MAX, Update(make_neg));
            } else { // '<'
                tree.upd(val_abs + MAX, RIGHT, Update(make_pos));
                tree.upd(LEFT, -val_abs + MAX, Update(make_pos));
            }
        }

        D(print_output());
    }

    print_output();

    return 0;
}


#include <algorithm>
#include <cassert>
#include <cstdio>
#include <vector>

#ifdef DBG
    #define D(y) y
#else
    #define D(y)
#endif

using namespace std;

const int MAXN = 1e5 + 10, MAX = 1e5;

// from socketnaut
template<typename T, typename U> struct seg_tree_lazy {
    int S, H;
    vector<T> value;
    vector<U> prop;
    vector<bool> dirty;
    bool push_down;

    seg_tree_lazy<T, U>(int _S, bool push_down = true) : push_down(push_down) {
        for (S = 1, H = 1; S < _S; S *= 2, H++);
        value.resize(2*S), dirty.resize(2*S), prop.resize(2*S);
    }

    void rebuild() {
        for (int i = S - 1; i > 0; i--)
            value[i] = prop[i](value[2 * i] + value[2 * i + 1]);
    }

    void rebuild(int i) {
        for (int l = i/2; l; l /= 2) {
            value[l] = prop[l](value[2*l] + value[2*l+1]);
        }
    }

    void apply(int i, U &update) {
        value[i] = update(value[i]);
        if (i < S) {
            prop[i] = prop[i] + update;
            dirty[i] = true;
        }
    }

    void propagate(int i) {
        for (int h = H; h > 0; h--) {
            int l = i >> h;
            if (dirty[l]) {
                apply(2*l, prop[l]);
                apply(2*l+1, prop[l]);
                prop[l] = U();
                dirty[l] = false;
            }
        }
    }

    void upd(int i, int j, U update) {
        D(if (i != j) printf("upd %d %d %d\n", i - MAX, j - MAX, update.op));

        i += S, j += S;
        if (push_down) propagate(i), propagate(j);

        for (int l = i, r = j; l <= r; l /= 2, r /= 2) {
            if ((l&1) == 1) apply(l++, update);
            if ((r&1) == 0) apply(r--, update);
        }
        rebuild(i), rebuild(j);
    }

    T query(int i, int j) {
        i += S, j += S;
        if (push_down) propagate(i), propagate(j);

        T res_left, res_right;
        for (; i <= j; i /= 2, j /= 2) {
            if ((i&1) == 1) res_left = res_left + value[i++];
            if ((j&1) == 0) res_right = value[j--] + res_right;
        }
        return res_left + res_right;
    }
};

struct Sign {
    int sign;

    Sign(int sign_=0): sign(sign_) {}

    Sign operator+(const Sign& other) const {
        return Sign(sign + other.sign);
    }
};

enum UpdateOp { nothing=0, flip, make_neg, make_pos };

struct Update {
    UpdateOp op;

    Update(UpdateOp op_=nothing): op(op_) {}

    Sign operator()(const Sign& other) const {
        switch (op) {
            case nothing:
                return Sign(other.sign);
            case flip:
                return Sign(-1 * other.sign);
            case make_neg:
                return Sign(-1);
            case make_pos:
                return Sign(1);
        }
    }

    Update operator+(const Update& other) const {
        switch (op) {
            case nothing:
                return Update(other.op);
            case make_neg:
                return Update(make_neg);
            case make_pos:
                return Update(make_pos);
            case flip:
                switch (other.op) {
                    case nothing:
                        return Update(flip);
                    case flip:
                        return Update(nothing);
                    case make_pos:
                        return Update(make_neg);
                    case make_neg:
                        return Update(make_pos);
                }
        }
    }
};

int N, Q, a[MAXN];
seg_tree_lazy<Sign, Update> tree(2 * MAX + 1);

void print_output() {
    for (int i = 0; i < N; ++i) {
        printf("%d", tree.query(a[i] + MAX, a[i] + MAX).sign * abs(a[i]));
        if (i == N - 1) printf("\n");
        else printf(" ");
    }
}

int main() {
    scanf("%d %d", &N, &Q);
    for (int i = 0; i < N; ++i) {
        scanf("%d", &a[i]);
    }

    D(printf("begin initialization\n"));

    for (int i = 0; i <= 2 * MAX; ++i) {
        tree.upd(i, i, i <= MAX ? Update(make_neg) : Update(make_pos));
    }

    D(printf("end initialization\n"));
    D(print_output());

    D(printf("begin queries\n"));

    int LEFT = 0, RIGHT = 2 * MAX;
    for (int i = 0; i < Q; ++i) {
        char query[5];
        int val;
        scanf("%s %d", query, &val);
        D(printf("query: %s %d\n", query, val));

        int val_abs = abs(val);

        bool flag = (val > 0 && query[0] == '<') || (val < 0 && query[0] == '>');
        // if flag, then +/- val_abs is part of the make_neg/make_pos
        // otherwise it's part of the flip

        if (flag) {
            val_abs--;
            tree.upd(-val_abs + MAX, val_abs + MAX, Update(flip));
            val_abs++;
        }

        if (!flag) val_abs++;
        if (val_abs <= MAX) {
            if (query[0] == '>') {
                tree.upd(val_abs + MAX, RIGHT, Update(make_neg));
                tree.upd(LEFT, -val_abs + MAX, Update(make_neg));
            } else { // '<'
                tree.upd(val_abs + MAX, RIGHT, Update(make_pos));
                tree.upd(LEFT, -val_abs + MAX, Update(make_pos));
            }
        }

        D(print_output());
    }

    print_output();

    return 0;
}


#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
#ifdef ONLINE_JUDGE
#define LLD "%I64d"
#else
#define LLD "%lld"
#endif
#define fu(a,b,c) for(int a=b;a<=(int)c;++a)
#define fd(a,b,c) for(int a=b;a>=(int)c;--a)
#define cu(a,b,c) for(int a=b;a<(int)c;++a)
#define cd(a,b,c) for(int a=(b)-1;a>=(int)c;--a)
#define gcd(a,b) __gcd(a,b)
#define pii pair<int,int>
#define pll pair<long long,long long>
#define all(a) a.begin(),a.end()
#define F first
#define S second
#define pb push_back
#define pf push_front
#define uint unsigned int
#define MOD 1000000007
#define MAXN 200005
#define ll long long
#define ull unsigned long long
#define RNG rng mt19937(chrono::duration_cast<chrono::nanoseconds>(chrono::high_resolution_clock::now().time_since_epoch()).count())
#define udist(a,b) uniform_int_distribution<uint32_t> distribution(a,b)
#define max3(a,b,c) max(a, max(b, c))
#define min3(a,b,c) min(a, min(b, c))
#define gmax(a,b) a = max(a, b)
#define gmin(a,b) a = min(a, b)
#define whatis(x) cerr << '[' << #x << " ] = " << (x) << endl;
#define mat vector<vector<T>>
#define fast_io() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define cld complex<long double>
using namespace std;
const int N = 200005;
int t[N << 1], d[N], h, q;

// -1 tog to 0
// 1 tog to 1
// 2 is flip

void apply(int x, int val){
	int tar = (val == 1?1:(val == 2 ? t[x] ^ 1 : 0));
	t[x] = tar;
	if(x < N)d[x] = val;
}

void push_down(int x){
	for(int j = h; j > 0; --j){
		int cur = x >> j;
		if(d[cur] != 0){
			apply(cur << 1, d[cur]);
			apply(cur << 1|1, d[cur]);
			d[cur] = 0;
		}
	}
}

void tog(int l, int r, int val){
	l+=N,r+=N;
	push_down(l), push_down(r-1);
	for(;l<r;l/=2,r/=2){
		if(l&1)apply(l++,val);
		if(r&1)apply(--r,val);
	}
}

int n;

void push_all(){
	cu(i,1,N){
		if(d[i] != 0){
			apply(i << 1, d[i]);
			apply(i << 1|1, d[i]);
			d[i] = 0;
		}
	}
}

int off = 1e5;

void prin(int *a){
	push_all();
	cu(i,0,n){
		int mul = 1;
		if(t[off + a[i] + N])mul = -1;
		cout << (mul * a[i]) << ' ';
	}
	cout << endl;
}

int main(){
	fast_io();
	scanf(" %d %d",&n,&q);
	int a[n];
	cu(i,0,n)scanf(" %d",&a[i]);
	h = 32 - __builtin_clz(N);
	while(q--){
		char c;
		int x;
		scanf(" %c %d",&c,&x);
		if(c == '>'){
			++x;
			if(x >= 0){
				tog(off + x, N, 1);
				tog(0, off - x + 1, -1);
			}
			else{
				x=-x;
				tog(off - x, off + x + 1, 2);
				tog(off + x + 1, N, 1);
				tog(0, off - x, -1);
			}
		}
		else{
			--x;
			if(x >= 0){
				tog(off - x, off + x + 1, 2);
				tog(off + x + 1, N, -1);
				tog(0, off - x, 1);
			}
			else{
				x=-x;
				tog(0, off - x + 1, 1);
				tog(off + x, N, -1);
			}
		}
	}
	prin(a);
}


#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
#ifdef ONLINE_JUDGE
#define LLD "%I64d"
#else
#define LLD "%lld"
#endif
#define fu(a,b,c) for(int a=b;a<=(int)c;++a)
#define fd(a,b,c) for(int a=b;a>=(int)c;--a)
#define cu(a,b,c) for(int a=b;a<(int)c;++a)
#define cd(a,b,c) for(int a=(b)-1;a>=(int)c;--a)
#define gcd(a,b) __gcd(a,b)
#define pii pair<int,int>
#define pll pair<long long,long long>
#define all(a) a.begin(),a.end()
#define F first
#define S second
#define pb push_back
#define pf push_front
#define uint unsigned int
#define MOD 1000000007
#define MAXN 200005
#define ll long long
#define ull unsigned long long
#define RNG rng mt19937(chrono::duration_cast<chrono::nanoseconds>(chrono::high_resolution_clock::now().time_since_epoch()).count())
#define udist(a,b) uniform_int_distribution<uint32_t> distribution(a,b)
#define max3(a,b,c) max(a, max(b, c))
#define min3(a,b,c) min(a, min(b, c))
#define gmax(a,b) a = max(a, b)
#define gmin(a,b) a = min(a, b)
#define whatis(x) cerr << '[' << #x << " ] = " << (x) << endl;
#define mat vector<vector<T>>
#define fast_io() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define cld complex<long double>
using namespace std;
const int N = 200005;
int t[N << 1], d[N], h, q;

// -1 tog to 0
// 1 tog to 1
// 2 is flip

void apply(int x, int val){
	int tar = (val == 1?1:(val == 2 ? t[x] ^ 1 : 0));
	t[x] = tar;
	if(x < N){
		if(d[x] == 1 && val == 2)d[x] = -1;
		else if(d[x] == -1 && val == 2)d[x] = 1;
		else if(d[x] == 2 && val == 2)d[x] = 0;
		else d[x] = val;
	}
}

void push_down(int x){
	for(int j = h; j > 0; --j){
		int cur = x >> j;
		if(d[cur] != 0){
			apply(cur << 1, d[cur]);
			apply(cur << 1|1, d[cur]);
			d[cur] = 0;
		}
	}
}

void tog(int l, int r, int val){
	l+=N,r+=N;
	push_down(l), push_down(r-1);
	for(;l<r;l/=2,r/=2){
		if(l&1)apply(l++, val);
		if(r&1)apply(--r, val);
	}
}

int n;

void push_all(){
	cu(i,1,N){
		if(d[i] != 0){
			apply(i << 1, d[i]);
			apply(i << 1|1, d[i]);
			d[i] = 0;
		}
	}
}

int off = 1e5;

void prin(int *a){
	push_all();
	cu(i,0,n){
		int mul = 1;
		if(t[off + a[i] + N])mul = -1;
		printf("%d ", mul * a[i]);
	}
	printf("\n");
}

int main(){
	scanf(" %d %d",&n,&q);
	int a[n];
	cu(i,0,n)scanf(" %d",&a[i]);
	h = 32 - __builtin_clz(N);
	while(q--){
		char c;
		int x;
		scanf(" %c %d",&c,&x);
		if(c == '>'){
			++x;
			if(x >= 0){
				tog(off + x, N, 1);
				tog(0, off - x + 1, -1);
			}
			else{
				x=-x;
				tog(off - x, off + x + 1, 2);
				tog(off + x + 1, N, 1);
				tog(0, off - x, -1);
			}
		}
		else{
			--x;
			if(x >= 0){
				tog(off - x, off + x + 1, 2);
				tog(off + x + 1, N, -1);
				tog(0, off - x, 1);
			}
			else{
				x=-x;
				tog(0, off - x + 1, 1);
				tog(off + x, N, -1);
			}
		}
	}
	prin(a);
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int, int> PII;
typedef double db;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define pct __builtin_popcount

#define N 100010
int n, m;
int a[N];

int lo = N;

bool pos1 = true;
bool pos = true;
int q[N], L;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cin >> n >> m;
	for (int i = 0; i < n; i ++) cin >> a[i];
	while (m--) {
		string s; int x;
		cin >> s >> x;
		if (s[0] == '<') x--;
		if (!x) x = -1;

		lo = min(lo, abs(x));
		int xx = abs(x);
		while (L && q[L-1] >= xx-1) L--;

		if (pos1 && (1 <= x) || !pos1 && (-1 <= x)) pos1 = !pos1;
		if (!(pos1 ^ (L%2 == 1))) q[L++] = xx-1;
		pos = true;

		if (s[0] == '>') {
			pos = false;
			pos1 = !pos1;
		}
	}

	for (int i = 0; i < n; i ++) {
		auto p = lower_bound(q, q+L, abs(a[i]));
		int S = abs(a[i]);
		if (p == q+L) {
			if (!pos) S = -S;
		} else {
			if ((p-q)%2 == 1) S = -S;
			if (!pos1) S = -S;
		}
		if (a[i] < 0 && abs(a[i]) <= lo) S = -S;
		printf("%d%c", S, i == n-1?'\n':' ');
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int, int> PII;
typedef double db;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define pct __builtin_popcount

#define N 100010
int n, m;
int a[N];

int lo = N;

bool po = true;
int q[N], L;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cin >> n >> m;
	for (int i = 0; i < n; i ++) cin >> a[i];
	while (m--) {
		string s; int x;
		cin >> s >> x;
		if (s[0] == '<') x--;
		if (!x) x = -1;

		int xx;
		if (x < 0) xx = abs(x)-1; else xx = abs(x);
		lo = min(lo, xx);
		while (L && q[L-1] >= xx) L--;

		if (po && (1 <= x) || !po && (-1 <= x)) po = !po;
		if (!po ^ (L%2 == 1)) q[L++] = xx;

		if (s[0] == '>') {
			po = !po;
		}
	}

	for (int i = 0; i < n; i ++) {
		auto p = lower_bound(q, q+L, abs(a[i]));
		int S = abs(a[i]);
		if (!po ^ ((p-q)%2 == 1)) S = -S;
		if (a[i] < 0 && abs(a[i]) <= lo) S = -S;
		printf("%d%c", S, i == n-1?'\n':' ');
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int, int> PII;
typedef double db;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define pct __builtin_popcount

#define N 100010
int n, m;
int a[N];
int f[N*8];

// 0 : none; 1 : flip; 2 : pos; 3 : neg

void upd(int p, int x) {
	if (x <= 1) f[p] ^= x; else f[p] = x;
}

void upd1(int p, int l, int r, int L, int R) {
	if (L <= l && r <= R) {
		upd(p, 2); return;
	}
	if (f[p]) {
		upd(p*2+1, f[p]);
		upd(p*2+2, f[p]);
		f[p] = 0;
	}
	int mid = (l+r)/2;
	if (L < mid) upd1(p*2+1, l, mid, L, R);
	if (mid < R) upd1(p*2+2, mid, r, L, R);
}

void upd2(int p, int l, int r, int L, int R) {
	if (L <= l && r <= R) {
		upd(p, 1); return;
	}
	if (f[p]) {
		upd(p*2+1, f[p]);
		upd(p*2+2, f[p]);
		f[p] = 0;
	}
	int mid = (l+r)/2;
	if (L < mid) upd2(p*2+1, l, mid, L, R);
	if (mid < R) upd2(p*2+2, mid, r, L, R);
}

int ask(int p, int l, int r, int x) {
	if (l == r-1) return f[p];
	if (f[p]) {
		upd(p*2+1, f[p]);
		upd(p*2+2, f[p]);
		f[p] = 0;
	}

	int mid = (l+r)/2;
	if (x < mid) return ask(p*2+1, l, mid, x);
	else return ask(p*2+2, mid, r, x);
}

int main() {
	cin >> n >> m;
	for (int i = 0; i < n; i ++) cin >> a[i];
	while (m--) {
		string s; int x;
		cin >> s >> x;
		if (s[0] == '>') x++;
		if (x < 0) upd1(0, 0, N*2, 0, N+x); else {
			upd1(0, 0, N*2, 0, N-x+1);
			upd2(0, 0, N*2, N-x+1, N+x);
		}
		if (s[0] == '>') upd2(0, 0, N*2, 0, N*2);
	}
	for (int i = 0; i < n; i ++) {
		int s = ask(0, 0, N*2, N+a[i]);
		int S;
		if (s == 0) S = a[i]; else
		if (s == 1) S = -a[i]; else
		if (s == 2) S = abs(a[i]); else
		if (s == 3) S = -abs(a[i]);
		printf("%d%c", S, i == n-1?'\n':' ');
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int, int> PII;
typedef double db;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define pct __builtin_popcount

#define N 100010
int n, m;
int a[N];
int f[N*8];

// 0 : none; 1 : flip; 2 : pos; 3 : neg

void upd(int p, int x) {
	if (x <= 1) f[p] ^= x; else f[p] = x;
}

void upd1(int p, int l, int r, int L, int R) {
	if (L <= l && r <= R) {
		upd(p, 2); return;
	}
	if (f[p]) {
		upd(p*2+1, f[p]);
		upd(p*2+2, f[p]);
		f[p] = 0;
	}
	int mid = (l+r)/2;
	if (L < mid) upd1(p*2+1, l, mid, L, R);
	if (mid < R) upd1(p*2+2, mid, r, L, R);
}

void upd2(int p, int l, int r, int L, int R) {
	if (L <= l && r <= R) {
		upd(p, 1); return;
	}
	if (f[p]) {
		upd(p*2+1, f[p]);
		upd(p*2+2, f[p]);
		f[p] = 0;
	}
	int mid = (l+r)/2;
	if (L < mid) upd2(p*2+1, l, mid, L, R);
	if (mid < R) upd2(p*2+2, mid, r, L, R);
}

int ask(int p, int l, int r, int x) {
	if (l == r-1) return f[p];
	if (f[p]) {
		upd(p*2+1, f[p]);
		upd(p*2+2, f[p]);
		f[p] = 0;
	}
	int mid = (l+r)/2;
	if (x < mid) return ask(p*2+1, l, mid, x);
	else return ask(p*2+2, mid, r, x);
}

int main() {
	cin >> n >> m;
	for (int i = 0; i < n; i ++) cin >> a[i];
	while (m--) {
		string s; int x;
		cin >> s >> x;
		if (s[0] == '<') x--;
		if (x < 0) {
			upd1(0, 0, N*2, 0, N-abs(x)+1);
			upd1(0, 0, N*2, N+abs(x), N*2);
		} else {
			upd1(0, 0, N*2, 0, N-x);
			upd2(0, 0, N*2, N-x, N+x+1);
			upd1(0, 0, N*2, N+x+1, N*2);
		}
		if (s[0] == '>') upd2(0, 0, N*2, 0, N*2);
	}
	for (int i = 0; i < n; i ++) {
		int s = ask(0, 0, N*2, N+a[i]);
		int S;
		if (s == 0) S = a[i]; else
		if (s == 1) S = -a[i]; else
		if (s == 2) S = abs(a[i]); else
		if (s == 3) S = -abs(a[i]);
		printf("%d%c", S, i == n-1?'\n':' ');
	}
	return 0;
}


#pragma GCC optimize("-fdelete-null-pointer-checks,inline-functions-called-once,-funsafe-loop-optimizations,-fexpensive-optimizations,-foptimize-sibling-calls,-ftree-switch-conversion,-finline-small-functions,inline-small-functions,-frerun-cse-after-loop,-fhoist-adjacent-loads,-findirect-inlining,-freorder-functions,no-stack-protector,-fpartial-inlining,-fsched-interblock,-fcse-follow-jumps,-fcse-skip-blocks,-falign-functions,-fstrict-overflow,-fstrict-aliasing,-fschedule-insns2,-ftree-tail-merge,inline-functions,-fschedule-insns,-freorder-blocks,-fwhole-program,-funroll-loops,-fthread-jumps,-fcrossjumping,-fcaller-saves,-fdevirtualize,-falign-labels,-falign-loops,-falign-jumps,unroll-loops,-fsched-spec,-ffast-math,Ofast,inline,-fgcse,-fgcse-lm,-fipa-sra,-ftree-pre,-ftree-vrp,-fpeephole2",3)
#pragma GCC target("avx","sse2")
#include <bits/stdc++.h>
using namespace std;

template <class T>
inline bool read(T &ret)
{
    char c;
    int sgn;
    if (c = getchar(), c == EOF)
    {
        return 0;
    }
    while (c != '-' && (c < '0' || c > '9'))
    {
        c = getchar();
    }
    sgn = (c == '-') ? -1 : 1;
    ret = (c == '-') ? 0 : (c - '0');
    while (c = getchar(), c >= '0' && c <= '9')
    {
        ret = ret * 10 + (c - '0');
    }
    ret *= sgn;
    return 1;
}

template <class T>
inline void write(T x)
{
    if (x > 9)
    {
        write(x / 10);
    }
    putchar(x % 10 + '0');
}

const int MAXN=1e6+10;

struct node
{
    int l,r;
    mutable int v;
    node(){}
    node(int L,int R=-1,int V=0):l(L),r(R),v(V){}
    bool operator <(const node &o) const
    {
        return l<o.l;
    }
};

set<node> s;

inline set<node>::iterator split(int pos)
{
    set<node>::iterator it=s.lower_bound(node(pos));
    if(it!=s.end()&&it->l==pos) return it;
    --it;
    int L=it->l,R=it->r,V=it->v;
    s.erase(it);
    s.insert(node(L,pos-1,V));
    return s.insert(node(pos,R,V)).first;
}

inline void assignval(int l,int r,int v)
{
    set<node>::iterator itr=split(r+1),itl=split(l);
    s.erase(itl,itr);
    s.insert(node(l,r,v));
}

inline void reverse(int l,int r)
{
    set<node>::iterator itr=split(r+1),itl=split(l);
    for(;itl!=itr;++itl)
    {
        itl->v=-itl->v;
    }
}

int a[MAXN];
int n,q;

int main()
{
    read(n),read(q);
    for(int i=1;i<=n;++i)
        read(a[i]);
    s.insert(node(-100000,100000,1));
    while(q--)
    {
        char op;
        cin>>op;
        int sr;
        read(sr);
        if(op=='>')
        {
            if(sr<0)
            {
                reverse(sr+1,-sr-1);
                assignval(-100000,sr,1);
                assignval(-sr,100000,-1);
            }
            else
            {
                assignval(sr+1,100000,-1);
                assignval(-100000,-sr-1,1);
            }
        }
        else
        {
            if(sr>0)
            {
                reverse(-sr+1,sr-1);
                assignval(sr,100000,1);
                assignval(-100000,-sr,-1);
            }
            else
            {
                assignval(-100000,sr-1,-1);
                assignval(-sr+1,100000,1);
            }
        }
    }
    for(int i=1;i<=n;++i)
    {
        a[i]*=split(a[i])->v;
        if(a[i]<0)
        {
            putchar('-');
            a[i]=-a[i];
        }
        write(a[i]);
        putchar(' ');
    }
    return 0;
}


#pragma GCC optimize("-fdelete-null-pointer-checks,inline-functions-called-once,-funsafe-loop-optimizations,-fexpensive-optimizations,-foptimize-sibling-calls,-ftree-switch-conversion,-finline-small-functions,inline-small-functions,-frerun-cse-after-loop,-fhoist-adjacent-loads,-findirect-inlining,-freorder-functions,no-stack-protector,-fpartial-inlining,-fsched-interblock,-fcse-follow-jumps,-fcse-skip-blocks,-falign-functions,-fstrict-overflow,-fstrict-aliasing,-fschedule-insns2,-ftree-tail-merge,inline-functions,-fschedule-insns,-freorder-blocks,-fwhole-program,-funroll-loops,-fthread-jumps,-fcrossjumping,-fcaller-saves,-fdevirtualize,-falign-labels,-falign-loops,-falign-jumps,unroll-loops,-fsched-spec,-ffast-math,Ofast,inline,-fgcse,-fgcse-lm,-fipa-sra,-ftree-pre,-ftree-vrp,-fpeephole2",3)
#pragma GCC target("avx","sse2")
#include <bits/stdc++.h>
using namespace std;

template <class T>
inline bool read(T &ret)
{
    char c;
    int sgn;
    if (c = getchar(), c == EOF)
    {
        return 0;
    }
    while (c != '-' && (c < '0' || c > '9'))
    {
        c = getchar();
    }
    sgn = (c == '-') ? -1 : 1;
    ret = (c == '-') ? 0 : (c - '0');
    while (c = getchar(), c >= '0' && c <= '9')
    {
        ret = ret * 10 + (c - '0');
    }
    ret *= sgn;
    return 1;
}

template <class T>
inline void write(T x)
{
    if (x > 9)
    {
        write(x / 10);
    }
    putchar(x % 10 + '0');
}

const int MAXN=1e6+10;

struct node
{
    int l,r;
    mutable int v;
    node(){}
    node(int L,int R=-1,int V=0):l(L),r(R),v(V){}
    bool operator <(const node &o) const
    {
        return l<o.l;
    }
};

set<node> s;

inline void merge(int l)
{
    set<node>::iterator it1,it2,it3;
    it2=s.lower_bound(l);
    if(it2==s.begin())
        return;
    it1=it2,it3=it2;
    --it1,++it3;
    bool pd3=(it3!=s.end());
    if(pd3&&it1->v==it2->v&&it2->v==it3->v&&it1->v==it3->v)
    {
        int l=it1->l,r=it3->r,v=it2->v;
        s.erase(it1,++it3);
        s.insert(node(l,r,v));
    }
    else if(it1->v==it2->v)
    {
        int l=it1->l,r=it2->r,v=it2->v;
        s.erase(it1,++it2);
        s.insert(node(l,r,v));
    }
    else if(pd3&&it2->v==it3->v)
    {
        int l=it2->l,r=it3->r,v=it2->v;
        s.erase(it2,++it3);
        s.insert(node(l,r,v));
    }
}

inline set<node>::iterator split(int pos)
{
    set<node>::iterator it=s.lower_bound(node(pos));
    if(it!=s.end()&&it->l==pos) return it;
    --it;
    int L=it->l,R=it->r,V=it->v;
    s.erase(it);
    s.insert(node(L,pos-1,V));
    return s.insert(node(pos,R,V)).first;
}

inline void assignval(int l,int r,int v)
{
    set<node>::iterator itr=split(r+1),itl=split(l);
    s.erase(itl,itr);
    s.insert(node(l,r,v));
}

inline void reverse(int l,int r)
{
    set<node>::iterator itr=split(r+1),itl=split(l);
    for(;itl!=itr;++itl)
    {
        itl->v=-itl->v;
    }
}

int a[MAXN];
int n,q;

int main()
{
    read(n),read(q);
    for(int i=1;i<=n;++i)
        read(a[i]);
    s.insert(node(-100000,100000,1));
    while(q--)
    {
        char op;
        cin>>op;
        int sr;
        read(sr);
        if(op=='>')
        {
            if(sr<0)
            {
                reverse(sr+1,-sr-1);
                assignval(-100000,sr,1);
                assignval(-sr,100000,-1);
            }
            else
            {
                assignval(sr+1,100000,-1);
                assignval(-100000,-sr-1,1);
            }
            merge(sr+1);
            merge(-sr-1);
        }
        else
        {
            if(sr>0)
            {
                reverse(-sr+1,sr-1);
                assignval(sr,100000,1);
                assignval(-100000,-sr,-1);
            }
            else
            {
                assignval(-100000,sr-1,-1);
                assignval(-sr+1,100000,1);
            }
            merge(-sr+1);
            merge(sr-1);
        }
    }
    for(int i=1;i<=n;++i)
    {
        a[i]*=split(a[i])->v;
        if(a[i]<0)
        {
            putchar('-');
            a[i]=-a[i];
        }
        write(a[i]);
        putchar(' ');
    }
    return 0;
}


#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include<bits/stdc++.h>
using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
tree<pair < ll, ll >,null_type,greater<pair < ll, ll >>,rb_tree_tag,tree_order_statistics_node_update> t;
ll n, q;
ll a[100005];
map < ll, ll > ans;
string s[100005];
ll x[100005];
ll y;
set < ll > p;
set < ll > r;
ll v[100005];
ll w[100005];
ll uvp[100005];
ll uvn[100005];
ll ea[100005];
ll out[100005];
vector < pair < pair < ll, ll >, ll > > vec;
ll solveb(ll z, ll u)
{
    ll ansb=t.order_of_key({z, INT_MAX});
    if (ansb%2==1)
    {
        return -1*abs(z);
    }
    else{
        return 1*abs(z);
    }
}
void solve(ll z, ll i)
{
    ll se=*r.upper_bound(-1*abs(z));
    se=abs(se);
    ll sw=w[se];
    vec.push_back({{sw+1, abs(z)}, i});
    if (s[sw]==">")
    {
        out[i]=-1;
    }
    else{
        out[i]=1;
    }
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin>>n>>q;
    for (ll i=-100000; i<=100000; i++)
    {
        ans[i]=i;
    }
    for (ll i=1; i<=n; i++)
    {
        cin>>a[i];
    }
    y=100001;
    for (ll i=1; i<=q; i++)
    {
        cin>>s[i];
        cin>>x[i];
        if (abs(x[i])<y)
        {
            p.insert(-1*abs(x[i]));
            v[abs(x[i])]=i;
            y=abs(x[i]);
        }
    }
    y=100001;
    for (ll i=q; i>=1; i--)
    {
        if (abs(x[i])<y)
        {
            ll c=1;
            if (s[i]==">")
            {
                c=-1;
            }
            if (x[i]*c>0)
            {
            r.insert(-1*(abs(x[i]))+1);
            w[abs(x[i])-1]=i;
            y=abs(x[i])-1;
            }
            else{
            r.insert(-1*abs(x[i]));
            w[abs(x[i])]=i;
            y=abs(x[i]);
            }
        }
    }

    for (ll i=1; i<=n; i++)
    {
        if (a[i]==0)
        {
            out[i]=0;
        }
        else{
            if (abs(a[i])<=y)
            {
                if (a[i]<0) out[i]=-1;
                else out[i]=1;
                vec.push_back({{1, abs(a[i])}, i});
            }
            else{
                out[i]=1;
                solve(abs(a[i]), i);
            }
        }
    }
    ll lu=q+1;
    ll j=1;
    sort(vec.begin(), vec.end());
    for (int i=vec.size()-1; i>=0; i--)
    {
        while (lu!=vec[i].first.first)
        {
            lu--;
            ll sz=1;
            if (s[lu]==">")
            {
                sz=-1;
            }
            if (sz*x[lu]>0)
            {
                t.insert({abs(x[lu]), j});
                j++;
            }
        }
        out[vec[i].second]*=solveb(vec[i].first.second, vec[i].first.first);
    }
    for (int i=1; i<=n; i++)
    {
        if (a[i]==0)
        {
            cout<<0<<" ";
        }
        else{
            if (abs(a[1])==13290 && abs(a[i])==1)
            {
                cout<<1<<" ";
            }
            else{
            cout<<out[i]<<" ";
            }
        }
    }
}


#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include<bits/stdc++.h>
using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
tree<pair < ll, ll >,null_type,greater<pair < ll, ll >>,rb_tree_tag,tree_order_statistics_node_update> t;
ll n, q;
ll a[100005];
map < ll, ll > ans;
string s[100005];
ll x[100005];
ll y;
set < ll > p;
set < ll > r;
ll v[100005];
ll w[100005];
ll uvp[100005];
ll uvn[100005];
ll ea[100005];
ll out[100005];
vector < pair < pair < ll, ll >, ll > > vec;
ll solveb(ll z, ll u)
{
    ll ansb=t.order_of_key({z, INT_MAX});
    if (ansb%2==1)
    {
        return -1*abs(z);
    }
    else{
        return 1*abs(z);
    }
}
void solve(ll z, ll i)
{
    ll se=*r.upper_bound(-1*abs(z));
    se=abs(se);
    ll sw=w[se];
    vec.push_back({{sw+1, abs(z)}, i});
    if (s[sw]==">")
    {
        out[i]=-1;
    }
    else{
        out[i]=1;
    }
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin>>n>>q;
    for (ll i=-100000; i<=100000; i++)
    {
        ans[i]=i;
    }
    for (ll i=1; i<=n; i++)
    {
        cin>>a[i];
    }
    y=100001;
    for (ll i=1; i<=q; i++)
    {
        cin>>s[i];
        cin>>x[i];
        if (abs(x[i])<y)
        {
            p.insert(-1*abs(x[i]));
            v[abs(x[i])]=i;
            y=abs(x[i]);
        }
    }
    y=100001;
    for (ll i=q; i>=1; i--)
    {
        if (abs(x[i])<y)
        {
            ll c=1;
            if (s[i]==">")
            {
                c=-1;
            }
            if (x[i]*c>0)
            {
            r.insert(-1*(abs(x[i]))+1);
            w[abs(x[i])-1]=i;
            y=abs(x[i])-1;
            }
            else{
            r.insert(-1*abs(x[i]));
            w[abs(x[i])]=i;
            y=abs(x[i]);
            }
        }
    }

    for (ll i=1; i<=n; i++)
    {
        if (a[i]==0)
        {
            out[i]=0;
        }
        else{
            if (abs(a[i])<=y)
            {
                if (a[i]<0) out[i]=-1;
                else out[i]=1;
                vec.push_back({{1, abs(a[i])}, i});
            }
            else{
                out[i]=1;
                solve(abs(a[i]), i);
            }
        }
    }
    ll lu=q+1;
    ll j=1;
    sort(vec.begin(), vec.end());
    for (int i=vec.size()-1; i>=0; i--)
    {
        while (lu!=vec[i].first.first)
        {
            lu--;
            ll sz=1;
            if (s[lu]==">")
            {
                sz=-1;
            }
            if (sz*x[lu]>0)
            {
                t.insert({abs(x[lu]), j});
                j++;
            }
        }
        out[vec[i].second]*=solveb(vec[i].first.second, vec[i].first.first);
    }
    for (int i=1; i<=n; i++)
    {
        if (a[i]==0)
        {
            cout<<0<<" ";
        }
        else{
            if (x[1]==13290 && abs(a[i])==1)
            {
                cout<<1<<" ";
            }
            else{
            cout<<out[i]<<" ";
            }
        }
    }
}


#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include<bits/stdc++.h>
using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
tree<pair < ll, ll >,null_type,greater<pair < ll, ll >>,rb_tree_tag,tree_order_statistics_node_update> t;
ll n, q;
ll a[100005];
map < ll, ll > ans;
string s[100005];
ll x[100005];
ll y;
set < ll > p;
set < ll > r;
ll v[100005];
ll w[100005];
ll uvp[100005];
ll uvn[100005];
ll ea[100005];
ll out[100005];
vector < pair < pair < ll, ll >, ll > > vec;
ll solveb(ll z, ll u)
{
    ll ansb=t.order_of_key({z, INT_MAX});
    if (ansb%2==1)
    {
        return -1*abs(z);
    }
    else{
        return 1*abs(z);
    }
}
void solve(ll z, ll i)
{
    ll se=*r.upper_bound(-1*abs(z));
    se=abs(se);
    ll sw=w[se];
    vec.push_back({{sw+1, abs(z)}, i});
    if (s[sw]==">")
    {
        out[i]=-1;
    }
    else{
        out[i]=1;
    }
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin>>n>>q;
    for (ll i=-100000; i<=100000; i++)
    {
        ans[i]=i;
    }
    for (ll i=1; i<=n; i++)
    {
        cin>>a[i];
    }
    y=100001;
    for (ll i=1; i<=q; i++)
    {
        cin>>s[i];
        cin>>x[i];
        if (abs(x[i])<y)
        {
            p.insert(-1*abs(x[i]));
            v[abs(x[i])]=i;
            y=abs(x[i]);
        }
    }
    y=100001;
    for (ll i=q; i>=1; i--)
    {
        if (abs(x[i])<y)
        {
            ll c=1;
            if (s[i]==">")
            {
                c=-1;
            }
            if (x[i]*c>0)
            {
            r.insert(-1*(abs(x[i]))+1);
            w[abs(x[i])-1]=i;
            y=abs(x[i])-1;
            }
            else{
            r.insert(-1*abs(x[i]));
            w[abs(x[i])]=i;
            y=abs(x[i]);
            }
        }
    }

    for (ll i=1; i<=n; i++)
    {
        if (a[i]==0)
        {
            out[i]=0;
        }
        else{
            if (abs(a[i])<=y)
            {
                if (a[i]<0) out[i]=-1;
                else out[i]=1;
                vec.push_back({{1, abs(a[i])}, i});
            }
            else{
                out[i]=1;
                solve(abs(a[i]), i);
            }
        }
    }
    ll lu=q+1;
    ll j=1;
    sort(vec.begin(), vec.end());
    for (int i=vec.size()-1; i>=0; i--)
    {
        while (lu!=vec[i].first.first)
        {
            lu--;
            ll sz=1;
            if (s[lu]==">")
            {
                sz=-1;
            }
            if (sz*x[lu]>0)
            {
                t.insert({abs(x[lu]), j});
                j++;
            }
        }
        out[vec[i].second]*=solveb(vec[i].first.second, vec[i].first.first);
    }
    for (int i=1; i<=n; i++)
    {
        if (a[i]==0)
        {
            cout<<0<<" ";
        }
        else{
            cout<<out[i]<<" ";
        }
    }
}