#include <iostream>

using namespace std;

int main()
{
    int a, b;
    cin >> a >> b;
    cout << 6 - a - b;
    return 0;
}

#include <iostream>
#include <iterator>
#include <algorithm>
#include <vector>
#include <cmath>

using namespace std;

int main()
{
    int a,b;
    cin >> a >> b;
    for(int i=1;i<=3;i++)
        if(a!=i&&b!=i)
        {
            cout << i;
            return 0;
        };
    return 0;
}

#include <iostream>

using namespace std;

int main()
{int a,b;cin>>a>>b;
 if(max(a,b)-min(a,b)==2){cout<<"2";return 0;}
 if(min(a,b)>1){cout<<"1";return 0;}
 else cout<<"3"<<endl;
return 0;
}

#include<iostream>
#include<string>
#include<cmath>
#include<algorithm>
using namespace std;

int main()
{
    int a,b;
    cin>>a>>b;
    if ((a==1&&b==2)||(a==2&&b==1)) cout<<3;
    else cout<<abs(a-b);
    return 0;
}

#include <iostream>
using namespace std;

int main() {
    bool f[3] = {};
    for (int k = 0; k < 2; k++) {
        int x;
        cin >> x;
        f[x - 1] = true;
    }
    for (int k = 0; k < 3; k++) {
        if (!f[k]) {
            cout << k + 1;
            return 0;
        }
    }
}

#include<bits/stdc++.h>

#define pb push_back
#define pp pop_back
#define sz(a) (int)(a.size())
#define mp make_pair
#define F first
#define S second

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pii;

const int N = (int)1e6 + 123;
const ll INF = (ll)1e18 + 123;
const int inf = (int)1e9 + 123;

bool u[5];

int main() {
	for(int i = 1, x; i <= 2; i ++){
		cin >> x;
		u[x] = 1;
	}
	for(int i = 1; i <= 3; i ++){
		if(!u[i]){
      	cout << i;
      	return 0;
      }
	}
	return 0;
}

#include <bits/stdc++.h>

using namespace std;

int i,j;
int main()
 {
  cin>>i>>j;
  cout<<6-i-j<<endl;
 }

#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
#include <map>
#include <set>
using namespace std;
int a,b;
int main(){
ios_base::sync_with_stdio(0);
cin.tie(NULL);
cin>>a>>b;
if(a==1 && b==2 || a==2 && b==1){cout<<"3";return 0;}
if(a==2 && b==3 || a==3 && b==2){cout<<"1";return 0;}
if(a==1 && b==3 || a==3 && b==1){cout<<"2";return 0;}
return 0;
}

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

int main()
{
int a[2];
scanf("%d%d", &a[0], &a[1]);
sort(a, a + 2);
if (a[0] == 1)
{
if (a[1] == 2)
printf("3\n");
else
printf("2\n");
}
else
printf("1\n");
return 0;

}

#include <cstdio>

int main()
{
	bool f[3];
	int a;
	for (int i = 0; i < 3; i++)
		f[i] = false;
	for (int i = 0; i < 2; i++)
	{
		scanf("%d", &a);
		f[a - 1] = true;
	}
	for (int i = 0; i < 3; i++)
		if (!f[i])
		{
			printf("%d", i + 1);
			return 0;
		}
}

#include <iostream>

using namespace std;

int main()
{
    int a, b;
    cin >> a >> b;
    cout << 3 - ((a + b) % 3);
    return 0;
}

#include <iostream>
using namespace std;
int main()
{
    int a, b;
    cin >> a >> b;
    if(a+b == 5)
    {
        cout << 1;
    }
    if(a+b == 3)
    {
        cout << 3;
    }
    if(a+b == 4)
    {
        cout << 2;
    }
    return 0;
}

#include <bits/stdc++.h>
#define endl '\n'
using namespace std;

int a, b, used[4];

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    cin>>a>>b;
    used[a] = 1;
    used[b] = 1;

    if(!used[1]) cout<<1<<endl;
    else if(!used[2]) cout<<2<<endl;
    else cout<<3<<endl;
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

int main() {
    int a, b;
    cin >> a >> b;
    if(a != 1 && b != 1) printf("1");
    else if(a != 2 && b != 2) printf("2");
    else printf("3");
    return 0;
}

#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <math.h>
#include <cmath>
#include <string>
#include <map>
#include <set>
#include <iterator>
#include <vector>
#include <stdio.h>
#include <queue>
#include <deque>
#include <stack>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
ll n, i, j, h, m,  k;
char c, a[105][105][105];
ll ans;
int main()
{
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	cin >> i >> j;
	cout << 6 - i - j;
}

#include <iostream>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <iomanip>
using namespace std;

int main()
{     int a,b;
     cin >>a>>b;
     cout<<6-a-b<<endl;

    return 0;
}

