akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include <ext/rope>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize("Ofast")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define ll long long
//#define int long long
#define pb push_back
#define x first
#define ld long double
#define y second
#define mk(a,b) make_pair(a,b)
#define rr return 0
#define sqr(a) ((a)*(a))
#define all(a) a.begin(),a.end()

using namespace std;
using namespace __gnu_cxx;
using namespace __gnu_pbds;
template<class value, class cmp = less<value> >
using ordered_set = tree<value, null_type, cmp, rb_tree_tag, tree_order_statistics_node_update>;
template<class value, class cmp = less_equal<value> >
using ordered_multiset = tree<value, null_type, cmp, rb_tree_tag, tree_order_statistics_node_update>;
template<class key, class value, class cmp = less<key> >
using ordered_map = tree<key, value, cmp, rb_tree_tag, tree_order_statistics_node_update>;

/// find_by_order()
/// order_of_key()
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
inline int randll(int l = INT_MIN, int r = INT_MAX) {
    return uniform_int_distribution<int>(l, r)(rng);
}
const int MOD = 1e9 + 7;
inline int mul (int a, int b) {
    return ((ll)a * b) % MOD;
}
inline void add (int &a, int x) {
    a += x;
    if (a < 0) a += MOD;
    if (a >= MOD) a -= MOD;
}
inline int binpow (int a, int n) {
    int ans = 1;
    while (n) {
        if (n & 1) {
            ans = mul(ans, a);
        }
        a = mul(a, a);
        n >>= 1;
    }
    return ans;
}
inline int inv (int x) {
    return binpow(x, MOD - 2);
}
const int N = 2e5 + 11;
int f[N] = {}, fi[N] = {};
inline int C (int n, int k) {
    return mul(f[n], mul(fi[k], fi[n - k]));
}
inline int cnt_way (int n, int m) {
    return C(n + m - 2, n - 1);
}
main()
{
    ios::sync_with_stdio(0);
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    f[0] = 1;
    for (int i = 1; i < N; i++) f[i] = mul(f[i - 1], i);
    fi[N - 1] = inv(f[N - 1]);
    for (int i = N - 2; i >= 0; i--) {
        fi[i] = mul(fi[i + 1], i + 1);
    }
    int n, m, a, b, ans = 0;
    cin >> n >> m >> a >> b;
    for (int i = 0; i < n - a; i++) {
        add(ans, mul(cnt_way(i + 1, b), cnt_way(n - i, m - b)));
    }
    cout << ans << '\n';
}


Measured memory_bytes: 1792
n = int(input())
blues = dict([])
for i in range(n):
    s = input()
    if s in blues.keys():
        blues[s] += 1
    else: 
        blues[s] = 1

m = int(input())
for i in range(m):
    t = input()
    if t in blues.keys():
        blues[t] -= 1
    else: 
        blues[t] = -1

ans = max(blues.values())
if ans < 0:
    print(0) # 辞書にないstrを受け取ったほうが良い
else:
    print(ans)
    

Measured memory_bytes: 3064
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#define File(s) freopen(s".in","r",stdin),freopen(s".out","w",stdout)
#define mod 1000000007
#define maxn 10010

using namespace std;
typedef long long llg;

int n,k;
int a[maxn],la;
llg f[maxn],ans;

llg mi(llg a,int b){
	llg s=1;
	while(b){
		if(b&1) s=s*a%mod;
		a=a*a%mod; b>>=1;
	}
	return s;
}

