#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#include <bits/stdc++.h>
using namespace std;
typedef long long int lld;

const lld N = 200043;
const lld MOD = 1000000007;

lld add(lld x, lld y)
{
    x =((x%MOD)+(y%MOD))%MOD;
    while(x >= MOD) x -= MOD;
    while(x < 0) x += MOD;
    return x;
}

lld mul(lld x, lld y)
{
    return ((x%MOD)*(y%MOD))% MOD;
}

lld binpow(lld x, lld y)
{
    lld z = 1;
    while(y)
    {
        if(y & 1) z = mul(z, x);
        x = mul(x, x);
        y >>= 1;
    }
    return z;
}

lld inv(lld x)
{
    return binpow(x, MOD - 2);
}

lld divide(lld x, lld y)
{
    return mul(x, inv(y));
}

// Combinations

/*
lld fact[N];

void precalc()
{
    fact[0] = 1;
    for(lld i = 1; i < N; i++)
        fact[i] = mul(fact[i - 1], i);
}

lld C(lld n, lld k)
{   if(k>n)
        return 0;
    return divide(fact[n], mul(fact[k], fact[n - k]));
}
*/

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    lld t,i,j;
    //cin>>t;
    t=1;
    while(t--)
    {
        lld x;
        cin>>x;
        if(x%100==0)
            cout<<100<<endl;
        else
            cout<<100-(x%100)<<endl;
    }
}



#define _USE_MATH_DEFINES
#include<iostream>
#include<iomanip>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<stack>
#include<queue>
#include<set>
#include<map>
#include<climits>
#include<bitset>
#include<unordered_map>
#include<unordered_set>
#include<random>
#include<list>
#include<functional>


using namespace std;

#define MAX(A,B) ((A)>(B)?(A):(B))
#define MIN(A,B) ((A)<(B)?(A):(B))
#define LP(I,S,G) for (long long int I = S; I < G; I++)
#define IN(X) 	for (int i = 0; i < X.size(); i++)cin >> X[i]
#define OUT(X) 	for (int i = 0; i < X.size(); i++)out << X[i]
#define SORT(X) sort(X.begin(), X.end())
#define CSORT(X,Y) sort(X.begin(), X.end(),Y)
#define COPY(X,Y) copy(X.begin(), X.end(), Y.begin())
#define ALL(X,Y) for (auto X = Y.begin(); X != Y.end(); X++)

template<class I1, class I2>
istream& operator>>(istream& s, pair<I1, I2>& in) {
	s >> in.first >> in.second;
	return s;
}

long long int M = 998244353;


bool comp(pair<int, int>& a, pair<int, int>& b) {
	return (a.second < b.second);
}

vector<int> t(pow(10, 5), 0);



int main(void) {
	int n, m;
	cin >> n >> m;
	vector<int> t(pow(10, 3) + 1, 0);
	LP(i, 0, n) {
		int a;
		cin >> a;
		t[a] = 1;
	}
	LP(i, 0, m) {
		int b;
		cin >> b;
		t[b] |= 2;
	}
	ALL(i, t) {
		if (*i == 1 || *i == 2)cout << (i - t.begin()) << " ";
	}
	return 0;
}