#include<iostream>
#include<cstdio>
using namespace std;

int a, b;
int main()
{
	cin >> a >> b;
	cout << 6 - a - b << endl;
}

#include<iostream>
#include<algorithm>

using namespace std;

int main()
{
    int a,b;
    cin>>a>>b;
    if(a != 1 && b != 1)
        cout<<1;
    if(a != 2 && b != 2)
        cout<<2;
    if(a != 3 && b != 3)
        cout<<3;
    return 0;
}

#include <iostream>
int main()
{
    int a, b;
    std::cin>>a>>b;
    std::cout<<(6-a-b);
    return 0;
}

#include <iostream>
using namespace std;
int main(){
     int a,b;
     cin >> a >> b;
     cout << 6 - a - b;
     return 0;
}

#include <fstream>
#include <iostream>

using namespace std;

int main () {

    //ifstream cin("input.txt");
    //ofstream cout("output.txt");

    bool b[3] = {true, true, true};

    for (int i = 0; i < 2; i++) {

        int a;
        cin >> a;

        b[a - 1] = false;
    }

    for (int i = 0; i < 3; i++) {

        if ( b[i] ) cout << i + 1;
    }
}

#include <iostream>
using namespace std;
int a, b;
int main(){
    cin >> a >> b;
    cout << 6-a-b << endl;
    return 0;
}

#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
	int a, b;
	cin >> a >> b;
	cout << 6 - a  - b;
	return 0;
}

#include <iostream>
using namespace std;

int main() {
	int a[4];
	for (int i=1;i<4;i++)
	{
		a[i]=0;
	}
	int k;
	cin>>k;
	a[k]++;
	cin>>k;
	a[k]++;
	for (int i=1;i<4;i++)
	{
		if (a[i]==0)
		{cout<<i;
		break;}
	}
	return 0;
}

#include <iostream>
using namespace std;
int main () {
	int a, b;
	cin >> a >> b;
	if (a+b == 5) cout << 1;
	else if (a+b == 4) cout << 2;
	else cout << 3;
}

#include <iostream>
#include <vector>

using namespace std;
int main()
{
	int a, b, c;
	cin >> a >> b;
	cout << (6 - a - b);
	return 0;
}

#include<iostream>
using namespace std;

int main(){
	int a,b;
	int c[3];
	cin>>a>>b;
	for (int i=0; i<3;i++){
		c[i]=0;
	}
	c[a-1]=1;
	c[b-1]=1;
	for (int i=0; i<3;i++){
		if(c[i]==0){
			cout<<i+1;
		}
	}
	return 0;
}

#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<set>
#include<map>

using namespace std;
typedef long long ll;

int main()
{
	ll a, b;
	cin >> a >> b;
	cout << 6 - a - b;
	return 0;
}

#include<bits/stdc++.h>

using namespace std;

int main()
{
    int a,b,c;
    cin >> a >> b;
    if (a+b==3) cout << 3;else if (a+b==4) cout << 2; else cout << 1;
}

#include <iostream>

int main()
{
	int first, second, result;

	std::cin >> first;
	std::cin >> second;

	result = 6 - first - second;

	std::cout << result;
}

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

int main() {
  int a, b;
  cin >> a >> b;
  cout << 6 - a - b;
}

#include <iostream>

using namespace std;

int main()
{
    int a;
    int b;
	cin>>a;
	cin>>b;
	for(int i=1;i<=3;i++)
	{
		if(i!=a && i!=b)
		{
			cout<<i;
		}
	}
}

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

int main() {
#ifdef  __linux__
	//freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);
#endif
	//ios::sync_with_stdio(false);

	int a[4] = {0, 0, 0, 0};
	int n, m;
	cin >> n >> m;
	a[n] = 1;
	a[m] = 1;

	for(int i = 1; i <= 3; i++)
		if(!a[i]) cout << i << endl;

	return 0;
}

#include <bits/stdc++.h>

#define TASK ""
#define sqr(x) ((x)*(x))
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
using namespace std;
const ll INFLL = numeric_limits<long long>::max();
const ll INFINT = numeric_limits<int>::max();
const ld EPS = 1e-7;
const ll MOD = 1e9 + 7LL;
const ll MAXN = 234567;

bool used[3];

int run()
{
	for(int i=0;i<2;i++)
	{
		ll val;
		cin >> val;
		used[val-1]=true;
	}
	for(int i=0;i<3;i++)
	{
		if(used[i]==false)
		{
			cout << i+1;
			return 0;
		}
	}
	return 0;
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);

#ifdef LOCAL
#ifdef STRESS
	freopen("input.txt","w",stdout);

#endif
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#else
	if(strcmp(TASK,"")!=0)
	{
		freopen(TASK".in", "r", stdin);
		freopen(TASK".out", "w", stdout);
	}