int main(){
	scanf("%d %d",&n,&k);
	for(int i=1;i*i<=n;i++)
		if(n%i==0) a[++la]=i,a[++la]=n/i;
	sort(a+1,a+la+1); la=unique(a+1,a+la+1)-a-1;
	for(int i=1;i<=la;i++){
		f[i]+=mi(k,(a[i]+1)/2); f[i]%=mod;
		if(f[i]<0) f[i]+=mod;
		for(int j=i+1;j<=la;j++)
			if(a[j]%a[i]==0) f[j]-=f[i];
		if(~a[i]&1) a[i]>>=1;
		ans+=f[i]*a[i]; ans%=mod;
	}
	printf("%lld",ans);
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>

const int MAXN = 5010;
typedef long long LL;
int A[MAXN], va, vb, n;
LL dp[MAXN][MAXN];
void getmin(LL & x, const LL y) { x > y ? x = y : 0; }
int main() {
	std::ios_base::sync_with_stdio(false), std::cin.tie(0);
	std::cin >> n >> va >> vb;
	for (int i = 1; i <= n; ++i) std::cin >> A[i];
	memset(dp, 0x3f, sizeof dp);
	**dp = 0;
	for (int i = 1; i <= n; ++i) {
		for (int j = 0; j <= n; ++j) {
			if (j > A[i]) {
				getmin(dp[i][j], dp[i - 1][j] + vb);
			} else {
				getmin(dp[i][A[i]], dp[i - 1][j]);
				getmin(dp[i][j], dp[i - 1][j] + va);
			}
		}
	}
	std::cout << *std::min_element(dp[n], dp[n] + n + 1) << std::endl;
	return 0;
}


Measured memory_bytes: 196352
#include <bits/stdc++.h>
using namespace std;

#define REP(i,n) for(ll i=0; i<(ll)(n); i++)
#define FOR(i,n,m) for (ll i=n; i<(ll)(m); i++)
#define pb push_back
#define INF 1000000007LL
#define all(a) (a).begin(),(a).end()
#define chmin(a,b) a=min(a,b)
#define chmax(a,b) a=max(a,b)

typedef long long ll;
typedef pair<int,int> p;

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

ll N;
vector<ll> A;

bool isMinus(ll n) {
    return n <= 0;
}

int main(){
    ios::sync_with_stdio(false);
    cin >> N;
    A.resize(N);
    int minus_cnt = 0;
    REP(i, N) {
        cin >> A[i];
        if (isMinus(A[i])) {
            minus_cnt++;
        }
    }
    
    // マイナスが奇数
    if (minus_cnt % 2) {
        
        // 全判定
        ll ans = 0;
        REP(i, N) {
            if (isMinus(A[i])) {
                ans -= A[i];
            } else {
                ans += A[i];
            }
        }
        
        // 一つだけ反転を諦める
        // マイナスの中で絶対値が小さいもの
        ll t1 = INF;
        REP(i, N) {
            if(isMinus(A[i])) {
                t1 = min(t1, -A[i]);
            }
        }

        // すべて反転して Plus も1つ反転する
        // Plus の中で絶対値が小さいもの
        ll t2 = INF;
        REP(i, N) {
            if(!isMinus(A[i])) {
                t2 = min(t2, A[i]);
            }
        }
        
        cout << max(ans - 2 * t1, ans - 2 * t2) << endl;
    }
    // マイナスが偶数
    else {
        ll ans = 0;
        REP(i, N) {
            if (isMinus(A[i])) {
                ans -= A[i];
            } else {
                ans += A[i];
            }
        }
        cout << ans << endl;
    }
    
    
    return 0;
}


Measured memory_bytes: 1024
#include <iostream>
using namespace std;
#include <bits/stdc++.h>

int main(){
    int A, B, C, D, ans;
    cin >> A >> B >> C >> D;
    ans = min(B, D) - max(A, C);
    if (ans < 0) ans = 0;
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0; i<(n); i++)
#define FOR(i,x,n) for(int i=x; i<(n); i++)
#define ALL(n) begin(n),end(n)
#define MOD 1000000007
 
typedef long long ll;
typedef unsigned int ui;
typedef unsigned long long ull;
template <class T>
void print(T& x){printf("%d\n", x);}
 
int main()
{
    ull X;
    cin >> X;
    ull gaku=100;
    ull ans=0;
    while(X>gaku){
        gaku *= 1.01;
        ans++;
    }
    print(ans);
    return 0;
}

Measured memory_bytes: 3764
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()

/*
ll f(ll N){
    if(N<2) return 1; // ベースケース
    else{
        return N*f(N-2);
    }
}*/

int main() {
    ll N;
    cin >> N;
    ll ans = 0;
    if(N%2==1){}
    else{
        N /= 10;
        ans += N;
        while(N>0){
            N = N/5;
            ans += N;
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
from collections import defaultdict

def readInt():
  return int(input())
def readInts():
  return list(map(int, input().split()))
def readChar():
  return input()
def readChars():
  return input().split()

s = list(map(int,list(input())))

num = [0,0]
for i in s:
  num[i]+=1
print(min(num)*2)

Measured memory_bytes: 10632
#146_D
import queue

def swap(x, y):
    if x > y:
        x, y = y, x
    return (x, y)

n = int(input())

edges = [[] for _ in range(n)]
edges_dict = {}
ans = [0 for _ in range(n-1)]
for i in range(n-1):
    a, b = map(int, input().split())
    edges[a-1].append(b-1)
    edges[b-1].append(a-1)
    edges_dict[(a-1, b-1)] = i
    
k, k_idx = 0, 0
for i in range(n):
    if len(edges[i]) > k:
        k = len(edges[i])
        k_idx = i

que = queue.Queue()
que.put((k_idx, 0))
while not que.empty():
    q, x = que.get()
    tmp = 1
    for to in edges[q]:
        if ans[edges_dict[swap(q, to)]] != 0:
            continue
        if tmp == x:
            tmp += 1
        ans[edges_dict[swap(q, to)]] = tmp
        que.put((to, tmp))
        tmp += 1
            
print(k)
print(*ans, sep= '\n')            

Measured memory_bytes: 48380
// Problem : C - management
// Contest : AtCoder - AtCoder Beginner Contest 163
// URL : https://atcoder.jp/contests/abc163/tasks/abc163_c
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)


/**         srijan_de
 _____      _ _              ______     
/  ___|    (_|_)             |  _  \    
\ `--. _ __ _ _  __ _ _ __   | | | |___ 
 `--. \ '__| | |/ _` | '_ \  | | | / _ \
/\__/ / |  | | | (_| | | | | | |/ /  __/
\____/|_|  |_| |\__,_|_| |_| |___/ \___|
            _/ |                         
           |__/           23.02.2001     **/
///.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.
#include    <bits/stdc++.h>  
using       namespace       std;
using       lli=            long long  int;
using       ulli=           unsigned long long int;
using       ld=             long double;
#define     mem(a,val)      memset( a,  val,  sizeof(a) )
#define     b_s             binary_search
#define     u_b             upper_bound
#define     l_b             lower_bound
#define     nl              cout<<endl
#define     pb              push_back
#define     pf              push_front
#define     ppb             pop_back
#define     ppf             pop_front
#define     in              insert
#define     fi              first
#define     se              second
#define 	pqueue			priority_queue
const lli   MOD=            (int)1e9 + 7;
const lli   MOD1=           (int)1e9 + 9;
const lli   MOD2=           998244353;
const ld    pi=             atan2(0, -1);
const ld    eps=            1e-9;
lli         tests=          1;
template<class x,class y>x max(x a,y b){return (a>b)?a:b;}
template<class x,class y>x min(x a,y b){return (a<b)?a:b;}
template<class x,class y>x log(x n,y r){return (n>r-1)?1+log(n/r,r):0;}

///.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.
int32_t main() 
{
	auto start = clock();
ios_base::sync_with_stdio(0);cout.tie(0);cin.tie(0);	

//	cout<<fixed;
//	cout<<scientific;
//	cout<<fixed<<setprecision(12);
	// cin>>tests;
	for(lli test=1;test<=tests;test++) 
	{
//		cout<<"Case #"<<test<<": ";
///.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.
		
		
		
		
		lli n;
		cin>>n;
		lli a[n]={0};
		
		for(lli i=1;i<n;i++)
		{
		    lli x;
		    cin>>x;
		    a[x-1]++;
		}
		for(lli i=0;i<n;i++)
		cout<<a[i]<<endl;
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
///.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.
	}
	cerr<<endl<<endl<<endl<< "Time : " << double(clock() - start) / CLOCKS_PER_SEC <<endl;
	return 0;
}
///.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.


Measured memory_bytes: 5340
def z(z_dic, v: int):
    if v in z_dic:
        return z_dic[v]
    z = 0
    if v == 2:
        z = 1
    elif v > 2:
        z = int(v*(v-1)/2)
    z_dic.setdefault(v, z)
    return z


def main():
    h, w, _k = map(int, input().split())
    s = []
    for i in range(h):
        line = input()
        s_line = []
        for j in range(w):
            s_line.append(int(line[j]))
        s.append(s_line)

    ok_cnt_min = h*w
    op_cnt = h - 1  # すき間の個数
    for i in range(2 ** op_cnt):
        op = [False] * op_cnt
        for j in range(op_cnt):
            if ((i >> j) & 1):
                op[op_cnt - 1 - j] = True

        s2 =[]
        current_sum = s[0]
        for k in range(op_cnt):
            if op[k]:
                s2.append(current_sum)
                current_sum = s[k+1]
            else:
                next_sum = [(current_sum[a] + s[k+1][a]) for a in range(w)]
                current_sum = next_sum

        s2.append(current_sum)
        s2len = len(s2)

        h_cut_cnt = len([x for x in op if x])
        if h_cut_cnt >= ok_cnt_min:
            break

        st = 0
        ed = 1
        cut_list = []
        dividable = True
        for j in range(1, w+1):
            _sum_max = 0
            if ed <= j:
                ed = j
            else:
                continue

            _sum_max = max([sum(s2[_h][st:ed]) for _h in range(s2len)])
            if _sum_max > _k:
                if ed - st > 1:
                    cut_list.append(ed - 1)
                    st = ed - 1
                else:
                    dividable = False
                    break
        if not dividable:
            continue
        else:
            cnt = h_cut_cnt
            cnt += len(cut_list)
            if cnt < ok_cnt_min:
                ok_cnt_min = cnt

    print(ok_cnt_min)



main()


Measured memory_bytes: 3316
#include <bits/stdc++.h>
using namespace std;

int main() {
  string s;
  cin >> s;
  
  set<char> S;
  for (int i = 0; i < s.size(); i++) {
    S.insert(s.at(i));
  }
  
  if (S.size() == s.size()) {
    cout << "yes" << endl;
  }
  else {
    cout << "no" << endl;
  }
}


Measured memory_bytes: 256
import java.util.Scanner;
import java.util.Comparator;
import java.util.PriorityQueue;
import java.util.Arrays;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        char[] a = sc.next().toCharArray();
        String Ans = "";
        for (int i=0;i<3;i++){Ans += (a[i]=='1')?"9":"1";}
        System.out.println(Ans);
        sc.close();
    }
}

Measured memory_bytes: 21460
#include <iostream>
using namespace std;

int main(){
 int A, B;
  cin >> A >> B;
 if (A==B) {
  cout << "Draw" << endl;
    } else  if ((A>1) && (B>1)) {
       if (A<B){
       cout << "Bob" << endl;
     } else {
       cout << "Alice" << endl;
     } 
    }else if ((A==1) && (B!=1)){
    cout << "Alice" << endl;
}
  if ((B==1) && (A!=1)){
    cout << "Bob" << endl;
}
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;

#define int long long
#define flash ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define pb push_back
#define all(x) begin(x),end(x)

int mod = 1e9+7;
int inf = 4e18;
const int N = 5e5+5;
		
signed main()
{
    flash
    int tt = 1;
    //cin>>tt;
    while(tt--)
    {
		int n,x,t;
		cin>>n>>x>>t;
		n = (n+x-1)/x;
		n*=t;
		cout<<n;		
    }
    return 0;
}


Measured memory_bytes: 3648
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/range/adaptor/reversed.hpp>

using namespace std;
typedef long long int ll;

#define PI (acos(-1))
#define REP(i,n) for(ll (i)=0;(i)<(n);(i)++)

#define dump(x)  cerr << #x << " = " << (x) << endl;
#define dumparr(x) cerr << #x ; for(auto elem: x){cerr << " " << elem;} cerr << endl;
#define dumppairs(x) cerr << #x ; for(auto elem: x){cerr << "(" << elem.first << " " << elem.second << ") ";} cerr << endl;
#define dumpline cerr << "**********************" << endl;
#define dumpwline(x) cerr << "******** " << #x << "=" << (x) << " ********" << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0]))

int main(void){
    ll n; cin >> n;
    ll length = 1;
    REP(_, n){
        ll a; cin >> a;
        if (a == length){
            length++;
        }
    }
    if (length == 1){
        cout << -1 << endl;
        return 0;
    }
    cout << n - length + 1 << endl;
    return 0;
}

Measured memory_bytes: 256
n = gets.to_i
a = gets.split.map(&:to_i)

l = a[0]
a.each do |k|
  l = ( l * k ) / (l.gcd(k))
end
 
mod = 10 ** 9 + 7
ans = 0
a.each do |k|
  ans += l / k
end

puts ans % mod

Measured memory_bytes: 63660
<?php
$N=fgets(STDIN);
$A=explode(" ",trim(fgets(STDIN)));
rsort($A);
$Alice=0;
$Bob=0;
for ($i=0; $i <count($A) ; $i+=2) {
  // code...
  $Alice+=$A[$i];
}
for ($i=1; $i <count($A) ; $i+=2) {
  // code...
  $Bob+=$A[$i];
}
echo $Alice-$Bob;
 ?>


Measured memory_bytes: 3576
K = int(input())

import math
from functools import reduce
import itertools


def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

ans = 0

for a, b, c in itertools.combinations_with_replacement(range(1, K + 1), 3):
    if a == b == c:
        x = 1
    elif a == b or b == c or c == a:
        x = 3
    else:
        x = 6
    ans += gcd(a, b, c) * x

print(ans)

Measured memory_bytes: 69528
#include <bits/stdc++.h>
using namespace std;
const int MM=53;
const int PP=1e9 + 7;
long long M[MM][MM];
long long W[MM][MM];
long long P[MM][MM];
void DK(int n)
{
    for(int i=1;i<=n;i++)   for(int j=1;j<=n;j++)   P[i][j]=0;
    for(int i=1;i<=n;i++)
    {
        for(int j=1;j<=n;j++)
        {
            for(int k=1;k<=n;k++)
            {
                P[i][j]+=M[i][k]*M[k][j];
                P[i][j]%=PP;
            }
        }
    }
    for(int i=1;i<=n;i++)   for(int j=1;j<=n;j++)   M[i][j]=P[i][j];
}
void MN(int n)
{
    for(int i=1;i<=n;i++)   for(int j=1;j<=n;j++)   P[i][j]=0;
    for(int i=1;i<=n;i++)
    {
        for(int j=1;j<=n;j++)
        {
            for(int k=1;k<=n;k++)
            {
                P[i][j]+=M[i][k]*W[k][j];
                P[i][j]%=PP;
            }
        }
    }
    for(int i=1;i<=n;i++)   for(int j=1;j<=n;j++)   W[i][j]=P[i][j];
}
void Pot(long long k, int n)
{
    while(k)
    {
        if((k&1)==1)    MN(n);
        DK(n);
        k>>=1;
    }
}
long long s=0;
int main()
{
    ios_base::sync_with_stdio(0);
    int n;
    long long k;
    cin>>n>>k;
    for(int i=1;i<=n;i++)   for(int j=1;j<=n;j++)   cin>>M[i][j];
    for(int i=1;i<=n;i++)   W[i][i]=1;
    Pot(k,n);
    for(int i=1;i<=n;i++)   for(int j=1;j<=n;j++)   s=(s+W[i][j]>=PP?s+W[i][j]-PP:s+W[i][j]);
    cout<<s;
}


Measured memory_bytes: 384
#include <iostream>
using namespace std;

int main() {
  int A = 0, B = 0, C = 0, D = 0;

  cin >> A >> B >> C >> D;

  if((A + B) == (C + D)){
    cout << "Balanced" << endl;
  }
  else if((A + B) > (C + D)){
    cout << "Left" << endl;
  }
  else{
    cout << "Right" << endl;
  }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
  while(1)
  {
  double a[1005],sum=0,sum1=0;
  int n;
  cin>>n;
  if(n==0)
  {
    break;
  }
  else
  {
  for(int i=0;i<n;i++)
  {
    cin>>a[i];
    sum=sum+a[i];
  }
  double av=sum/n;
  for(int i=0;i<n;i++)
  {
    sum1=sum1+(a[i]-av)*(a[i]-av);
  }
  double av1=sum1/n;
  printf("%.8lf\n",sqrt(av1));
}
}
}



Measured memory_bytes: 3224
from collections import deque

N = int(input())

d = deque([])
for i in range(N):
    a = input()
    if a == "deleteFirst":
        d.popleft()
    elif a == "deleteLast":
        d.pop()
    else:
        a, b = a.split()
        if a == "insert":
            d.appendleft(b)
        else:
            try:
                d.remove(b)
            except:
                pass

print(*d)


Measured memory_bytes: 69732
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstring>
#include <climits>
using namespace std;
static const double EPS = 1e-5;
typedef long long ll;

int uru(int y){
	return y%4==0 && (y%100!=0 || y%400==0);
}

int day(int y,int m,int d){
	int days=0;
	for(int i=1;i<=y-1;i++)days+=uru(i)+365;
	
	if(m>1)days+=31;
	if(m>2)days+=28+uru(y);
	if(m>3)days+=31;
	if(m>4)days+=30;
	if(m>5)days+=31;
	if(m>6)days+=30;
	if(m>7)days+=31;
	if(m>8)days+=31;
	if(m>9)days+=30;
	if(m>10)days+=31;
	if(m>11)days+=30;
	
	days+=d-1;
	return days;
}

main(){
	int y1,m1,d1,y2,m2,d2;
	while(cin>>y1>>m1>>d1>>y2>>m2>>d2){
		if(y1<0 || m1<0 || d1<0 ||
			y2<0 || m2<0 || d2<0)break;
		
		cout<<day(y2,m2,d2)-day(y1,m1,d1)<<endl;
	}
}

Measured memory_bytes: 0
#include<bits/stdc++.h>
using namespace std;
#define inf 99999999
#define N 1000007
#define ls x<<1
#define rs x<<1|1
priority_queue< int,vector<int>,greater<int> > q;
int tot,n,m,cnt,k;
int nex[2*N],fire[N],to[2*N];
int To[N],Mn[4*N],in[N],Ans[N];
inline int read()
{
    int x = 0,f =1; char c = getchar();
    while( c < '0' || c > '9') { if( c == '-') f =-1; c = getchar(); }
    while( c >= '0' && c <= '9') x = x * 10+c-48,c = getchar();
    return x * f;
}
void add(int u,int v){
    nex[++tot] = fire[u];
    fire[u] = tot;
    to[tot] = v;
    in[v]++;
    return;
}
void build(int x,int l,int r){
    Mn[x] = inf;
    if( l == r) return;
    int mid = l+r >>1;
    build( ls,l,mid); build( rs,mid+1, r);
}
void update(int x,int l,int r,int pos,int t){
    Mn[x] = min( Mn[x],t);
    if( l == r) return;
    int mid = l+r >>1;
    if( pos <= mid) update( ls,l,mid,pos,t);
    else update( rs,mid+1, r,pos,t);
}
int Ask(int x,int l,int r,int ll,int rr){
    if( ll > rr) return inf;
    if( l > rr || r < ll) return inf;
    if( ll <= l && r <= rr) return Mn[x];
    int mid = l+r >>1;
    return min( Ask( ls,l,mid,ll,rr),Ask( rs,mid+1, r,ll,rr));
}
void topo(){
    for(int i =1; i <= n; i++) if( !in[i]) q.push( i);
    while( !q.empty()){
        int u = q.top(); q.pop();
        Ans[u] =++cnt;
        for(int i = fire[u]; i; i = nex[i]){
            int v = to[i];
            in[v]--;
            if( !in[v]) q.push( v);
        }
    }
    return;
}
int main()
{
    scanf("%d%d",&n,&k);
    for(int i =1; i <= n; i++) To[read()] = i;
    build(1,1, n);
    for(int i = n; i >=1; i--){
        int now = Ask(1,1, n,To[i]+1, min( To[i]+k-1, n));
        if( now != inf) add( To[i],To[now]);
        now = Ask(1,1, n,max(1, To[i]-k+1),To[i]-1);
        if( now != inf) add( To[i],To[now]);
        update(1,1, n,To[i],i);
    }
    topo();
    for(int i =1; i <= n; i++) printf("%d\n",Ans[i]);
    return 0;
}


Measured memory_bytes: 34432
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, n) for (int i = (int)(n - 1); i >= 0; i--)
#define all(x) (x).begin(), (x).end()
#define sz(x) int(x.size())
#define get_unique(x) x.erase(unique(all(x)), x.end());
typedef long long ll;
typedef complex<double> Complex;
const int INF = 1e9;
const ll MOD = 1e9 + 7;
const ll LINF = 1e18;
template <class T>
bool chmax(T& a, const T& b) {
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
bool chmin(T& a, const T& b) {
    if (b < a) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
vector<T> make_vec(size_t a) {
    return vector<T>(a);
}
template <class T, class... Ts>
auto make_vec(size_t a, Ts... ts) {
    return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}

struct modint {
    ll x;
    modint(ll x = 0) : x((x % MOD + MOD) % MOD) {
    }
    ll value() const {
        return x;
    }
    modint operator-() const {
        return modint(-x);
    }
    modint& operator+=(const modint a) {
        if ((x += a.x) >= MOD) x -= MOD;
        return *this;
    }
    modint& operator-=(const modint a) {
        if ((x += MOD - a.x) >= MOD) x -= MOD;
        return *this;
    }
    modint& operator*=(const modint a) {
        (x *= a.x) %= MOD;
        return *this;
    }
    modint operator+(const modint a) const {
        modint res(*this);
        return res += a;
    }
    modint operator-(const modint a) const {
        modint res(*this);
        return res -= a;
    }
    modint operator*(const modint a) const {
        modint res(*this);
        return res *= a;
    }
    modint pow(ll t) const {
        if (t == 0) return 1;
        modint a = pow(t >> 1);
        a *= a;
        if (t % 2 == 1) a *= *this;
        return a;
    }
    modint inv() const {
        return pow(MOD - 2);
    }
    modint& operator/=(const modint a) {
        return (*this) *= a.inv();
    }
    modint operator/(const modint a) const {
        modint res(*this);
        return res /= a;
    }
};
struct combination {
    vector<modint> fact, ifact;
    combination(int n) : fact(n + 1), ifact(n + 1) {
        assert(n < MOD);
        fact[0] = 1;
        for (int i = 1; i <= n; i++) {
            fact[i] = fact[i - 1] * i;
        }
        ifact[n] = fact[n].inv();
        for (int i = n; i >= 1; i--) {
            ifact[i - 1] = ifact[i] * i;
        }
    }
    modint operator()(int n, int k) {
        if (n < k || k < 0) return 0;
        return fact[n] * ifact[k] * ifact[n - k];
    }
    modint h(int n, int k) {
        n += k - 1;
        if (k < 0 || k > n) return 0;
        return fact[n] * ifact[k] * ifact[n - k];
    }
} comb(2002002);
int main() {
    ll m, n;
    cin >> m >> n;
    cout << modint(m).pow(n).value() << endl;
}


Measured memory_bytes: 34260
mod = 10**9+7
def mul(f,g):
    n = len(f)
    m = len(g)
    h = [0]*(n+m-1)
    for i in range(n):
        for j in range(m):
            h[i+j] += f[i]*g[j]
            h[i+j] %= mod
    return h

def rev(f):
    h = [0]*len(f)
    for i in range(len(f)):
        h[i] += f[i]
        if i%2==1:
            h[i] *= -1
        h[i] %= mod
    return h

def add(f,g):
    if len(f)<len(g):
        f,g = g,f
    g += [0]*(len(f)-len(g))
    h = [0]*len(f)
    for i in range(len(f)):
        h[i] = f[i]+g[i]
        h[i] %= mod
    return h

def coef(n,P,Q):
    if n==0:
        return P[0]%mod
    q = mul(Q,rev(Q))[::2]
    if n%2==0:
        p = mul(P,rev(Q))[::2]
    else:
        p = mul(P,rev(Q))[1::2]
    return coef(n//2,p,q)

P = [0,0,0,0,0,1]
Q = [1]
for i in range(5):
    Q = mul(Q,[1,1])
for i in range(16):
    Q = mul(Q,[1,-1])

T = int(input())
for i in range(T):
    N = int(input())
    print(coef(N,P,Q))

Measured memory_bytes: 74364
#include <bits/stdc++.h>
#define all(a) a.begin(), a.end()
#define db(a) cout << fixed << #a << " = " << a << endl;

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	int n;
	cin >> n;
	string S;
	cin >> S;
	int st = 0, fn = n - 1;
	int c = 0;
	while (st < fn) {
		while (st < n && S[st] == 'R') {
			st++;
		}
		if (st == n) break;
		while (fn >= 0 && S[fn] == 'W') {
			fn--;
		}
		if (fn == -1) break;
		if (st < fn) {
			swap(S[st], S[fn]);
			c++;
		}
	}
	cout << c << endl;
}

//WRWWRWRR

//WR negali buti

//RR gali
//WW gali
//RW gali

//WWWRRWWW


Measured memory_bytes: 3756
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		//数取得
		int N = sc.nextInt();
		sc.close();

		int hh = N % 10;

		if(hh == 3) {
			System.out.println("bon");
		}else if(hh == 0 || hh == 1 || hh == 6 ||hh == 8){
			System.out.println("pon");
		}else {
			System.out.println("hon");
		}
	}

}


Measured memory_bytes: 35720
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;

template<typename T>
struct CumulativeSum2D {
    vector<vector<T>> acc;
    CumulativeSum2D(int h = 0, int w = 0) : acc(h + 1, vector<T>(w + 1)) { }
    void add(int i, int j, int x) { acc[i + 1][j + 1] += x; }
    void build() {
        int H = acc.size(), W = acc[0].size();
        for (int i = 1; i < H; i++) for (int j = 1; j < W; j++) {
            acc[i][j] += acc[i][j - 1] + acc[i - 1][j] - acc[i - 1][j - 1];
        }
    }
    T sum(int si, int sj, int ti, int tj) {     // [si, ti) x [sj, tj)
        return acc[ti][tj] - acc[si][tj] - acc[ti][sj] + acc[si][sj];
    }
};

int main() {
    int h, w; cin >> h >> w;
    int d; cin >> d;
    vector<string> field(h);
    for (auto &s: field) cin >> s;
    CumulativeSum2D<int> acc(h, w);
    for (int i = 0; i < h; i++) for (int j = 0; j < w; j++) {
        if (field[i][j] == '.') acc.add(i, j, 1);
    }
    acc.build();
    int cnt = 0;
    for (int i = 0; i < h; i++) {
        for (int j = 0; j + d <= w; j++) {
            if (acc.sum(i, j, i + 1, j + d) == d) cnt++;
        }
    }
    for ( int j = 0; j < w; j++) {
        for (int i = 0; i + d <= h; i++) {
            if (acc.sum(i, j, i + d, j + 1) == d) cnt++;
        }
    }
    cout << cnt << endl;
    return 0;
}


Measured memory_bytes: 3260
#include <bits/stdc++.h>
using namespace std;

typedef pair<int, int> P;
typedef long long ll;

#define rep(i, n) for(int i = 0; i < (n); i++)
#define repto(i, n) for(int i = 0; i <= (n); i++)
#define all(c) (c).begin(), (c).end()
#define uniq(c) c.erase(unique(all(c)), (c).end())
#define _1 first
#define _2 second
#define pb push_back
#define INF 1145141919
#define MOD 1000000007
#define DEBUG(x) cout << #x << ": " << x << endl;
template<typename T> T gcd(T a, T b) { if (b == 0) return a; return gcd(b, a % b); }

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

  string S, T;
  int A, B;
  string U;
  cin >> S >> T;
  cin >> A >> B;
  cin >> U;
  if (S == U)
    cout << A-1 << ' ' << B << endl;
  else
    cout << A << ' ' << B-1 << endl;
}


