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

#ifdef _WIN32
#define scanfll(x) scanf("%I64d", x)
#define printfll(x) printf("%I64d", x)
#else
#define scanfll(x) scanf("%lld", x)
#define printfll(x) printf("%lld", x)
#endif
#define rep(i,n) for(long long i = 0; i < (long long)(n); i++)
#define repi(i,a,b) for(long long i = (long long)(a); i < (long long)(b); i++)
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define fi first
#define se second
#define mt make_tuple
#define mp make_pair
template<class T1, class T2> bool chmin(T1 &a, T2 b) { return b < a && (a = b, true); }
template<class T1, class T2> bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }

using ll = long long; using ld = long double; using vll = vector<ll>; using vvll = vector<vll>; using vld = vector<ld>; 
using vi = vector<int>; using vvi = vector<vi>;
vll conv(vi& v) { vll r(v.size()); rep(i, v.size()) r[i] = v[i]; return r; }
using P = pair<ll, ll>;

template <typename T, typename U> ostream &operator<<(ostream &o, const pair<T, U> &v) {  o << "(" << v.first << ", " << v.second << ")"; return o; }
template<size_t...> struct seq{}; template<size_t N, size_t... Is> struct gen_seq : gen_seq<N-1, N-1, Is...>{}; template<size_t... Is> struct gen_seq<0, Is...> : seq<Is...>{};
template<class Ch, class Tr, class Tuple, size_t... Is>
void print_tuple(basic_ostream<Ch,Tr>& os, Tuple const& t, seq<Is...>){ using s = int[]; (void)s{0, (void(os << (Is == 0? "" : ", ") << get<Is>(t)), 0)...}; }
template<class Ch, class Tr, class... Args> 
auto operator<<(basic_ostream<Ch, Tr>& os, tuple<Args...> const& t) -> basic_ostream<Ch, Tr>& { os << "("; print_tuple(os, t, gen_seq<sizeof...(Args)>()); return os << ")"; }
ostream &operator<<(ostream &o, const vvll &v) { rep(i, v.size()) { rep(j, v[i].size()) o << v[i][j] << " "; cout << endl; } return o; }
template <typename T> ostream &operator<<(ostream &o, const vector<T> &v) { o << '['; rep(i, v.size()) o << v[i] << (i != v.size()-1 ? ", " : ""); o << "]";  return o; }
template <typename T>  ostream &operator<<(ostream &o, const set<T> &m) { o << '['; for (auto it = m.begin(); it != m.end(); it++) o << *it << (next(it) != m.end() ? ", " : ""); o << "]";  return o; }
template <typename T, typename U>  ostream &operator<<(ostream &o, const map<T, U> &m) { o << '['; for (auto it = m.begin(); it != m.end(); it++) o << *it << (next(it) != m.end() ? ", " : ""); o << "]";  return o; }
template <typename T, typename U>  ostream &operator<<(ostream &o, const unordered_map<T, U> &m) { o << '['; for (auto it = m.begin(); it != m.end(); it++) o << *it; o << "]";  return o; }
void printbits(ll mask, ll n) { rep(i, n) { cout << !!(mask & (1ll << i)); } cout << endl; }
#define ldout fixed << setprecision(40) 

static const double EPS = 1e-14;
static const long long mo = 1e9+7;


/***********************/
// ??±?????¨???
/***********************/
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

typedef long long Weight;
const Weight INF = 1e18;

struct Edge {
    ll src, dst;
    ll cap = 1;
    Weight weight;
    ll rev; // ????????°?????????????????¨
    bool rev_flag = false; // rev??????1
    Edge() {};
    Edge(ll src, ll dst, Weight weight) :
        src(src), dst(dst), weight(weight) { }
};
bool operator < (const Edge &e, const Edge &f) {
    return e.weight != f.weight ? e.weight > f.weight : // !!INVERSE!!
        e.src != f.src ? e.src < f.src : e.dst < f.dst;
}
typedef vector<Edge> Edges;
typedef vector<Edges> Graph;

typedef vector<Weight> Array;
typedef vector<Array> Matrix;

void addDirected(Graph& g, ll src, ll dst, Weight weight, ll cap) {
    assert(src < g.size() && src >= 0 && dst < g.size() && dst >= 0);
    Edge e = Edge(src, dst, weight);
    e.cap = cap;
    g[src].push_back(e); 
}
void addDirected(Graph& g, ll src, ll dst, Weight weight) { assert(src < g.size() && src >= 0 && dst < g.size() && dst >= 0); g[src].push_back(Edge(src, dst, weight)); }
void addUndirected(Graph& g, ll src, ll dst, Weight weight) { assert(src < g.size() && src >= 0 && dst < g.size() && dst >= 0); g[src].push_back(Edge(src, dst, weight)); g[dst].push_back(Edge(dst, src, weight)); }
void addDirected(Graph& g, ll src, ll dst) { addDirected(g, src, dst, 1); }
void addUndirected(Graph& g, ll src, ll dst) { addUndirected(g, src, dst, 1); }