#endif

	run();

	return 0;
}

#include <iostream>

using namespace std;
int c[2];
int main()
{
    int a, b;
    cin >> a >> b;
    c[a - 1] = 1;
    c[b - 1] = 1;
    for(int i = 0;i < 3;i++)
    {
        if (c[i] == 0)
        {
                cout << i + 1;
        }
    }
    return 0;
}

#include <cmath>
#include <iomanip>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <random>
#include <set>
#include <map>
using namespace std;

#if _DEBUG
#include <fstream>
ifstream cin("input.txt");
ofstream cout("output.txt");
#else
#include <iostream>
#endif
long long a, b;
int main()
{
	cin >> a >> b;
	cout << 6 - a - b;
	return 0;
}

#include <iostream>
using namespace std;
int a,b;
int main()
{
    cin>>a>>b;
    cout<<6-a-b<<endl;
    return 0;
}

/*
	 Arafat  Mukhametkazin
      All rights reserved
        ALMATY 2016
*/
#include <bits/stdc++.h>

#define f first
#define s second
#define mp make_pair
#define pb push_back
#define ll long long
#define  endl "\n"
#define sz(x) x.size()
#define all(x) x.begin(), x.end()

using namespace std;

const int MAXN = 1e5 + 123;
const int mod = 1e9 + 7;
const int INF = 1e9 + 1;
const double eps = 1e-9;
const double pi = acos(-1.0);

bool used[4];

int main () {

	int a, b;
	cin >> a >> b;
	used[a] = 1, used[b] = 1;

	for (int i = 1;i <= 3;i ++)
		if (!used[i]){
			cout << i;
			return 0;
		}

return 0;
}

#include <iostream>

using namespace std;

int main()
{
	int a,b;
	cin>>a>>b;
	switch(a*b)
	{
	case(2):
		cout<<"3";
		break;
	case(3):
		cout<<"2";
		break;
	case(6):
		cout<<"1";
		break;
	}

	return 0;
}

#include <iostream>
using namespace std;
int main()
{
	int a, b;
	cin >> a >> b;
	if (a != 1 && b != 1)
		cout << 1;
	else if (a != 2 && b != 2)
		cout << 2;
	else cout << 3;
}

#include <iostream>
using namespace std;
int main(){
	int a,b;
	cin >> a>> b;
	cout << 6-a-b;

}

#include<stdio.h>
#include<vector>
#include<string>
#include<map>
#include<algorithm>
#include<math.h>
#include<queue>
#include<iostream>
#include<cstring>
#include<time.h>
#include<stack>
#include<complex>

#pragma warning (disable: 4996)

#define mp make_pair
#define ll long long int

using namespace std;

ll n,a,b;

void solve() {
	ll i, j;
	printf("%I64d", 6 - a - b);
	return;
}

int main() {
#ifdef _DEBUG
	freopen("input.txt", "rt", stdin);
	freopen("output.txt", "wt", stdout);
#endif
	scanf("%I64d%I64d", &a,&b);
	solve();
	return 0;
}

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef double dbl;

#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()

const double EPS = 1e-9;
const ll INF = 2e9;

int main() {
	ios::sync_with_stdio(0);
	cin.tie(nullptr);
	cout.tie(nullptr);

	cout << fixed << setprecision(10);

	#ifdef S_HOME
	freopen("file.in", "r", stdin);
	cerr << fixed << setprecision(10);
	#else
	// freopen("kbest.in", "r", stdin);
	// freopen("kbest.out", "w", stdout);
	#endif

	bool was[3] = {0, 0, 0};
	int a, b;
	cin >> a >> b;
	was[a - 1] = was[b - 1] = 1;

	for (int i = 0; i < 3; i++) {
		if (!was[i]) {
			cout << i + 1 << "\n";
			return 0;
		}
	}

	#ifdef S_HOME
	cerr << "\nTerminated after: " << clock() * 1.0 / CLOCKS_PER_SEC << "\n";
	#endif

	return 0;
}

#include <iostream>

using namespace std;

int main() {
    int a, b;
    cin >> a >> b;
    cout << 6 - (a + b);
}

#include <iostream>
#include <vector>
#include <cstdio>
#include <list>
#include <algorithm>
#include <climits>
#include <map>
#include <cmath>
#include <set>
#define ll long long
#define Danylo_ILITKA main()
#define x first
#define pb push_back
#define y second
#define forn(a) for(int i=0;i<a;i++)
#define c_false ios_base::sync_with_stdio(false); cin.tie(0)
#define in insert
#define del erase
#define rb rbegin
#define ld long double
#define beg begin
#define pipii pair<int,pair<int,int> >
#define pii pair<int,int>
#define vvi vector<vector<int> >
#define mp make_pair
#define INF 1000000000
using namespace std;
int a,b,res;
int Danylo_ILITKA
{
    //freopen("input.txt","r",stdin);
    scanf("%d %d",&a,&b);
    if(a>b)
        swap(a,b);
    if(a==1 && b==3)
        res=2;
    if(a==1 && b==2)
        res=3;
    if(a==2 && b==3)
        res=1;
    printf("%d\n",res);
}