Measured memory_bytes: 256
from itertools import groupby
import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**5) 
 
def ii(): return int(stdin.readline())
def li(): return map(int, stdin.readline().split())
N, K = tuple(li())
S = stdin.readline() + "2"
# use window
l, r = 0, 0
cnt = 0
r_iter = groupby(S)
l_iter = groupby(S)
r_next = next(r_iter)
l_next = next(l_iter)
while r < N:
    # print(l, r, K)
    if K > 0:
        if r_next[0] == '1' and r > 0:
            K -= 1
        r += len(list(r_next[1]))
        r_next = next(r_iter)
        cnt = max(cnt, r - l)
    elif K == 0 and r_next[0] == "1":
        cnt = max(cnt, r - l)
        r += len(list(r_next[1]))
        r_next = next(r_iter)
        cnt = max(cnt, r - l)
    else:
        if l_next[0] == "0":
            K += 1
        l += len(list(l_next[1]))
        l_next = next(l_iter)
# print(l,r,K)
if r_next[0] == '1':
    cnt = max(cnt, r-l)
print(cnt)


Measured memory_bytes: 4236
def PrintArr(a)
	a.length.times { |i|
		print " " unless i == 0
		print a[i]
	}
	puts
end

n = gets.to_i
a = gets.chomp.split(" ").map &:to_i

