A: Information Search

problem

The posting list is a list in which there is a correspondence between the search term and the appearing document ID. For example

* Hokkaido: 1, 2, 4, 9
* Sightseeing: 1, 3, 4, 7



And so on.

From the above posting list, if you search for and, the document with ID 1, 4 will be hit, and if you search for or, ID 1, 2, 3, 4, 7, 9 will be hit.

Here, and search means "listing elements contained in either list", or search means "listing elements contained in at least one of the lists".

Since the posting list is given, output the results of and search and or search respectively.

Input format


n m
a_1 a_2 $ \ ldots $ a_n
b_1 b_2 $ \ ldots $ b_m


All inputs consist of integers.

The first line gives the lengths n and m of the two posting lists to search, separated by spaces.

The second and third lines are given the IDs contained in their respective posting lists, separated by blanks.

Constraint

* 1 \ leq n, m \ leq 2 \ times 10 ^ 5
* a_i <a_j (i <j)
* b_i <b_j (i <j)
* 1 \ leq a_i, b_i \ leq 10 ^ 9



Output format

Let A be the number of hits in the and search, and B be the number of hits in the or search.

Print on the first line in the order A B, separated by blanks.

Output the IDs hit by and search on the following line A in ascending order.

Output the IDs hit by or search on the following B line in ascending order.

Input example 1


4 4
1 2 4 9
1 3 4 7


Output example 1


2 6
1
Four
1
2
3
Four
7
9


Input example 2


4 4
1 3 5 7
2 4 6 8


Output example 2


0 8
1
2
3
Four
Five
6
7
8


Input example 3


3 5
one two Three
1 2 3 4 5


Output example 3


3 5
1
2
3
1
2
3
Four
Five






Example

Input

4 4
1 2 4 9
1 3 4 7


Output

2 6
1
4
1
2
3
4
7
9
//実装が重そうな問題はある程度考えてから書く
//初期化を忘れずに（特に二分探索とか）
//コーナーケースを考えて（特に場合分けとか）
//不可解すぎるバグは配列外参照（配列の長さ）を検討
#include "bits/stdc++.h"
#define YES "YES"
#define NO "NO"
#define YESNO OUT(three(solve(),YES,NO))
#define ECHO OUT(solve())
#define three(A,B,C) ((A)?(B):(C))
#define FOR(i,a,b)  for(LL i=(a);i< (LL)(b);i++)
#define EFOR(i,a,b) for(LL i=(a);i<=(LL)(b);i++)
#define RFOR(i,a,b) for(LL i=(a);i>=(LL)(b);i--)
#define REP(i,b) FOR(i,zero,b)
#define EREP(i,b) EFOR(i,zero,b)
#define RREP(i,b) RFOR(i,b-1,zero)
#define ALL(c) c.begin(),c.end()
#define UNIQUE(c) sort(ALL(c));c.erase(unique(ALL(c)),c.end())
#define MAX(c) (*max_element(ALL(c)))
#define MIN(c) (*min_element(ALL(c)))
#define MP make_pair
#define FI first
#define SE second
#define SI(x) (LL(x.size()))
#define PB emplace_back
#define DEBUG(a) OUT(a)
#define DEBUG2(a,b) OUT2(a,b)
#define cat cout << __LINE__ << endl
#define OUT(a) cout << (a) << endl
#define OUT2(a,b) cout << (a) <<" "<<(b) << endl
#define int long long
#define zero 0LL
#define pb PB
using namespace std;
template<typename T> inline bool middle(T a, T b, T c) { return b <= a && a <= c; }
template<class T> inline bool MX(T &l, const T &r) { return l < r ? l = r, 1 : 0; }
template<class T> inline bool MN(T &l, const T &r) { return l > r ? l = r, 1 : 0; }
typedef long long LL;
typedef double ld;
typedef LL ut;
typedef vector<ut> VI;
typedef vector<VI> VII;
typedef pair<ut, ut> pr;
typedef pair<ut, pr> ppr;
typedef vector<pr> Vpr;
typedef vector<ppr> Vppr;
typedef priority_queue<ppr, Vppr ,greater<ppr> > PQ;
inline void outputVI(VI x) { REP(i, SI(x)) { cout << three(i, " ", "") << x[i]; }OUT(""); }
int dx[] = { 0,1,0,-1,1,1,-1,-1,0 }, dy[] = { 1,0,-1,0,1,-1,1,-1,0 };
const int SIZE1 =3e5 + 1000;
const int SIZE2 = 2010;
const int SIZE3 = 22;
const int SIZE = SIZE1;
const LL p = 7 + 1e9;
const LL INF = 1LL << 60;
const long double EPS = 1e-7;
ut N, M, K, X, L, Y,H,W,Q,D;
// ut A,B,C,D,E,F,G,H,I,J,O,P,Q,R,T,U;
VI edges[SIZE];
LL vals[SIZE], nums[SIZE], maps[SIZE2][SIZE2], answer = zero;
//LL A[SIZE], B[SIZE];
bool nable[SIZE2][SIZE2];
LL cost[SIZE2][SIZE2];
map<LL, LL> mp;
LL solve() {
	LL n[2];
	cin >> n[0] >> n[1];
	VI v[2] = { VI(n[0]),VI(n[1]) };
	VI ans, ansb;
	REP(k,2)
	
REP(i, n[k]) {
		cin >> v[k][i];
		mp[v[k][i]] = mp[v[k][i]] + 1;
		if (mp[v[k][i]] == 1) {
			ansb.pb(v[k][i]);
		}
		else {
			ans.pb(v[k][i]);
		}
	}
	sort(ALL(ans));
	sort(ALL(ansb));
	cout << ans.size() << " " << ansb.size() << endl;
	REP(i, ans.size()) {
		cout << ans[i] << endl;
	}
	REP(i, ansb.size()) {
		cout << ansb[i] << endl;
	}
	return 0;
}
signed main() {
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(10);
	solve();
	//	cin >> N;
	return 0;
}