#include <iostream>

using namespace std;

int main()
{
	int a, b;
	cin >> a >> b;
	if (a + b == 3)
		cout << 3;
	else if (a + b == 4)
		cout << 2;
	else
		cout << 1;
	return 0;
}

#include <iostream>

using namespace std;

int main()
{
    int a,b,c;
    cin>>a>>b;
    cout<<6-a-b;
    return 0;
}

#include <iostream>

using namespace std;

int main()
{
    int a,
        b,
        c;
    cin>>a>>b;
    for(c=1;c<4;c++)
        if((c!=a)&&(c!=b))
            cout<<c;
    return 0;
}

#include <iostream>

using namespace std;

int main()
{
    int a, b;
    cin >> a >> b;
    if (a != 1 && b != 1) cout << 1;
    if (a != 2 && b != 2) cout << 2;
    if (a != 3 && b != 3) cout << 3;
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

int main () {
	int a , b;	cin >> a >> b;
	cout << (1 ^ 2 ^ 3 ^ a ^ b);
	return 0;
}

 #include <cmath>
#include <algorithm>
#include <string>
#include <fstream>
#include <iostream>
#include <stack>
using namespace std;

int main() {
  bool f = false, s = false, fi = false;
 for(int i = 0; i < 2; i++) {
 int a;
 cin >> a;
  if(a == 1)
      f = true;
  else
      if(a == 2)
          s = true;
        else
            fi = true;

 }
  if(!f)
    cout << 1;
    else
    if(!s)
    cout << 2;
    else cout << 3;

    return 0;
}

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

#define N   100005
#define F   first
#define S   second
#define pb  push_back
#define mp  make_pair
#define ll  long long
#define ld  long double
#define INF 1000000000
#define MOD 1000000009
#define EPS 0.00000001
#define PI  3.14159265358979311599796346854418516

int a, b;

int main()
{
    scanf ( "%d %d", &a, &b );
    printf ( "%d\n", 6-a-b );

    return 0;
}

#include <iostream>
#include <vector>
using namespace std;
int main() {
	int n;
	vector <int> a(4);
	for (int i = 0; i < 4; i++) {
		a[i] = 0;
	}
	for (int i = 0; i < 2; i++) {
		cin >> n;
		a[n]++;
	}
	for (int i = 1; i < 4; i++) {
		if (a[i] == 0) {
			cout << i;
		}
	}
	return 0;
}

#include <iostream>
using namespace std;
int a,b,c;
int main(){
cin>>a>>b;
cout<<6-a-b;
return 0;
}

#include <iostream>
#include <cstdio>
#include <string>
#include <vector>

using namespace std;

int main()
{
	//freopen("input.txt", "rt", stdin);
	int n, m;
	cin >> n >> m;
	cout << 6/n/m;

}

#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <math.h>
#include <cmath>
#include <string>
#include <set>
#include <vector>
using namespace std;

/*int gcd(long long a,long long b){
	return b?gcd(b,a%b):a;
}
int lcm(long long a,long long b){
	return a*b/gcd(a,b);

int n,a,u[100010],d[100010];
}*/
int main() {
	int a,b;
	scanf("%d %d",&a,&b);
	if ((a==1 && b==2) || (a==2 && b==1))
		printf("3");
	else
		if ((a==1 && b==3) || (a==3 && b==1))
			printf("2");
		else
			if ((a==2 && b==3) || (a==3 && b==2))
			printf("1");
}

#include <iostream>
#include <cstdio>

using namespace std;

int main()
{
	int a, b;
	cin >> a >> b;
	cout << 6 - a - b;

	return 0;
}

#include <iostream>

using namespace std;

int main()
{
    long int a, b;
    cin >> a >> b;
    if (a == 1)
    {
        if (b == 2)
        {
            cout << 3;
        }
        else
        {
            cout << 2;
        }
    }
    else
    {
        if (a == 2)
        {
            if (b == 1)
            {
                cout << 3;
            }
            else
            {
                cout << 1;
            }
        }
        else
        {
            if (b == 2)
            {
                cout << 1;
            }
            else
            {
                cout << 2;
            }
        }
    }
    return 0;
}

# include <bits/stdc++.h>
  using namespace std;
  int main()
  {
      long long a, b;
      cin >> a >> b;
      cout << (1 + 2 + 3) - (a + b);
      return 0;
  }

#include <iostream>
using namespace std;

unsigned short arr[4];

int main()
{
	for (size_t i = 0; i < 2; i++)
	{
		cin >> arr[0];
		arr[arr[0]] = 1;
	}

	for (size_t i = 1; i < 4; i++)
		if (!arr[i])
		{
			cout << i; break;
		}

}

#include <iostream>
#include <map>
#include <deque>
using namespace std;
#define FORI(to) for(int i(0);i<to;i++)
#define FORJ(to) for(int j(0);j<to;j++)
#define Spause system("pause");
int main()
{
	int x,sum(0);
	cin >> x; sum += x;
	cin >> x; sum += x;
	sum = 6 - sum;
	cout << sum;
	//Spause;
	return 0;
}

#include <bits/stdc++.h>

#define mp make_pair
#define pb push_back
#define fi first
#define se second

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> pll;

const int N = 1e6 + 7;
const ll INF = 1e9 + 7;
const ld EPS = 1e-9;
const ll P = 485437;
const int C = 2016;

int main()
{
    ios_base::sync_with_stdio(0);
    int a, b;
    cin >> a >> b;
    cout << 6 - a - b;
    return 0;
}

#include <iostream>
using namespace std;

int main()
{
	int a, b;
	cin >> a >> b;
	if ((a + b) == 3)
		cout << "3" << endl;
	if ((a + b) == 4)
		cout << "2" << endl;
	if ((a + b) == 5)
		cout << "1" << endl;
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
const double pi = 3.14159265359;
const int N = (int) 1e6 + 7;
const int MaXI = (int) 1e9;
const int Mass = (int) 2e5;

const int base = 1000000000;
const int base_digits = 9;

int main()
{
	int a,b;
	cin>>a>>b;
	if(a==2&&b==1)
	cout<<3;
	else if(a==2&&b==3)
	cout<<1;
	else if(a==1&&b==2)
	cout<<3;
	else if(a==1&&b==3)
	cout<<2;
	else if(a==3&&b==1)
	cout<<2;
	else if(a==3&&b==2)
	cout<<1;
	return 0;

}

# include <iostream>
# include <vector>
# include <math.h>
# include <algorithm>
# include <cstdio>
# include <map>
# include <iomanip>
# include <stdlib.h>
# include <string>
# include <deque>
# include <iterator>
using namespace std;
long long b,n,l[200],j,s,a[10];

int main()
{
    cin>>a[1]>>a[2];
    sort(a+1,a+3);
    if(a[1]==1 && a[2]==2)
        cout<<3;
    else if(a[1]==2 && a[2]==3)
        cout<<1;
    else if(a[1]==1 && a[2]==3)
        cout<<2;

}

#include <iostream>

int main(){
	int a, b;
	std::cin >> a >> b;
	std::cout << 6 - a - b << '\n';
	return 0;
}

#include <iostream>

int main()
{
	int sum, a, b;
	std::cin >> a >> b;
	std::cout << 6 - (a + b) << std::endl;
    return 0;
}

// fest
#include <iostream>
#include <fstream>
#include <string>
#include <cstring>
#include <string.h>
#include <cstdio>
#include <stdlib.h>
#include <stdio.h>
#include <cstdlib>
#include <cmath>
#include <math.h>
#include <assert.h>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <ctime>
#include <time.h>
#include <list>
#include <iomanip>
#include <unordered_map>
#include <unordered_set>

#define pb push_back
#define mp make_pair
#define F first
#define S second
#define y1 dasdasfasfas
#define x1 wqdadfasfasfas
#define All(c) c.begin(), c.end()
#define SZ(A) (int((A).size()))
#define umap unordered_map

typedef long long ll;
typedef long double ld;

using namespace std;

inline double Time() {return (clock() * 1.0) / CLOCKS_PER_SEC; }

inline void mem(int a[], int x, int l, int r) {for (int i = l; i <= r; i++) a[i] = x; }
inline void mem_arr(int a[], int b[], int l, int r) {for (int i = l; i <= r; i++) a[i] = b[i]; }

const int N = 100500, inf = 1e9 * 2;

const ll MOD = 1e9 + 7ll, INF = 1e18;

const int dx[] = {1, -1, 0, 0, -1, 1, -1, 1};
const int dy[] = {0, 0, 1, -1, -1, 1, 1, -1};

int main() {

	unsigned int FOR;
	asm("rdtsc" : "=A"(FOR));
	srand(FOR);

	#ifndef ONLINE_JUDGE
		freopen(".in", "r", stdin);
		freopen("1.out", "w", stdout);
	#endif
	int a, b;
	cin >> a >> b;
	if (a > b) swap(a, b);
	if (a == 1 && b == 2) cout << 3;
	else if (a == 1 && b == 3) cout << 2;
	else if (a == 2 && b == 3) cout << 1;
	return 0;
}

#include <iostream>
using namespace std;
int main()
{
	int b1,b2;
	enum {z,a,b,c};
	cin >> b1 >> b2;
	switch (b1+b2)
	{
	case 3:
	{
		cout << c;
		break;
	}
	case 4:
	{
		cout << b;
		break;
	}
	case 5:
	{
		cout << a;
		break;
	}
	}
}

#include <iostream>

using namespace std;

int main()
{
    int a, b;
    cin >> a >> b;
    if(a == 1 && b == 2 || a == 2 && b == 1) cout << 3;
    else if(a == 1 && b == 3 || a == 3 && b == 1) cout << 2;
    else cout << 1;
    return 0;
}

#include <bits/stdc++.h>

#define endl "\n"
#define Ios ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL);
#define fi first
#define se second
#define setp(a)  fixed << setprecision(a)
#define mp make_pair
#define pb push_back
#define sz size()
#define all(x) x.begin() , x.end()
#define Error(x) cerr << x << endl
#define All(x , y) x + 1 , x + y + 1

#define Vi vector < int >
#define ll long long
#define ull unsigned long long

using namespace std;

const double pi = 3.14159265358979323846;
const ll INF = (ll) 1e17 + 99999999;
const ll Mod = (ll) 1e9 + 7;
const int Mass = (int) 2e5;

int main(){ Ios
  #ifdef Home
    freopen(".in", "r", stdin);
    freopen(".out", "w", stdout);
  #endif
  int a , b;
  cin >> a >> b;
  cout << 6 - (a + b);
  return 0;
}

#include <iostream>
using namespace std;
int main(void){
	int a, b;
	cin >> a >> b;
	cout << 6 - (a + b) << endl;
	return 0;
}

#include <iostream>
using namespace std;
int main()
{
	int a,b,c;
	cin>>a>>b;
	for(int i=1;i<=3;i++)
		if(i!=a&&i!=b)
			cout<<i<<endl;
	return 0;
}

#include <iostream>
using namespace std;
int main()
{
	int a,b;
    cin >> a >> b;
    cout << 6-a-b << endl;
    return 0;
}

#include <stdio.h>

void main()
{
    int a,b;
    scanf("%d%d",&a,&b);
    printf("%d",6-(a+b));
    return;
}

#define _CRT_SECURE_NO_WARNINGS

#include <cstdio>

using namespace std;

int main() {

	int a, b;
	scanf("%d %d", &a, &b);

	printf("%d", 6 - a - b);

	return 0;
}

#include<iostream>
#include<cmath>
#include<algorithm>
#include<deque>
#include<vector>
#include<iomanip>
#include<queue>
#include<fstream>
#include<string>
using namespace std;

int const m = 3;

int main(){
	const int n = 3;
	int a[n] = { 1, 2, 3 };
	int x, y;
	cin >> x >> y;
	for (int i = 0; i < n; i++)
		if (a[i] != x && a[i] != y)
			cout  <<a[i];

	return 0;
}

#include<iostream>
using namespace std;

int main(){
	int a,b;
	cin>>a>>b;
	if(a>b){
		cout<<a-b;
	}else{
		cout<<b-a;
	}
	return 0;
}

#include <iostream>
#include <vector>
#include <cstdio>
#include <list>
#include <algorithm>
#include <climits>
#include <map>
#include <cmath>
#include <set>
#define ll long long
#define Danylo_ILITKA main()
#define x first
#define pb push_back
#define y second
#define forn(a) for(int i=0;i<a;i++)
#define c_false ios_base::sync_with_stdio(false); cin.tie(0)
#define in insert
#define del erase
#define rb rbegin
#define ld long double
#define beg begin
#define pipii pair<int,pair<int,int> >
#define pii pair<int,int>
#define vvi vector<vector<int> >
#define mp make_pair
#define INF 1000000000
using namespace std;
int a,b,res;
int Danylo_ILITKA
{
    //freopen("input.txt","r",stdin);
    scanf("%d %d",&a,&b);
    if(a>b)
        swap(a,b);
    if(a==1 && b==3)
        res=2;
    if(a==1 && b==3)
        res=2;
    if(a==2 && b==3)
        res=1;
    printf("%d\n",res);
}

#include <iostream>
#include <fstream>
using namespace std;
int main()
{
	ifstream in("input.txt");
	ofstream out("output.txt");
	int a, b;
	in>>a>>b;
	if((a!=1)and(b!=1)) out<<1;
	else if((a!=2)and(b!=2)) out<<2;
	else out<<3;
}

#include <iostream>
#include<string>
#include <cstring>
using namespace std;
int main()
{
int a;
int b;

cin>>a;
cin>>b;

if(a==1)
{
    if(b==2)
    {
        cout<<3;
    }

    if(b==3)
    {
        cout<<2;
    }
}

if(a==2)
{
    if(b==1)
    {
        cout<<3;
    }

    if(b==3)
    {
        cout<<1;
    }
}

if(a==3)
{
    if(b==1)
    {
        cout<<3;
    }

    if(b==2)
    {
        cout<<1;
    }
}
    return 0;

}

#include  <iostream>
using namespace std;
int main () {
char a, b;
cin >> a >> b;
if (a!='2' && b!= '2') cout << 2;
else if ( a!=3 && b !=3)cout << 3;
    else cout << 1;
return 0;
}

#include<iostream>
using namespace std;
int main()
{
	int a, b;
	cin >> a >> b;
	if ((a == 1) && (b == 2)) cout << 3;
	else if ((a == 2) && (b == 3)) cout << 1;
	else cout << 2;
	return 0;
}

#include <iostream>
#include <cstdio>
#include <queue>
#include <string>
#include <cmath>
#include <vector>
#include <set>
#include <queue>
#include <map>
#include <cstring>
#include <stack>
#include <algorithm>

using namespace std;

int main() {
	int a, b;
	cin >> a >> b;
	if (a == 1 && b == 2) {
		cout << '3' << endl;
	}
	else if (a == 1 && b == 3) {
		cout << '2' << endl;
	}
	else {
		cout << '1' << endl;
	}
}

#include <iostream>
#include <fstream>
using namespace std;

int main()
{
    char a='0';
    char b='0';
    ifstream fout ("input.txt", std::ios::in);
    fout>>a;
    SEEK_CUR+1;
    fout>>b;
    fout.close();
    cout<<"a:"<<a<<"b:"<<b<<endl;
    ofstream Out ("output.txt",std::ios::out);
    if (a=='1')
    {
        if (b=='2')
        {
            Out<<'3';
        }
        else if (b=='3')
        {
            Out<<'2';
        }
    }
    else if (a=='2')
    {
        if (b=='1')
        {
            Out<<'3';
        }
        else if (b=='3')
        {
            Out<<'1';
        }
    }
    else if (a=='3')
    {
        if (b=='1')
        {
            Out<<'2';
        }
        if (b=='2')
        {
            Out<<'1';
        }
    }
    Out.close();
    return 0;
}

#include <iostream>

using namespace std;

int main()
{
	int a[2];
	cin>>a[0];
	cin>>a[1];
	for(int i=1;i<3;i++)
	{
		if(i!=a[0] && i!=a[1])
		{
			cout<<i;
		}
	}
}

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

int main() {
#ifdef  __linux__
	freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);
#endif
	ios::sync_with_stdio(false);

	int a[4];
	int n, m;
	cin >> n >> m;
	a[n] = 1;
	a[m] = 1;

	for(int i = 1; i <= 3; i++)
		if(!a[i]) cout << i << endl;

	return 0;
}

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

int main() {
#ifdef  __linux__
	freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);
#endif
	ios::sync_with_stdio(false);

	int a[4];
	int n, m;
	cin >> n >> m;
	a[n] = 1;
	a[m] = 1;

	for(int i = 1; i <= 3; i++)
		if(!a[i]) cout << i;

	return 0;
}