for i in 0...n
	v = a[i]
	for j in 0..i
		break if v > a[i-(j+1)]
		a[i-j] = a[i-(j+1)]
	end
	a[i-j] = v
	PrintArr(a)
end

Measured memory_bytes: 8776
// inputに入力データ全体が入る
function Main(input) {
	// 1行目がinput[0], 2行目がinput[1], …に入る
  let inputs = input.split("\n");

  const [N,M] = inputs[0].split(' ').map(input=> Number(input));
  const array = inputs[1].split(' ').map(input=> Number(input));
  const res = N - ( array.reduce((a,b)=>a+b) )
    res > -1 ? console.log(res) : console.log(-1)
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));



Measured memory_bytes: 30688
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<vector>
#define rep(i,a,b) for(register int i=a;i<=b;i++)
#define dep(i,a,b) for(register int i=a;i>=b;i--)
#define ll long long
#define mem(x,num) memset(x,num,sizeof x)
#define reg(x) for(int i=last[x];i;i=e[i].next)
using namespace std;
inline ll read(){
	ll f=1,x=0;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}
//**********head by yjjr**********
#define pb push_back
#define inf 1e9
const int maxn=66,maxm=1e6+6,dx[4]={-1,1,0,0},dy[4]={0,0,-1,1},mod=1e9+7;
struct node{int x,y;}a[maxn<<1],que[maxn*maxn*4];
int n,m,K,ans,lx,ly,cnt[maxn][maxn],s1[maxm],s2[maxm],dis[maxn][maxn],head,tail;
bool fb[maxn][maxn],mark1[maxm],mark2[maxm];
vector<int>px,py;
void vnique(vector <int> &r){
	sort(r.begin(),r.end());
	auto t=unique(r.begin(),r.end());
	r.erase(t,r.end());
}
void bfs(int x,int y){
	rep(i,0,lx)rep(j,0,ly)dis[i][j]=inf;
	dis[x][y]=0;que[head=tail=1]=(node){x,y};
	while(head<=tail){
		int nx=que[head].x,ny=que[head++].y;
		rep(i,0,3){
			int nex=nx+dx[i],ney=ny+dy[i];
			if(nex>lx||nex<0||ney>ly||ney<0||dis[nex][ney]<=dis[nx][ny]+1||fb[nex][ney])continue;
			dis[nex][ney]=dis[nx][ny]+1;que[++tail]=(node){nex,ney};
		}
	}
}
int main()
{
	n=read(),m=read(),K=read();
	px.pb(1);px.pb(n+1);py.pb(1);py.pb(m+1);
	rep(i,1,n)s1[i]=m;
	rep(i,1,m)s2[i]=n;
	rep(i,1,K){
		a[i].x=read()+1,a[i].y=read()+1;
		px.pb(a[i].x),px.pb(a[i].x+1);
		py.pb(a[i].y),py.pb(a[i].y+1);
		s1[a[i].x]--,mark1[a[i].x]=1;
		s2[a[i].y]--,mark2[a[i].y]=1;
	}
	rep(i,1,n)s1[i]=(s1[i]+s1[i-1])%mod;
	rep(i,1,m)s2[i]=(s2[i]+s2[i-1])%mod;
	rep(i,1,n-1)if(!mark1[i]&&!mark1[i+1])ans=(ans+1ll*2*s1[i]*(s1[n]-s1[i]))%mod;
	rep(i,1,m-1)if(!mark2[i]&&!mark2[i+1])ans=(ans+1ll*2*s2[i]*(s2[m]-s2[i]))%mod;
	vnique(px);vnique(py);lx=px.size()-2;ly=py.size()-2;
	rep(i,1,K)
		fb[lower_bound(px.begin(),px.end(),a[i].x)-px.begin()][lower_bound(py.begin(),py.end(),a[i].y)-py.begin()]=1;
	rep(i,0,lx)rep(j,0,ly)cnt[i][j]=1ll*(px[i+1]-px[i])*(py[j+1]-py[j])%mod;
	rep(i,0,lx)rep(j,0,ly)
		if(!fb[i][j]){
			bfs(i,j);
			rep(k,0,lx)rep(p,0,ly)
				if(!fb[k][p])ans=(ans+1ll*cnt[i][j]*dis[k][p]%mod*cnt[k][p])%mod; 
   		}
	ans=(ans+mod)%mod;ans=1ll*ans*(mod/2+1)%mod;
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 8320
a = ['', 'A']
s = gets.chomp
x = []
2.times{|i|2.times{|j|2.times{|k|2.times{|l|
  x<<a[i]+'KIH'+a[j]+'B'+a[k]+'R'+a[l]
}}}}
puts x.index(s)?'YES':'NO'

Measured memory_bytes: 3836
#include <bits/stdc++.h>
using namespace std;
int main()
{
	int n,l;
	cin>>n>>l;
	vector <string> A(n);
	for (int i = 0; i < n; ++i)
	{
		cin>>A[i];
	}
	sort(A.begin(), A.end());
	for (int i = 0; i < A.size(); ++i)
	{
		cout<<A[i];
	}
	return 0;
}

Measured memory_bytes: 256
/// Containers Start
#include <algorithm>
#include <bitset>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <queue>
#include <regex>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
/// C Header Files
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <math.h>
#include <stdio.h>
/// Containers End

using namespace std;

/// Math Start
#define PI acos(-1.0)
#define Pi 3.141592653589793
#define EPS (1e-7)
#define INF (0x3f3f3f3f)
/// Math End

/// Extra Start
#define nn '\n'
#define pb push_back
#define ull unsigned long long
#define ll long long
#define MOD 1000000007
#define sz(a) int((a).size())
#define space " "
#define All(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
/// Extra End

#define rep(i, n) for (int i = 0; i < n; i++)
#define Cini(a)                                                                \
    int a;                                                                     \
    cin >> a;
#define Cinii(a, b)                                                            \
    int a, b;                                                                  \
    cin >> a >> b;
#define Ciniii(a, b, c)                                                        \
    int a, b, c;                                                               \
    cin >> a >> b >> c;
#define Cins(s)                                                                \
    string s;                                                                  \
    cin >> s;
#define Cinss(s1, s2)                                                          \
    string s1, s2;                                                             \
    cin >> s1 >> s2;
#define Cinc(c)                                                                \
    char c;                                                                    \
    cin >> c;
/// Functions End


/// Debug Start
#define deb(x) cout << #x << ": " << x << endl
#define deb2(x, y) cout << #x << ": " << x << '\t' << #y << ": " << y << endl;
#define deb3(x, y, z)                                                          \
    cout << #x << ": " << x << '\t' << #y << ": " << y << '\t' << #z << ": "   \
         << z << endl;
/// Debug End

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

/**>>>>>>>>>>>>>>>>>>> END <<<<<<<<<<<<<<<<<<**/

/// template


signed main(void) {
    cin.sync_with_stdio(false);
    cin.tie(0);
    Cini(K);
    Cins(S);
    if(S.length()<=K){
        cout << S << nn;
    }else{
        cout << S.substr(0,K) << "...";
        cout << endl;
    }
    return 0;
}

Measured memory_bytes: 3156
N = int(input())
A = list(map(int,input().split()))
x2l = {} # i+A_i
ans = 0
for i,a in enumerate(A,1):
    if i - a in x2l:
        ans += x2l[i-a]
    if i + a in x2l:
        x2l[i+a] += 1
    else:
        x2l[i+a] = 1
print(ans)

Measured memory_bytes: 111552
#[allow(unused_imports)]
use std::cmp::{max, min, Ordering};
#[allow(unused_imports)]
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};
#[allow(unused_imports)]
use std::io::{stdin, stdout, BufWriter, Read, StdoutLock, Write};
#[allow(unused_imports)]
use std::iter::FromIterator;
#[allow(unused_imports)]
use std::str::FromStr;