void printGraph(Graph& g) {
    rep(i, g.size()) {
        if (!g[i].size())
            continue;
        rep(j, g[i].size()) 
            cout << "(" << i << ", " << g[i][j].dst << "), ";
        cout << endl;
    }
}
void printGraphCap(Graph& g) {
    rep(i, g.size()) {
        if (!g[i].size())
            continue;
        rep(j, g[i].size()) 
            cout << "(" << i+1 << ", " << g[i][j].dst+1 << " : " << g[i][j].cap << ", " << (g[i][j].rev_flag ? "rev" : "for") << "), ";
        cout << endl;
    }
}

class FordFulkerson {
public:
    Graph g; // ????????????????????????
    int s, t; // ?§????, ??????
    int n; // ????????°
    ll flow = 0; // ?????§????????????????????????????????????????????????????????¨??´??°??????

    FordFulkerson(Graph& input, int s_, int t_) : s(s_), t(t_) {
        n = input.size();
        g.resize(n);
        used.resize(n);
        for (auto&& from : input) {
            for (auto&& e_for : from) {
                addEdge(e_for);
            }
        }

        flow = 0;
        revise();
    }
    // ??????????????????src, dst, cap????????±?????????
    // ????????°?????????????????????????????????
    void addEdge(Edge& e_for) {
        Edge e_rev;
        e_rev.src = e_for.dst; 
        e_rev.dst = e_for.src;
        e_rev.cap = 0;

        e_for.rev = g[e_rev.src].size();
        e_rev.rev = g[e_for.src].size(); // ?????????????????????
        e_rev.rev_flag = true;
        g[e_for.src].push_back(e_for);
        g[e_rev.src].push_back(e_rev);
    }
    // ????????°???????????????????????????????????´???????????????
    // flow???????¨??????????
    ll revise(void) {
        while (1) {
            ll f = update(INF);
            if (!f) { // ????????°????????????????????????
                break;
            }
            flow += f;
        }
        return flow;
    }
    // ???????????????
    // ????????°????????§???v??????t????????£??????????????¢?????????????????°???????????????
    //
    // s??????t????§???????????????????????????????????????§?????????????????????????????????0????????????
    // f??????????????¨??????????????????
    //
    // O(V)
    vector<bool> used;
    int dfs_rec(int v/*from*/, int to, ll f) {
        if (v == to)
            return f;
        used[v] = true;
        for (int i = 0; i < g[v].size(); i++) {
            Edge &e = g[v][i];
            if (used[e.dst] || e.cap <= 0) 
                continue;
            // ?????£???????????£????????£?????????????????¢??? 
            int d = dfs_rec(e.dst, to, min(f, e.cap)); // ???????????¨???????????????????????£???????????£??????????°??????????????¬???????????????¨??????
            if (d > 0) {
                e.cap -= d; // ????????°?????????????????´??°
                g[e.dst][e.rev].cap += d; // ????????°????????????????????´??°
                return d;
            }
        }
        return 0;
    }
    int dfs(int v/*from*/, int to, ll f) {
        rep(i, n) {
            used[i] = 0;
        }
        return dfs_rec(v, to, f);
    }
    int update(ll f) {
        return update(f, t);
    }
    int update(ll f, int to) {
        return dfs(s, to, f);
    }

    // s??????t???????????§??????????????????
    // s == t??????INF?????????, ???????????????0?????????
    ll get(void) {
        return flow;
    }
    // O(V) 
    // from??????to??????????????????cap???????????????????????????????????§???????????????
    // ???????????????????????¨?????¨???????????£????????????????????????
    // TODO ????¢????????????????
    int add(int from, int to, ll cap) {
        bool found = false;
        rep(i, g[from].size()) {
            Edge& e = g[from][i];
            if (e.rev_flag) continue;
            if (e.dst == to) { // ?????¨?????¨?????£??????
                e.cap += cap;
                found = true;
                break;
            }
        }
        if (found == false) {
            Edge e;
            e.src = from;
            e.dst = to;
            e.cap = cap;
            this->addEdge(e);
        }
        revise();
        return flow;
    }