#include <bits/stdc++.h>

#define TASK ""
#define sqr(x) ((x)*(x))
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
using namespace std;
const ll INFLL = numeric_limits<long long>::max();
const ll INFINT = numeric_limits<int>::max();
const ld EPS = 1e-7;
const ll MOD = 1e9 + 7LL;
const ll MAXN = 234567;

int run()
{
	bool used[3];
	for(int i=0;i<2;i++)
	{
		ll val;
		cin >> val;
		used[val-1]=true;
	}
	for(int i=0;i<3;i++)
	{
		if(used[i]==false)
		{
			cout << i+1;
			return 0;
		}
	}
	return 0;
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);

#ifdef LOCAL
#ifdef STRESS
	freopen("input.txt","w",stdout);

#endif
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#else
	if(strcmp(TASK,"")!=0)
	{
		freopen(TASK".in", "r", stdin);
		freopen(TASK".out", "w", stdout);
	}
#endif

	run();

	return 0;
}

#include<iostream>
using namespace std;
int main(){
    int a,b;
    cin>>a>>b;
    if(a==1 && b==2) cout<<3;
    if(a==2 && b==1) cout<<3;
    if(a==3 && b==1) cout<<3;
    if(a==1 && b==3) cout<<2;
    if(a==2 && b==3) cout<<1;
    if(a==3 && b==2) cout<<1;
    return 0;
}