// christmas.rs --- Christmas
// author: Seong Yong-ju <sei40kr@gmail.com>

macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_macros)]
macro_rules! debug {
  ($($a:expr),*) => {
    println!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
  }
}

#[allow(dead_code)]
fn with_bufwriter<F: FnOnce(BufWriter<StdoutLock>) -> ()>(f: F) {
    let out = stdout();
    let writer = BufWriter::new(out.lock());
    f(writer);
}

fn f(a: &Vec<i64>, p: &Vec<i64>, n: usize, x: i64) -> i64 {
    if n == 0 {
        return if 0 < x { 1 } else { 0 };
    } else if x <= a[n] / 2 {
        return f(a, p, n - 1, x - 1);
    }
    return p[n - 1] + f(a, p, n - 1, x - a[n - 1] - 2) + 1;
}

fn main() {
    input! {
      n: usize,
      x: i64
    }

    let mut a = vec![1i64; n + 1];
    let mut p = vec![1i64; n + 1];
    for i in 1..(n + 1) {
        a[i] = a[i - 1] * 2 + 3;
        p[i] = p[i - 1] * 2 + 1;
    }

    with_bufwriter(|mut out| writeln!(out, "{}", f(&a, &p, n, x)).unwrap());
}


Measured memory_bytes: 4352
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = SR()
    return l
