Takahashi loves walking on a tree. The tree where Takahashi walks has N vertices numbered 1 through N. The i-th of the N-1 edges connects Vertex a_i and Vertex b_i.

Takahashi has scheduled M walks. The i-th walk is done as follows:

* The walk involves two vertices u_i and v_i that are fixed beforehand.
* Takahashi will walk from u_i to v_i or from v_i to u_i along the shortest path.



The happiness gained from the i-th walk is defined as follows:

* The happiness gained is the number of the edges traversed during the i-th walk that satisfies one of the following conditions:
* In the previous walks, the edge has never been traversed.
* In the previous walks, the edge has only been traversed in the direction opposite to the direction taken in the i-th walk.



Takahashi would like to decide the direction of each walk so that the total happiness gained from the M walks is maximized. Find the maximum total happiness that can be gained, and one specific way to choose the directions of the walks that maximizes the total happiness.

Constraints

* 1 ≤ N,M ≤ 2000
* 1 ≤ a_i , b_i ≤ N
* 1 ≤ u_i , v_i ≤ N
* a_i \neq b_i
* u_i \neq v_i
* The graph given as input is a tree.

Input

Input is given from Standard Input in the following format:


N M
a_1 b_1
:
a_{N-1} b_{N-1}
u_1 v_1
:
u_M v_M


Output

Print the maximum total happiness T that can be gained, and one specific way to choose the directions of the walks that maximizes the total happiness, in the following format:


T
u^'_1 v^'_1
:
u^'_M v^'_M


where (u^'_i,v^'_i) is either (u_i,v_i) or (v_i,u_i), which means that the i-th walk is from vertex u^'_i to v^'_i.

Examples

Input

4 3
2 1
3 1
4 1
2 3
3 4
4 2


Output

6
2 3
3 4
4 2


Input

5 3
1 2
1 3
3 4
3 5
2 4
3 5
1 5


Output

6
2 4
3 5
5 1


Input

6 4
1 2
2 3
1 4
4 5
4 6
2 4
3 6
5 6
4 5


Output

9
2 4
6 3
5 6
4 5
#include <cstdio>
#include <cstring>
#include <iostream>
#include <vector>
#define debug(...) fprintf(stderr,__VA_ARGS__)
using namespace std;
inline char nc()
{
    return getchar();
    static char buf[100000],*l=buf,*r=buf;
    return l==r&&(r=(l=buf)+fread(buf,1,100000,stdin),l==r)?EOF:*l++;
}
template<class T> void read(T &x)
{
    x=0; int f=1,ch=nc();
    while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=nc();}
    while(ch>='0'&&ch<='9'){x=x*10-'0'+ch;ch=nc();}
    x*=f;
}
const int maxn=2000+50;
const int maxm=2000+50;
int n,m;
int A[maxm],B[maxm];
int an;
int a[maxm<<1];
int b[maxm<<1];
int q[maxn];
int anc[maxn];
int deg[maxn];
int dep[maxn];
int dir[maxm<<1];
int head[maxn];
int ch[maxm<<1][2];
bool rev[maxm<<1];
bool vis[maxn];
bool mark[maxm<<1];
bool used[maxn][2];
struct edge
{
    int to,nex;
    edge(int to=0,int nex=0):to(to),nex(nex){}
};
vector<edge> G;
inline void addedge(int u,int v)
{
    G.push_back(edge(v,head[u])),head[u]=G.size()-1;
    G.push_back(edge(u,head[v])),head[v]=G.size()-1;
    ++deg[u],++deg[v];
}
void dfs(int u,int c)
{
    if(u==0) return;
    c^=rev[u];
    dir[u]=c;
    dfs(ch[u][0],c);
    dfs(ch[u][1],c^1);
}
void getdep(int u)
{
    for(int i=head[u];~i;i=G[i].nex)
    {
        int v=G[i].to; if(v==anc[u]) continue;
        dep[v]=dep[u]+1;
        anc[v]=u;
        getdep(v);
    }
}
inline void upd(int x,int c)
{
    if(used[x][c]) return;
    used[x][c]=1,++an;
}
int main()
{
    read(n),read(m);
    memset(head,-1,sizeof(head));
    for(int i=1;i<n;++i)
    {
        int a,b; read(a),read(b);
        addedge(a,b);
    }
    for(int i=1;i<=m;++i)
    {
        read(A[i]),a[i]=A[i];
        read(B[i]),b[i]=B[i];
    }
    int hd=0,tl=0;
    for(int i=1;i<=n;++i) if(deg[i]==1)
    {
        q[tl++]=i;
    }
    int T=n,cnt=m;
    memset(dir,-1,sizeof(dir));
    while(T--)
    {
        int u=q[hd++]; vis[u]=1;
        // debug("%d\n",u);
        for(int i=head[u];~i;i=G[i].nex)
        {
            int v=G[i].to;
            if(--deg[v]==1) q[tl++]=v;
        }
        vector<int> E;
        for(int i=1;i<=cnt;++i) if(!mark[i])
        {
            if(a[i]==u&&b[i]==u)
            {
                // debug("e %d\n",i);
                dfs(i,0);
                continue;
            }
            if(b[i]==u) swap(a[i],b[i]),rev[i]^=1;
            if(a[i]==u) E.push_back(i);
        }
        int w=-1;
        for(int i=head[u];~i;i=G[i].nex)
        {
            int v=G[i].to;
            if(!vis[v]) {w=v; break;}
        }
        while(E.size())
        {
            if(E.size()==1)
            {
                int e=E[0];
                a[e]=w;
                break;
            }
            int x=E.back(); E.pop_back();
            int y=E.back(); E.pop_back();
            ++cnt; ch[cnt][0]=x,ch[cnt][1]=y;
            a[cnt]=b[y],b[cnt]=b[x];
            mark[x]=mark[y]=1;
            // debug("%d %d %d\n",u,x,y);
        }
        // debug("%d\n",u);
        // for(int i=1;i<=cnt;++i) if(!mark[i]) debug("%d %d\n",a[i],b[i]);
    }
    getdep(1);
    for(int i=1;i<=m;++i)
    {
        // debug("%d %d %d\n",i,rev[i],dir[i]);
        if(dir[i]) swap(A[i],B[i]);
        int u=A[i],v=B[i];
        while(dep[u]>dep[v]) upd(u,0),u=anc[u];
        while(dep[u]<dep[v]) upd(v,1),v=anc[v];
        while(u!=v)
        {
            upd(u,0),u=anc[u];
            upd(v,1),v=anc[v];
        }
    }
    printf("%d\n",an);
    for(int i=1;i<=m;++i)
    {
        printf("%d %d\n",A[i],B[i]);
    }
    return 0;
}