#include<iostream>
using namespace std;
int main(){
    int a=1,b=2,c=3;
    cin>>a>>b;
    if((a+b)%2==0) cout<<(a+b)/2;
    if((a+b)%3==0) cout<<a+b;
    if((a+b)%4==1) cout<<a-b;
    return 0;
}

#include<iostream>
using namespace std;
int main(){
    int a,b;
    cin>>a>>b;
    if(a==1 && b==2) {cout<<3;}
    else if(a==2 && b==1) {cout<<3;}
    else if(a==3 && b==1) {cout<<3;}
    else if(a==1 && b==3) {cout<<2;}
    else if(a==2 && b==3) {cout<<1;}
    else if(a==3 && b==2) {cout<<1;}
    return 0;
}

#include <bits/stdc++.h>
#define ll long long
#define ull unsigned ll
#define ld long double
#define mp make_pair
#define pb push_back
#define F first
#define S second
#define y1 dgsdfgsfg

using namespace std;

const ll MIN = 1e3 + 2;
const ll MXN = 1e6 + 3;
const ll INF = 1e9 + 7;
const ll LINF = 1e18 + 15;
const ld EPS = 1e-9;

ll a, b;

int main(){
	cin >> a >> b;
	if (a < b)
	swap (a, b);
	if (a == 1 && b == 2)
	cout << 3;
	if (a == 2 && b == 3)
	cout << 1;
	if (a == 1 && b == 3)
	cout << 2;
	return 0;
}