mod = 1000000007

#A
def A():
    a,b,c = LI()
    if a not in [b,c]:
        print(a)
    elif b not in [a,c]:
        print(b)
    else:
        print(c)
    return

#B
def B():
    return

#C
def C():
    def bfs(a,b):
        bfs_map = [1 for i in range(n)]
        bfs_map[0] = 0
        q = deque()
        q.append(0)
        s = 1
        while q:
            x = q.pop()
            for y in v[x]:
                if [x,y] != [a,b] and [x,y] != [b,a]:
                    if bfs_map[y]:
                        bfs_map[y] = 0
                        q.append(y)
                        s += 1
        return s
    n,m = LI()
    v = [deque() for i in range(n)]
    l = deque()
    for i in range(m):
        a,b = LI()
        a -= 1
        b -= 1
        v[a].append(b)
        v[b].append(a)
        l.append([a,b])
    ans = 0
    for a,b in l:
        s = bfs(a,b)
        if s < n:
            ans += 1
    print(ans)
#D
def D():
    n,k = LI()
    v = [None for i in range(n)]
    for i in range(n):
        v[i] = LI()
        v[i] = [[None,None]]+[v[i]]
    v.sort(key = lambda x:x[1][1])
    for i in range(n):
        v[i][0][1] = i
    v.sort(key = lambda x:x[1][0])
    for i in range(n):
        v[i][0][0] = i
    po = [[None for i in range(n)] for j in range(n)]
    h = [None for i in range(n)]
    w = [None for i in range(n)]
    for i in range(n):
        po[v[i][0][0]][v[i][0][1]] = v[i][1]
        h[v[i][0][0]] = v[i][1][0]
        w[v[i][0][1]] = v[i][1][1]
    re = [[[[0 for x in range(n)] for y in range(n)] for t in range(n)] for s in range(n)]
    ans = float("inf")
    for s in range(n):
        for t in range(n):
            for y in range(s,n):
                for x in range(t,n):
                    if x == t:
                        re[s][t][y][x] = re[s][t][y-1][x]
                    else:
                        re[s][t][y][x] = max(0,re[s][t][y][x-1]+re[s][t][y-1][x]-re[s][t][y-1][x-1])
                    if po[y][x] != None:
                        re[s][t][y][x] += 1
                    if re[s][t][y][x] >= k:
                        ans = min(ans,(h[y]-h[s])*(w[x]-w[t]))
    print(ans)