    // from??????to?????????????????????????????£?????????????????????????????´?????????
    // ?????´??§??????????????????????????????
    //
    // ????????????from->to->??????->from?????¨??????????????????????????\???????????°???
    // from->to????????????????????????????????????????????????????????¨?????§?????????
    // ?????????????????????????????????????????¨?????????????????????????????¨????????\??????
    ll erase_using_circuit(int from, int to) {
        ll sum = 0;
        rep(i, g[from].size()) {
            Edge& e = g[from][i];
            if (e.rev_flag) continue;
            if (e.dst != to) continue;
            if (g[e.dst][e.rev].cap == 0) continue;
            // ???????????????????????????from??????to???????????????????????¨??????

            Edge& e_rev = g[e.dst][e.rev];
            // ?¶????????????????????????????????????£?????¨??¨?????????????????¨??????
            // ??????????????????????????£???????????¨??§?????????
            while (1) { // TODO ?????????????????????????????°??????
                // e.src?????????????????°??????????????????????????°???????????????
                bool used[n];
                rep(i, n) {
                    used[i] = false;
                }
                function<ll(ll, ll)> dfs_lam = [&](ll v, ll c) {
                    if (v == e.dst) {
                        return c;
                    }
                    used[v] = true;
                    for (auto&& tmp : g[v]) if (used[tmp.dst] == false && tmp.cap) {
//                        cout << v << " -> " << tmp.dst << endl;
                        ll f = dfs_lam(tmp.dst, min(c, tmp.cap));
                        if (f) {
                            tmp.cap -= f;
                            g[tmp.dst][tmp.rev].cap += f;
                            return f;
                        }
                    }
                    return 0ll;
                };
                ll can_erase = dfs_lam(e.src, e_rev.cap);
                /*
                cout << e.src << " " << e.dst << " " << e_rev.cap << endl;
                cout << can_erase << "#can_erase" << endl;
                */
                e.cap += can_erase;
                e_rev.cap -= can_erase;
                sum += can_erase;

                if (can_erase == 0) { // ????????§????¶????????????????
                    // TODO ??¬?????????????????\???????????§?????¨??¨??????????¢??????????????????????????¬????????????§???????????????
                    break;
                }
            }
        }
        return sum;
    }
    // O(V) 
    // from??????to?????????????????????cap???????????????????????????????????§???????????????
    // cap???0????????£?????????????????°????????????????????????????¶??????????
    int erase(int from, int to, ll cap) {
        // ???????????¨????????????????????????????¶????????????????????????£???????????????????¢????
        ll cap_sum = 0;
        rep(i, g[from].size()) if (g[from][i].dst == to) {
            Edge& e = g[from][i];
            if (e.rev_flag) continue;
            // ?????????????????¨??????

            cap_sum += e.cap + g[e.dst][e.rev].cap;
        }
        if (cap > cap_sum) {
            cap = cap_sum;
        }

        // ?????£????????????????????£???????°????????????????
        rep(i, g[from].size()) {
            Edge& e = g[from][i];
            if (e.rev_flag) continue;
            if (e.dst != to) continue;
            if (g[e.dst][e.rev].cap != 0) continue;
            // ??????????????????????????????from??????to??????????????????????????¨??????

            ll to_erase = min(e.cap, cap);
            e.cap -= to_erase;
            cap -= to_erase;
        }
        if (cap == 0) { // ???????¶??????????????????????????????????
            return flow;
        }


        /*
        cout << "#first erase" << endl;
        cout << "#prev" << endl;
        printGraphCap(g);
        */
        erase_using_circuit(from, to);
        /*
        cout << "#aft" << endl;
        printGraphCap(g);
        cout << can_erase << "#can_erase" << endl;
        */
        // ??????????????????????¶????
        rep(i, g[from].size()) {
            Edge& e = g[from][i];
            if (e.rev_flag) continue;
            if (e.dst != to) continue;
            ll m = min(cap, e.cap);
            cap -= m;
            e.cap -= m;
        }
        if (cap == 0) { // ???????¶??????????????????????????????????
            return flow;
        }
 
        // ??????cap????¶????????????¨????????????
        // ????????°????????§???t->s???????¢???§??????cap???????????????????????????????????????flow???????°??????????
        // ????°????????????????????????????????????????????????????????????¨???????????§??????????????¨???????????????????????????
        ll sum = 0;
        while (1) {
            ll f = dfs(t, s, cap);
            if (!f) break;
            flow -= f;
            cap -= f;
            sum += f;
        }
        assert(cap == 0);
//        printGraphCap(g);
        erase_using_circuit(from, to); // ????????§from->to???????????????cap???????????????
        // ??????????????????????¶????
        rep(i, g[from].size()) {
            Edge& e = g[from][i];
            if (e.rev_flag) continue;
            if (e.dst != to) continue;
            ll m = min(sum, e.cap);
            sum -= m;
            e.cap -= m;
        }
        return flow;
    }
    // from??????to??????????????¨?????? 
    int erase(int from, int to) {
        return erase(from, to, INF);
    }
};



int main(void) {
    cin.tie(0); ios::sync_with_stdio(false);
    ll n, e, q; cin >> n >> e >> q;
    Graph g(n);
    rep(i, e) {
        ll f, t; cin >> f >> t; f--, t--;
        addDirected(g, f, t, 0, 1);
        addDirected(g, t, f, 0, 1);
    }
    FordFulkerson ff(g, 0, n-1); 
//        printGraphCap(ff.g);
//    printGraphCap(ff.g);
    rep(i, q) {
        int type, u, v; cin >> type >> u >> v; u--; v--;
        if (type == 1) {
            ff.add(u, v, 1);
//            printGraphCap(ff.g);
            ff.add(v, u, 1);
//            printGraphCap(ff.g);
            cout << ff.get() << endl;
        } else {
            ff.erase(u, v, 1);
//            printGraphCap(ff.g);
            ff.erase(v, u, 1);
//            printGraphCap(ff.g);
            cout << ff.get() << endl;
        }
//        printGraphCap(ff.g);
    }
    return 0;
}

Measured memory_bytes: 10700