#include <iostream>
#include <cmath>

using namespace std;

int main(){
    int d, c;
    cin >> d >> c;
    cout << abs(d-c);
}

#include <iostream>
#include <iterator>
#include <algorithm>
#include <vector>
#include <cmath>

using namespace std;

int main()
{
    int a,b;
    cin >> a >> b;
    for(int i=1;i<=3;i++)
        if(a!=i||b!=i)
        {
            cout << i;
            return 0;
        };
    return 0;
}

#include<iostream>
#include<string>
#include<cmath>
#include<algorithm>
using namespace std;

int main()
{
    int a,b;
    cin>>a>>b;
    if ((a==1&&b==2)||(a==2||b==1)) cout<<3;
    else cout<<abs(a-b);
    return 0;
}

#include<iostream>
#include<string>
#include<cmath>
#include<algorithm>
using namespace std;

int main()
{
    int a,b;
    cin>>a>>b;
    if (a==1&&b==2) cout<<3;
    else cout<<abs(a-b);
    return 0;
}

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

typedef long long ll;
typedef long double ld;

int main(){
#ifdef _DEBUG
	freopen("input","r",stdin);
	freopen("output","w",stdout);
#endif
	ll a,b;
	cin>>a>>b;
	vector<ll> c(4,0);
	c[a]++;
	c[b]++;
	for(ll i=1;i<3;i++){
		if(c[i]==0){
			cout<<i;
			return 0;
		}
	}
}