#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#Solve
if __name__ == "__main__":
    A()


Measured memory_bytes: 39792
def resolve():
    X, Y = input().split()
    ans = 0
    if X == "3":
        ans += 100000
    elif X == "2":
        ans += 200000
    elif X == "1":
        ans += 300000
    else:
        ans += 0
    if Y == "3":
        ans += 100000
    elif Y == "2":
        ans += 200000
    elif Y == "1":
        ans += 300000
    else:
        ans += 0
    if X == "1" and Y == "1":
        ans += 400000
    else:
        ans += 0
    print(ans)
resolve()

Measured memory_bytes: 9108
#include<iostream>
#include<algorithm>
#include<vector>

using namespace std;

int cnt = 0;
void insertionSort( vector<int> &elems, int n, int g )
{
	int i, j, v;
	for( i=0; i<n; i++ ) {
		v = elems[i];
		j = i - g;
		while( 0 <= j and v < elems[j] ) {
			elems[ j+g ] = elems[j];
			j -= g;
			cnt++;
		}
		elems[ j+g ] = v;
	}
	return;
}

void shellSort( vector<int> &elems, int n )
{
	cnt = 0;
	int m;
	vector<int> G(100);
	
	G[0] = 1;
	for( int i=1; ; i++ ) {
		m = G[ i-1 ]*3+1;
		if( m < n ) { 
			G[i] = m;
		} else {
			m = i;
			break;
		}
	}
	cout<<m<< '\n';	
	sort( G.rbegin( ), G.rend( ) );
	for( int i=0; i<m; i++ ) {
		cout<<G[i];
		if( i != G.size( )-1 ) { cout<<" "; }
	}
	cout<<'\n';
	
	for( int i=0; i<m; i++ ) {
		insertionSort( elems, n, G[i] );
	}
	cout<<cnt<<'\n';
	
	return;
}

