#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <complex>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#define SORT(x) sort((x).begin(),(x).end())
#define all(x) (x).begin(),(x).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
const int MAX_V=1010;
struct edge
{
    int to,cap,rev;
    edge(int to,int cap,int rev):to(to),cap(cap),rev(rev){}
};
vector<edge> G[MAX_V];
bool used[MAX_V];
bool sr[MAX_V],tr[MAX_V];
int a[10010],b[10010];
vector<int> v;
void add_edge(int from,int to,int cap)
{
	v.pb(G[from].size());
    edge new_edge1(to,cap,G[to].size());
    G[from].pb(new_edge1);
    edge new_edge2(from,0,G[from].size()-1);
    G[to].pb(new_edge2);
}
int dfs(int v,int t,int f)
{
    if(v==t)return f;
    used[v]=true;
    for(int i=0;i<G[v].size();i++)
    {
        edge &e=G[v][i];
        if(!used[e.to]&&e.cap>0)
        {
            int d=dfs(e.to,t,min(f,e.cap));
            if(d>0)
            {
                e.cap-=d;
                G[e.to][e.rev].cap+=d;
                return d;
            }
        }
    }
    return 0;
}
void dfs1(int v)
{
    sr[v]=true;
    for(int i=0;i<G[v].size();i++)
    {
        edge &e=G[v][i];
        if(!sr[e.to]&&e.cap>0)dfs1(e.to);
    }
    return;
}
void dfs2(int v)
{
    tr[v]=true;
    for(int i=0;i<G[v].size();i++)
    {
        edge &e=G[v][i];
        if(!tr[e.to]&&e.cap==0)dfs2(e.to);
    }
    return;
}
int flow=0;
int N,M,S,T;
int max_flow(int s,int t)
{
    for(;;)
    {
        memset(used,0,sizeof(used));
        int f=dfs(s,t,INF);
        if(f==0)return flow;
        flow+=f;
    }
}

int main()
{
	while(1)
	{
		flow = 0;
		v.clear();
		for(int i=0;i<1010;i++)G[i].clear();
		memset(sr,false,sizeof(sr));
		memset(tr,false,sizeof(tr));
		scanf("%d %d %d %d",&N,&M,&S,&T);
		if(N==0&&M==0&&S==0&&T==0)break;
		S--;T--;
		for(int i=0;i<M;i++)
		{
		    scanf("%d %d",&a[i],&b[i]);
		    a[i]--;b[i]--;
		    add_edge(a[i],b[i],1);
		}
		max_flow(S,T);
		dfs1(S);
		dfs2(T);
		//for(int i=0;i<N;i++)printf("%d %d\n",sr[i],tr[i]);
		int ans = 0;
		for(int i=0;i<M;i++)
		{
		    if(G[a[i]][v[i]].cap==0)continue;
		    if(sr[b[i]]&&tr[a[i]])ans++;
		}
		if(ans>0)flow++;
		printf("%d %d\n",flow,ans);
	}
}