#define _USE_MATH_DEFINES
#include<stdio.h>
#include<iostream>
#include<vector>
#include<cmath>
#include<algorithm>
#include<map>
#include<set>
#include<sstream>
#include<cstring>
#include<numeric>
#include<limits.h>
#include<time.h>
#include <assert.h>
#define long long long
using namespace std;

int a[3];

int main() {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
#endif
	for (int i = 0; i < 2; i++) {
		int cur;
		scanf("%d", &cur);
		a[cur]++;
	}
	for (int i = 0; i < 3; i++) {
		if (a[i] == 0) {
			printf("%d", i + 1);
		}
	}
	return 0;
}

#include<bits/stdc++.h>

using namespace std;

string conc(string a, string b){
    int pos=0;
    for(int i=0; i<a.size(); i++){
        if(a[i]==b[pos])
            pos++;
        else
            pos=0;
        if(pos==b.size())
            return a;
    }
    if(pos!=0){
        b.erase(0,pos);
    }
    return a+b;
}

bool used[101];
string s[101],mx;
int n,mxLen=999999999, val;

void proof(string S, int v, int sum){
    used[v]=true;
    sum+=v+1;
    for(int i=0; i<v; i++){
        cout<<" ";
    }
    cout<<S<<endl;
    for(int i=0; i<n; i++){
       if(!used[i]){
        proof(conc(S,s[i]), i, sum);
        proof(conc(s[i],S), i, sum);
       }
    }
    if(sum==val){
        if(mxLen>S.size()){
            mxLen=S.size();
            mx=S;
        }
    }
    sum-=v+1;
    used[v]=false;
}

int main(){
    freopen("check","w",stdout);
    cin>>n;
    for(int i=0; i<n; i++)
        cin>>s[i];
    val=n*(n+1)/2;
    proof(s[0],0,0);
    cout<<mx;
}

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

int main()
{
    int x, ar[4];
    while (cin >> x) ++ar[x];
    for (int i = 1; i <= 3; ++i)
        if (!ar[i]) cout << i << ' ';
}

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

int main()
{
int a[2];
scanf("%d%d", &a[0], &a[1]);
sort(a, a + 2);
if (a[0] == 1)
{
if (a[2] == 2)
printf("3\n");
else
printf("2\n");
}
else
printf("1\n");
return 0;

}