int main( )
{	
    int n;
    ios::sync_with_stdio( false );
    cin>>n;
    
    vector<int> elems(n);
    for( int i=0; i<n; i++ ) {
    	cin>>elems[i];
    }
    
    shellSort( elems, n );
    for( int i=0; i<n; i++ ) {
    	cout<<elems[i]<<'\n';
    }	
	return 0;
}

Measured memory_bytes: 4896
import java.util.Scanner;

public class Main {
	
	public static void main(String[] args){
		
		Scanner scan = new Scanner(System.in);
		int sand = scan.nextInt();
		int sec = scan.nextInt();
		
		if(sand - sec < 0){
			System.out.println("0");
		} else {
			System.out.println(sand - sec);
		}
	}

}


Measured memory_bytes: 23764
#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <algorithm>
#include <climits>
#include <cstring>
#include <cmath>
#include <stack>
#include <iomanip>
#include <tuple>
#include <functional>
#include <cfloat>
#include <map>
#include <stdio.h>
#include <string.h>
using ll = long long;

using namespace std;

//LLONG_MAX = 90^18
#define int long long
#define CONTAINS(v,n) (find((v).begin(), (v).end(), (n)) != (v).end())
#define SORT(v) sort((v).begin(), (v).end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
#define ARY_SORT(a, size) sort((a), (a)+(size))
#define REMOVE(v,a) (v.erase(remove((v).begin(), (v).end(), (a)), (v).end()))
#define REVERSE(v) (reverse((v).begin(), (v).end()))
#define LOWER_BOUND(v,a) (lower_bound((v).begin(), (v).end(), (a)))
#define UPPER_BOUND(v,a) (upper_bound((v).begin(), (v).end(), (a)))
#define REP(i, n) for (int (i)=0; (i) < (n); (i)++)
#define CONTAINS_MAP(m, a) (m).find((a)) != m.end()
void YesNo(bool b) { cout << b ? "Yes" : "No"; }
void Yes() { cout << "Yes"; }
void No() { cout << "No"; }



signed main()
{
	char N[10];

	cin >> N;

	for (int i = 0; i < strlen(N); i++)
	{
		if (N[i] == '7')
		{
			Yes();
			return 0;
		}
	}
	No();
}




Measured memory_bytes: 3572
#include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;++i)
#define all(a) a.begin(),a.end()
#define P pair<long long,long long>
#define double long double
using namespace std;
signed main(){
  int a;
  cin>>a;
  if(a==100000)
    cout<<90909;
  if(10000<=a&&a<100000)
    cout<<a-9999+909;
  if(1000<=a&&a<10000)
    cout<<909;
  if(100<=a&&a<1000)
    cout<<a-99+9;
  if(10<=a&&a<100)
    cout<<9;
  if(1<=a&&a<10)
    cout<<a;
}

Measured memory_bytes: 256
using System;
using System.Linq;
using System.Collections.Generic;


public class Test
{
	public static void Main( )
	{

		var nk = Console.ReadLine().Trim().Split().Select( x => int.Parse( x ) ).ToArray();
		int n = nk[0];
		int k = nk[1];
		
		int w;
		int sum;
		int[] total = new int[n+1];

		sum = 0;
		for( int i=0; i<n; i++ ) {
			w = int.Parse( Console.ReadLine().Trim() );
			sum += w;
			total[i+1] = sum;
		}

		int P,packages;
		int truck;
		int next;
		
		int left, right, mid;
		
		left = 1;
		right = sum;
		P = mid = sum;
		while( left <= right ) {
			mid = (left+right)/2;
			packages = mid;
			truck = 1;
			for( int i=1; i<=n; i++ ) {
				if(  packages < total[i]  ) {
					truck++;

					if( k < truck ) { break; }
					i--;
					next = i;
					packages = total[next]+mid;
				}
			}
			
			if( k < truck ) {
				left = mid+1;
			} else {
				P = Math.Min( P, mid );
				right = mid-1;
			}
		}
		
		Console.WriteLine( "{0}", P );

		return;
	}
}



Measured memory_bytes: 20492
#include <stdio.h>

int main(void) {
	int h,w;
	do{
		scanf("%d%d",&h,&w);
		for(int i = 0; i < h; i++){
			for(int j = 0; j < w; j++){
				if((i+j)%2){
					printf(".");
				}else{
					printf("#");
				}
			}
			printf("\n");
		}
		if(!(h&&w))break;
		printf("\n");
	}while(1);
	return 0;

}



Measured memory_bytes: 2044
#include <bits/stdc++.h>
using namespace std;

int main() {
  int H, W, k = 0;
  while(1){
    if(k > 0)
      cout << endl;
    cin >> H >> W;
    //new line between blocks
    if(H == 0 && W == 0)
      break;
    for (int i = 0; i < H; i++){
      for(int j = 0; j < W; j++){
        
        //odds column(奇数列)
        if(i % 2 == 0){
          //odds row(奇数行)
          if(j % 2 == 0)
            cout << "#";
          //even row(偶数行)
          else
            cout << ".";
        }
        
        //even column(偶数列)
        else{
          //odds row(奇数行)
          if(j % 2 == 0)
            cout << ".";
          //even row(偶数行)
          else
            cout << "#";  
        }
        
        //new line in blocks
        if(j == W - 1){
          cout << endl;
          break;
        }  
      }
    }
    k++;
  }
}



Measured memory_bytes: 3080