akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>

// increment
#define rep_n(_1, _2, _3, NAME, ...) NAME
#define rep_2(i, n) for (int(i) = 0; (i) < (int)(n); ++(i))
#define rep_3(i, initial, n) for (int(i) = (int)(initial); (i) < (int)(n); ++(i))
#define rep(...) rep_n(__VA_ARGS__, rep_3, rep_2, rep_1)(__VA_ARGS__)
// decrement
#define rep_r_n(_1, _2, _3, NAME, ...) NAME
#define rep_r_2(i, n) for (int(i) = (int)(n); (i) > 0; (i)--)
#define rep_r_3(i, initial, n) for (int(i) = (int)(initial); (i) > (int)(n); (i)--)
#define rep_r(...) rep_r_n(__VA_ARGS__, rep_r_3, rep_r_2)(__VA_ARGS__)
// define type definition
using namespace std;
typedef long long ll;
using mpint = boost::multiprecision::cpp_int; // 多倍長整数（任意精度）
typedef pair<int, int> P;

// define construct variable
const double EPS = numeric_limits<double>::epsilon();
// 10^9 + 7
const ll MOD = ll(1e9) + 7;
const ll INF = ll(1e10);
const string ALPHABET = "abcdefghijklmnopqrstuvwxyz";
const double PI = acos(-1);

// define methods
// 最大公約数
ll gcd(const ll a, const ll b) { return b ? gcd(b, a % b) : a; }
// 最小公倍数
ll lcm(const ll a, const ll b) { return a / gcd(a, b) * b; }
// char -> int
int ctoi(char c) { return (int)(c - '0'); }
// 素因数分解
vector< pair<ll, ll> > prime_factorize(ll n)
{
	vector<pair<ll, ll>> p;
	for (ll i = 2; i * i <= n; i++)
	{
		if ((n % i) != 0)
			continue;
		pair<ll, ll> a = make_pair(i, 0);
		while ((n % i) == 0)
		{
			n /= i;
			a.second += 1;
		}
		p.push_back(a);
	}

	if (n != 1)
		p.push_back(make_pair(n, 1));
	return p;
}
// 組み合わせの整合性を保つ（後ほど解析する）
ll modinv(ll a)
{
	ll b = MOD, u = 1, v = 0;
	while (b)
	{
		ll t = a / b;
		a -= t * b;
		swap(a, b);
		u -= t * v;
		swap(u, v);
	}
	u %= MOD;
	if (u < 0)
	{
		u += MOD;
	}
	return u;
}
// 順列
ll permutation(const ll n, const ll m)
{
	ll result = 1;
	for (ll i = n; i > n - m; i--)
	{
		result = (result * i) % MOD;
	}
	return result;
}

// 繰り返し n 乗法
ll repeat_square(const ll n, const ll x)
{
	if (x == 0)
		return 1;
	ll res = repeat_square(n, x / 2);
	res = res * res % MOD;
	if ((x % 2) == 1)
		res = res * n % MOD;
	return res;
}
// 組み合わせ nCm
ll combination(ll n, ll m)
{
	ll p = permutation(n, m);
	ll div = 1;
	for (ll i = 2; i <= m; i++)
	{
		div = (div * i) % MOD;
	}
	return (p * modinv(div)) % MOD;
}

void dfs(int m, int A, int B, int C, int ans) {
	if (A == m && B == m && C == m) {
		cout << ans << endl;
		exit(0);
	}

	if (A > m || B > m || C > m) return;
	dfs(m, A+2, B, C, ans+1);
	dfs(m, A, B+2, C, ans+1);
	dfs(m, A, B, C+2, ans+1);
	dfs(m, A+1, B+1, C, ans+1);
	dfs(m, A, B+1, C+1, ans+1);
	dfs(m, A+1, B, C+1, ans+1);
	return;
}

int main() {
	int A, B, C;
	cin >> A >> B >> C;

	int m = max({A, B, C});
	int ans = 0;
	if ((A % 2 == 0 && B % 2 == 0 && C % 2 == 0) || (A % 2 == 1 && B % 2 == 1 && C % 2 == 1)) {
		int	diff1 = (m - A) / 2;
		int	diff2 = (m - B) / 2;
		int diff3 = (m - C) / 2;
		ans = diff1 + diff2 + diff3;
	} else {
		int ans2 = 0, ans3 = 0;
		dfs(m+1, A, B, C, ans2);
		dfs(m, A, B, C, ans3);
		ans = max({ans2, ans3});
	}

	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 3608
// include
// ------------------------------------------------
#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
#include <math.h>

using namespace std;

// func
// ------------------------------------------------
int CalcSumOfDigit(int n);      // 各桁の和を計算する。
string upper(string str);       // 英字を大文字に変換する。
string lower(string str);       // 英字を小文字に変換する。

// define
// ------------------------------------------------
#define all(a)        (a).begin(),(a).end()
#define rall(a)       (a).rbegin(),(a).rend()
#define pb            push_back
#define sz(a)         int((a).size())
#define rep(i,n)      for(int(i)=0;(i)<(n);(i)++)
#define repe(i,n)     for(int(i)=0;(i)<=(n);(i)++)
#define vsort(v)      sort((v).begin(),(v).end())
#define rvsort(v)     sort(rall((v)))
#define vi            vector<int>
#define GCD(a,b)      __gcd((a),(b))
#define LCM(a,b)      (a)/GCD((a),(b))*(b)

const int INF = 1e9;

// code
// ------------------------------------------------
int main() {

  int a,b;
  int A=0,B=0;

  cin >> a >> b;
  
  rep(i,b)
  {
    A += a * pow(10,i);
  }

  rep(i,a)
  {
    B += b * pow(10,i);
  }

  cout << (a > b ? B : A);

  return 0;
}

// funcの実体
// ------------------------------------------------
int CalcSumOfDigit(int n)
{
  int s = 0;
  while(n)
  {
    s += n % 10;
    n = n / 10;
  }
  return s;
}

string upper(string str)
{
  for(auto itr = str.begin();itr != str.end() ; itr++)
  {
    if(97 <= *itr && *itr <= 122)
    {
      *itr = *itr - 32;
    }
  }
  return str;
}

string lower(string str)
{
  for(auto itr = str.begin();itr != str.end() ; itr++)
  {
    if(65 <= *itr && *itr <= 90)
    {
      *itr = *itr + 32;
    }
  }
  return str;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <string>
#include <algorithm>
#include <string.h>
#include <ctype.h>
#include <math.h>
#include <float.h>
#include <iomanip>
#include <iostream>
using namespace std;

int main()
{
    double R,G;
    cin>>R>>G;

    cout << G*2 -R <<endl;

    return 0;
}


Measured memory_bytes: 256
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

A, B = MAP()

print(max(A+B, A-B, A*B))


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

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

#define pb push_back
#define rep(i, n) for(int i = 0; i < (n); i++)
#define dep(i, a, n) for(int i = a; i >= (n); i--)
#define FOR(i, a, n) for(int i = a; i < (n); i++)
#define mod (ll)(1e9+7)
#define int ll
#define INF 100000000

__attribute__((constructor))
void initial() {
  cin.tie(0);
  ios::sync_with_stdio(false);
}

signed main() {
	ll n, a1[101], a2[101], sum = 0, result = 0;
  cin >> n;
  rep(i, n) cin >> a1[i];
  rep(i, n) cin >> a2[i];
  rep(i, n) {
    sum = 0;
    rep(k, i + 1) sum += a1[k];
    FOR(j, i, n) {
      sum += a2[j];
    }
    result = max(result, sum);
  }
  cout << result << endl;
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main()
{
    // 整数の入力
    int mojisu[3];
    cin >> mojisu[0] >> mojisu[1] >>mojisu[2];
  	int gomoji = 0;
  	int nanamoji = 0;
	for(int i=0;i<3;i++){
      if(mojisu[i] == 5) gomoji++;
      if(mojisu[i] == 7) nanamoji++;
    }
  	string s;
    if(gomoji == 2 && nanamoji == 1){
      s = "YES";
    }
    else {
      s = "NO";
    }
    // 文字列の入力
    cout << s << endl;
    return 0;
}


Measured memory_bytes: 256
//自称高知能系Vtuberの高井茅乃です。
//Twitter: https://twitter.com/takaichino
//YouTube: https://www.youtube.com/channel/UCTOxnI3eOI_o1HRgzq-LEZw

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

#define INF 1999999999
#define REP(i,n) for(int i=0;i<n;i++)
#define REP1(i,n) for(int i=1;i<=n;i++)
#define MODA 1000000007 

int main() {
    int ans = 0;
    int tmp;
    int a,b,c,d;
    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;
    //cout << ans << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include <cstring>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
typedef pair<int,int> pint;
typedef pair<ll,int> pli;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;

vector<int> fto[100010], sto[100010]; int fdist[100010], sdist[100010];

void fdfs(int u, int p){
  for(int v: fto[u]){
    if(v==p) continue;
    if(fdist[v]!=0) continue;
    fdist[v] = fdist[u]+1;
    fdfs(v, u);
  }
}
void sdfs(int u, int p){
  for(int v: sto[u]){
    if(v==p) continue;
    if(sdist[v]!=0) continue;
    sdist[v] = sdist[u] + 1;
    sdfs(v, u);
  }
}
 
int main(){
  int N; cin >> N; 
  int snu=0, fene=0;
  rep(i, N-1){
    int a, b; cin >> a >> b; a--; b--;
    fto[a].push_back(b);
    fto[b].push_back(a);
    sto[a].push_back(b);
    sto[b].push_back(a);
  }
  fdfs(0, -1); sdfs(N-1, -1);
  rep(i, N){
    if(fdist[i]<=sdist[i]) fene++;
    else snu++;
  }
  if(fene>snu) cout << "Fennec" << endl;
  else cout << "Snuke" << endl;
    
    
}

Measured memory_bytes: 16640
#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

int main()
{
	string str;
	string str2;
	
	cin >> str;
	
	str2 = str;
	
	reverse(str.begin(), str.end());
	
	if (str == str2) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
	
	return (0);
}

Measured memory_bytes: 256
road = []
3.times do
  a, b = gets.chop.split.map(&:to_i)
  road << a
  road << b
end
if road.find_all{|n| n == 1}.length >= 3 || road.find_all{|n| n == 2}.length >= 3 || road.find_all{|n| n == 3}.length >= 3 || road.find_all{|n| n == 4}.length >= 3
  puts 'NO'
else
  puts 'YES'
end

Measured memory_bytes: 1788
import java.io.BufferedReader;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.ListIterator;
import java.util.Map.Entry;


import java.util.PriorityQueue;
import java.util.Random;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;


public class Main {
	
	public static void main(String[] args) throws IOException {	
		try(final Scanner sc = new Scanner(System.in)){
			final char[] S = sc.next().toCharArray();
			final char[] T = sc.next().toCharArray();
			
			int answer = 0;
			for(int i = 0; i < S.length; i++) {
				if(S[i] != T[i]) { answer++; }
			}
			
			System.out.println(answer);
		}
	}

	public static class Scanner implements Closeable {
		private BufferedReader br;
		private StringTokenizer tok;

		public Scanner(InputStream is) throws IOException {
			br = new BufferedReader(new InputStreamReader(is));
		}

		private void getLine() throws IOException {
			while(!hasNext()){
				tok = new StringTokenizer(br.readLine());
			}
		}

		private boolean hasNext() {
			return tok != null && tok.hasMoreTokens();
		}

		public String next() throws IOException {
			getLine();
			return tok.nextToken();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}
		

		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}

		public int[] nextIntArray(int n) throws IOException {
			final int[] ret = new int[n];
			for(int i = 0; i < n; i++){
				ret[i] = this.nextInt();
			}
			return ret;
		}

		public long[] nextLongArray(int n) throws IOException {
			final long[] ret = new long[n];
			for(int i = 0; i < n; i++){
				ret[i] = this.nextLong();
			}
			return ret;
		}

		public void close() throws IOException {
			br.close();
		}
	}
}


Measured memory_bytes: 38184
#include <iostream>
#include <utility>
#include <string>
#include <algorithm>
#include <map>
#include <vector>
#include <climits>
using namespace std;
signed main()
{
	ios::sync_with_stdio(false);
	int d, n;
	cin >> d >> n;
	if (n == 100)n = 101;
	for (int i = 0; i < d; i++) {
		n *= 100;
	}
	cout << n;
}

Measured memory_bytes: 256
a, b, m = map(int, input().split())
A = [int(ae) for ae in input().split()]
B = [int(be) for be in input().split()]

amin = min(A)
bmin = min(B)
smin = amin + bmin

for i in range(m):
  x, y, c= map(int, input().split())
  th = smin + c
  apmin = A[x-1]
  if apmin > th:
    pass
  else:
    bpmin = B[y-1]
    spmin = apmin + bpmin -c
    if spmin < smin:
      smin = spmin
    else:
      pass
print(smin)



Measured memory_bytes: 18500
MOD = 1000000007
N = int(input())
A = list(map(int,input().split()))
xorsum = 0
for i in range(64):
    zc = 0
    oc = 0
    for j in range(N):
        if A[j]%2 == 0:
            zc += 1
        else:
            oc += 1
        A[j] //= 2
    xorsum += oc*zc*(2**i)
    xorsum %= MOD
print(xorsum%MOD)

Measured memory_bytes: 122936
#include <vector>
#include <utility>
#include <iostream>
using namespace std;

vector<vector<int>> graph;
vector<pair<int, int>> timestamp;
int time__=0;

void dfs(int v){
  if (timestamp[v].first == 0)
    timestamp[v].first = ++time__;
  else
    return;
  for (int i=0;i<graph[v].size();++i){
    dfs(graph[v][i]);
  }
  timestamp[v].second = ++time__;
}

int main(){
  int n;
  cin >> n;
  graph.resize(n+1); timestamp.resize(n+1);
  for (int i=0;i<n;++i){
    int id,k;
    cin >> id >> k;
    for(int j=0;j<k;++j){
      int temp;
      cin >> temp;
      graph[i].push_back(temp-1);
    }
  }

  for (int i=0;i<n;i++)
    dfs(i);

  for (int i=0;i<n;i++){
    cout << i+1 << " " <<timestamp[i].first << " " << timestamp[i].second << endl;
  }

  return 0;
}



Measured memory_bytes: 3176
#include <iostream>
#include <array>
#include <algorithm>
#include <vector>
#include <bitset>
#include <set>
#include <unordered_set>
#include <cmath>
#include <complex>
#include <deque>
#include <iterator>
#include <numeric>
#include <map>
#include <unordered_map>
#include <queue>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <limits>
#include <iomanip>
#include <functional>
#include <cassert>
using namespace std;

using ll=long long;
template<class T> using V = vector<T>;
template<class T, class U> using P = pair<T, U>;
using vll = V<ll>;
using vvll = V<vll>;
#define rep(i, k, n) for (ll i=k; i<(ll)n; ++i)
#define REP(i, n) rep(i, 0, n)
#define ALL(v) v.begin(),v.end()
template < class T > inline bool chmax(T& a, T b) {if (a < b) { a=b; return true; } return false; }
template < class T > inline bool chmin(T& a, T b) {if (a > b) { a=b; return true; } return false; }
#define DEBUG_VLL(vec) REP(sz, vec.size()) std::cerr<<vec[sz]<<(sz==vec.size()-1?'\n':' ');

const long long MOD = 1000000007;
const long long HIGHINF = (long long)1e18;
const int INF = (int)1e9;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n, l; cin >> n >> l;
    vll a(n);
    for (ll i = 0; i < n; i++) cin >> a[i];

    ll li = -1;
    for (ll i = 1; i < n; i++) {
        if (a[i - 1] + a[i] >= l) {
            li = i;
            break;
        }
    }

    if (li == -1) cout << "Impossible\n";
    else {
        cout << "Possible\n";
        for (ll i = 0; i < li - 1; i++) cout << i + 1 << '\n';
        for (ll i = n - 1; i > li; i--) cout << i << '\n';
        cout << li << '\n';
    }
    return 0;
}


Measured memory_bytes: 1664
import java.util.*;
public class Main {
	public static int [] coin ={500,100,50,10,5,1};
	public static int [] n = new int[6];
    public static void main(String[] args) throws java.io.IOException{
        Scanner scan = new Scanner(System.in);
        while(true){
       int p= scan.nextInt();
       if(p==0)break;
     for(int i=5;i>=0;i--)n[i] = scan.nextInt();

     int ans=1000000;
  for(int i=p;i<p+1000;i++)
	 ans =Math.min(ans,buy(i)+change(i-p));
	  System.out.println(ans);
        }
    }
  public static int change(int n){
	  int sum=0;
	  for(int i=0;i<6;i++){
		  if(n>=coin[i]){
		 sum+= n/coin[i];
		 n%=coin[i];
		  }
	  }
	  return sum;

  }

  public static int buy(int c){
	  int sum=0;
	  for(int i=0;i<6;i++){
		  if(c>=coin[i]){
			  int tmp=Math.min(c/coin[i],n[i]);
			  sum+=tmp;
			  c-=coin[i]*tmp;
		  }
	  }if(c!=0)sum=1000000;
	  return sum;
  }
  }

Measured memory_bytes: 12000
#include <iostream>
#include <string>
using namespace std;
int main(){
    string week[] = {"SUN","MON","TUE","WED","THU","FRI","SAT",};
    string s; cin >> s;
    for(int i = 0; i < 7; i++) if(week[i] == s) cout << 7-i << endl;
    return 0;
}

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

namespace CSharpSample01
{

    class Program
    {
        

        static int NextMayor(int n, int all_p, int[] num_of_cand_have)
        {
            int next_mayor = 0;
            int now_cand = 0;
            int num_p_cuphave = all_p;

            bool do_find = false;

            while (!do_find)
            {
                //今お椀にある小石を配布する-----------

                //みんなが等しく受けとる量
                int num_everyone_take = num_p_cuphave / n;
                if(num_everyone_take != 0)
                {
                    for (int i = 0; i < n; i++)
                    {
                        num_of_cand_have[i] += num_everyone_take;
                    }
                }                
                
                //余った小石を受け取る
                for(int i = 0; i < num_p_cuphave % n; i++)
                {
                    num_of_cand_have[now_cand]++;
                    now_cand = (now_cand + 1) % n;                             
                }

                //配布したのでお椀の中は空になる
                num_p_cuphave = 0;

                //小石を全て持っている人(次の町長)がいないか確認
                for(int i = 0; i < n; i++)
                {
                    if(num_of_cand_have[i] == all_p)
                    {
                        do_find = true;
                        next_mayor = i;
                        break;
                    }
                }

                //now_cand番目の人から順に見て、小石を持っていたら小石を全部お椀に入れる
                int sub_now_cand = now_cand;
                for(int i = 0; i < n; i++)
                {
                    if(num_of_cand_have[sub_now_cand] != 0)
                    {
                        num_p_cuphave = num_of_cand_have[sub_now_cand];
                        num_of_cand_have[sub_now_cand] = 0;
                        break;
                    }
                    sub_now_cand = (sub_now_cand + 1) % n;
                }

                now_cand = (sub_now_cand + 1) % n;
               
            }
           
            return next_mayor;
        }



        static void Main(string[] args)
        {

            while (true)
            {
                string[] input = Console.ReadLine().Split(' ');
                int n = int.Parse(input[0]);
                int p = int.Parse(input[1]);

                if(n == 0 && p == 0)
                {
                    break;
                }

                int[] num_of_p = new int[n];

                for(int i = 0; i < n; i++)
                {
                    num_of_p[i] = 0;
                }

                Console.WriteLine(NextMayor(n, p, num_of_p));
                
            }
            
        }
    }
}


Measured memory_bytes: 15960
#include<iostream>
using namespace std;
long long dp[1005][1005];
long long h, w;
char a[1005][1005];
int main(){
	cin >> h >> w;
	for(int i=1;i<=h;i++) 
		for (int j=1;j<=w;j++)
			cin >> a[i][j];
	for (int i=1;i<=h;i++){
		if (a[i][1]=='.') dp[i][1]=1;
		else break;
	}
	for (int i=1;i<=w;i++) {
		if (a[1][i]=='.') dp[1][i]=1;
		else break;
	}
	for(int i=2;i<=h;i++) 
		for (int j=2;j<=w;j++){
			if (a[i][j]=='.'){
				dp[i][j]=(dp[i-1][j]+dp[i][j-1])%1000000007;
			}
			else {
				dp[i][j]=0;
			}
		}
	cout << dp[h][w];
} 

Measured memory_bytes: 9088
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = (0); i < (n); ++i)
#define ALL(obj) (obj).begin(), (obj).end()
#define DEBUG(val) cout << #val << " : " << val << endl
#define MOD 1000000007

int ans[305][305];
int now_k = 1;
vector<string> data;
int h, w, k;

// 横に切った後に埋めるfunction
void fill_data(int f, int g) {
  int ichigo_count = 0;
  REP(j, w) {
    // now_k val 決め
    FOR(i, f, g + 1) {
      if (data[i][j] == '#') ichigo_count++;
    }
    if (ichigo_count > 1) {
      now_k++;
      ichigo_count = 1;
    }
    FOR(i, f, g + 1) { ans[i][j] = now_k; }
  }
  now_k++;
}

int main() {
  cin >> h >> w >> k;
  REP(i, h) {
    string s;
    cin >> s;
    data.push_back(s);
  }
  queue<pair<int, int>> q;
  bool pre_ichigo = false;
  int pre_pos = 0;

  REP(i, h) {
    bool i_ichigo = (data[i].find('#') != string::npos);
    if (pre_ichigo && i_ichigo) {
      q.push(make_pair(pre_pos, i - 1));
      pre_ichigo = false;
      pre_pos = i;
    }
    pre_ichigo = pre_ichigo || i_ichigo;
  }
  q.push(make_pair(pre_pos, h - 1));

  while (!q.empty()) {
    fill_data(q.front().first, q.front().second);
    q.pop();
  }

  REP(i, h) {
    REP(j, w) {
      if (j != w - 1) {
        cout << ans[i][j] << " ";
      } else {
        cout << ans[i][j] << endl;
      }
    }
  }
}

Measured memory_bytes: 1408
#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<vector>
#include<cmath>
#include<algorithm>
#include<map>
#include<queue>
#include<deque>
#include<iomanip>
#include<tuple>
#include<cassert>
using namespace std;
typedef long long int LL;
typedef pair<int,int> P;
typedef pair<LL,int> LP;
const int INF=1<<30;
const LL MAX=1e9+7;

void array_show(int *array,int array_n,char middle=' '){
	for(int i=0;i<array_n;i++)printf("%d%c",array[i],(i!=array_n-1?middle:'\n'));
}
void array_show(LL *array,int array_n,char middle=' '){
	for(int i=0;i<array_n;i++)printf("%lld%c",array[i],(i!=array_n-1?middle:'\n'));
}
void array_show(vector<int> &vec_s,int vec_n=-1,char middle=' '){
	if(vec_n==-1)vec_n=vec_s.size();
	for(int i=0;i<vec_n;i++)printf("%d%c",vec_s[i],(i!=vec_n-1?middle:'\n'));
}
void array_show(vector<LL> &vec_s,int vec_n=-1,char middle=' '){
	if(vec_n==-1)vec_n=vec_s.size();
	for(int i=0;i<vec_n;i++)printf("%lld%c",vec_s[i],(i!=vec_n-1?middle:'\n'));
}

int main(){
	int n,m;
	int i,j,k;
	LL a,b,c;
	LL x,y;
	cin>>a>>x;
	cin>>b>>y;
	b=abs(b-a);
	cin>>a;
	if(b==0 || (x>y && b<=a*(x-y))){
		cout<<"YES"<<endl;
	}else cout<<"NO"<<endl;
}

Measured memory_bytes: 3640
k = int(input())
a = []
for i in range(1,10):
    a.append(i)
while(True):
    if k < len(a):
        print(a[k-1])
        break
    else:
        k -= len(a)
        old = a.copy()
        a = []
        for i in old:
            for j in [-1,0,1]:
                d = int(str(i)[-1])+j
                if (d<0) or (d>9):
                    continue
                n = int(str(i)+str(d))
                a.append(n)

Measured memory_bytes: 10320
#include <iostream>
#include <cstring>
using namespace std;
int main(void){
   char numa[105];
   char numb[105];
   cin>>numa;
   cin>>numb;
   int na,nb;
   na=strlen(numa);
   nb=strlen(numb);
   if(na>nb) {cout<<"GREATER"<<endl;}
   else if(na<nb) {cout<<"LESS"<<endl;}
   else 
   {
       for(int i=0;i<na;i++)
       {
           if(numa[i]>numb[i]){cout<<"GREATER"<<endl; break;}
           else if(numa[i]<numb[i]){cout<<"LESS"<<endl; break;}
           if(i==na-1&&numa[i]==numb[i]) {cout<<"EQUAL"<<endl;}
       }
   }
   return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cstdlib>

using namespace std;

const int N_MAX = 36;

typedef struct Card
{
    char suit;
    int value;
} Card;

void printArray(Card *A, int len)
{
    for (int i = 0; i < len; i++)
    {
        cout << A[i].suit << A[i].value;
        if (i != len -1)
            cout << " ";
    }
    cout << endl;
}

void swap(Card *C, int a, int b)
{
    Card tmp = C[a];
    C[a] = C[b];
    C[b] = tmp;
}

// バブルソートは安定ソート
void bubbleSort(Card C[], int N)
{
    for (int i = 0; i < N; i++)
    {
        for (int j = N-1; j > i; j--)
        {
            if (C[j].value < C[j-1].value)
                swap(C, j, j-1);
        }
    }
}

void selectionSort(Card *C, int N)
{
    for (int i = 0; i < N; i++)
    {
       int minj = i;
       for (int j = i; j < N; j++)
       {
            if (C[j].value < C[minj].value)
                minj = j;
       }
       swap(C, i, minj);
    }
}

bool isStable(Card *card1, Card *card2, int len)
{
    for (int i = 0; i < len; i++)
        if (card1[i].suit != card2[i].suit)
            return false;
    return true;
}

int main(int argc, char *argv[])
{
    cin.tie(0);
    ios::sync_with_stdio(false);

    int n;
    cin >> n;
    cin.ignore(); // skip CR
    Card A1[N_MAX];
    Card A2[N_MAX];

    for (int i = 0; i < n; i++)
    {
        string buff;
        cin >> buff;
        A1[i].suit = buff[0];
        A1[i].value = buff[1] - '0'; // char to int
        A2[i].suit = buff[0];
        A2[i].value = buff[1] - '0';
    }

    bubbleSort(A1, n);
    printArray(A1, n);
    cout << "Stable" << endl;

    selectionSort(A2, n);
    printArray(A2, n);
    string ans = (isStable(A1, A2, n)) ? "Stable" : "Not stable";
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3236
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bitset>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<deque>
#include<list>
#include<iomanip>
#include<cmath>
#include<cstring>
#include<functional>
using namespace std;

#define repr(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) repr(i, 0, n)
#define INF 2e9
//#define MOD 1000000007
#define MOD 998244353
#define LINF (long long)4e18
#define jck 3.141592

using ll = long long;
using Pi = pair<int,int>;
using Pl = pair<ll,ll>;


int main(){
    int N,D,A; cin >> N >> D >> A;
    vector<Pi> XH(N+1,Pi(INF,0));
    rep(i,N){
         cin >> XH[i].first >> XH[i].second;
         XH[i].second = (XH[i].second+A-1)/A;
    }
    sort(XH.begin(),XH.end());
    vector<ll> v(N+1);
    ll ans = 0;
    rep(i,N){
        if(i >= 1) v[i] += v[i-1];
        ll d = max(0LL,XH[i].second-v[i]);
        ans += d;
        v[i] += d;
        int p = lower_bound(XH.begin(),XH.end(),Pi(XH[i].first+2*D+1,0))-XH.begin();
        v[p] -= d;
    }
    cout << ans << endl;
}

    



Measured memory_bytes: 3328
s=input()
a=int(s[0:2])
b=int(s[2:4])
if 0<a<13:
  if 0<b<13:
    print('AMBIGUOUS')
  else:
    print('MMYY')
else:
  if 0<b<13:
    print('YYMM')
  else:
    print('NA')

Measured memory_bytes: 9152
#include <bits/stdc++.h>
#define int long long
using namespace std;

long long nCr(long long n, long long r) {
    long long ans = 1;
    for (long long i = n; i > n - r; --i) {
        ans = ans*i;
    }
    for (long long i = 1 ; i < r + 1; ++i) {
        ans = ans / i;
    }
    return ans;
}

signed main(){
	int N; cin>>N;
	vector<int> A(N);
	map<int,int> dic;
	for(int i=0;i<N;i++){
		cin>>A[i];
		dic[A[i]]++;
	}
	int ans=0;
	for(auto p : dic){
		if(p.second>=2)ans+=nCr(p.second,2);
	}
	for(int i=0;i<N;i++){
		int tmp=ans;
		if(dic[A[i]]<=1)cout<<tmp<<endl;
		else{
			tmp-=nCr(dic[A[i]],2);
			tmp+=nCr(dic[A[i]]-1,2);
			cout<<tmp<<endl;
		}
	}

	return 0;

}

Measured memory_bytes: 11008
N = int(input())
A = list(map(int, input().split()))

import collections
A_c=collections.Counter(A)


keys = [k for k, v in A_c.items() if v >= 2]

keys.sort()

if len(keys) < 2:
	ans = 0
elif A_c.get(keys[len(keys)-1]) >= 4:
	ans = keys[len(keys)-1] * keys[len(keys)-1] 
else:
	ans = keys[len(keys)-1] * keys[len(keys)-2]

print(ans)


Measured memory_bytes: 18316
#include <cstdio>  
#include <cmath>  
#include <iostream>  
#include <algorithm>  
#include <cstring>  
#include <cctype>  
#include <stack>  
using namespace std;  
  
typedef long long ll;  
const int qq = 1e5 + 10;  
ll diff[qq];  
ll num[qq];  
ll n;  
  
int main(){  
    scanf("%lld", &n);  
    ll sum = 0;  
    for(int i = 0; i < n; ++i)   scanf("%lld", num + i), sum += num[i];  
    for(int i = 0; i < n - 1; ++i)  
        diff[i] = num[i + 1] - num[i];  
    diff[n - 1] = num[0] - num[n - 1];  
    ll k = (1 + n) * n / 2;  
    if(sum % k != 0){  
        printf("NO\n");  
        return 0;  
    }  
    k = sum / k;  
    for(int i = 0; i < n; ++i){  
        if(k == diff[i])    continue;  
        ll c = k - diff[i];  
        if(c < 0 || c % n != 0){  
            printf("NO\n");  
            return 0;  
        }  
    }  
    printf("YES\n");  
    return 0;  
}  

Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define pb push_back
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()
#define uni(x) x.erase(unique(rng(x)),x.end())
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define dup(x,y) (((x)+(y)-1)/(y))
#define v(T) vector<T>
#define vv(T) v(v(T))
using ll = int64_t;
using ull = uint64_t;
using uint = uint32_t;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
using pil = pair<int,ll>;
using pil = pair<int,ll>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
template<typename T>inline istream& operator>>(istream&i,v(T)&v)
{rep(j,v.size())i>>v[j];return i;}
template<typename T>string join(const v(T)&v)
{stringstream s;rep(i,v.size())s<<' '<<v[i];return s.str().substr(1);}
template<typename T>inline ostream& operator<<(ostream&o,const v(T)&v)
{if(v.size())o<<join(v);return o;}
template<typename T1,typename T2>inline istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
template<typename T1,typename T2>inline ostream& operator<<(ostream&o,const pair<T1,T2>&v)
{return o<<v.fi<<","<<v.se;}
constexpr double eps = 1e-6;
constexpr ll LINF = 100200300400500600ll;
constexpr int INF = 2*((1<<30)-1)+1;
//--------------------------------------------------------
#define fastio cin.tie(nullptr); std::ios::sync_with_stdio(false);
#define myio ifstream iofi; if(argc>1){iofi.open(argv[1]); std::cin.rdbuf(iofi.rdbuf());}
#define myloopset int loop = 1; if(argc>2) loop =stoi(argv[2]); rep(i,loop)
//--------------------------------------------------------------
template <class T> T chmin(T &a,T b){if(a>b){a=b; return 1;}else return 0;}
template <class T> T chmax(T &a,T b){if(a<b){a=b; return 1;}else return 0;}
constexpr int dx[4] = {0,1,0,-1};
constexpr int dy[4] = {-1,0,1,0};
constexpr int mod = 1000000007;
#define Yes(ifeq) cout<<(( ifeq )? "Yes":"No")<<endl;

void Main(){
  int k;
  cin>>k;
  int sum=0;
  rep(i,k){
    rep(j,k){
      int a = gcd(i+1,j+1); 
      rep(p,k){
        sum += gcd(a,p+1);
      }
    }
  }
  cout<<sum<<endl;
} signed main(int argc,char** argv)
{fastio; myio; myloopset Main();}


Measured memory_bytes: 3652
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
      	int n=sc.nextInt();
		int[] hight=new int[n];
      	for (int i=0;i<n;i++) {
          hight[i]=sc.nextInt();
        }
      	int[] dp=new int[n];
      	Arrays.fill(dp,Integer.MAX_VALUE);
      	dp[0]=0; 
      	for (int i=1;i<n;i++) {
        	if (i==1) dp[i]=Math.abs(hight[i]-hight[i-1]);
          	else {
              dp[i]=Math.min(dp[i-2]+Math.abs(hight[i]-hight[i-2]),dp[i-1]+Math.abs(hight[i]-hight[i-1]));
            }
        }
        System.out.println(dp[n-1]);
	}
}

Measured memory_bytes: 52092
import sys
n, m = map(int, input().split())
X = list(map(int, input().split()))
if n >= m:
  print(0)
  sys.exit()
X.sort()
L = []
for i in range(m-1):
  L.append(X[i+1] - X[i])
#print(L)
L.sort(reverse=True)
#print(L)
#print(sum(L[0:1]))
print((X[m-1]-X[0]) - (sum(L[0:n-1])))

Measured memory_bytes: 13960
#include<iostream>
#include<vector>

using namespace std;

vector<int> BubbleSort(vector<int> A,int n)
{
	int flag = 1;
	int count = 0;
	
	while(flag == 1){
		flag = 0;
		for(int i=n-1;i>0;i--){
			if(A[i] < A[i-1]){
				count++;
				int change = A[i];
				A[i] = A[i-1];
				A[i-1] = change;
				flag = 1;
			}
		}
	}
	A[n] = count;
	return A;
}

int main()
{
	int n;
	cin >> n;
	
	vector<int> A;
	A.resize(n+1);

	for(int i=0;i<n;i++)cin >> A[i];
	
	A = BubbleSort(A,n);
	
	for(int i=0;i<n;i++){
		if(i == n-1)cout << A[i] <<flush;
		else{
			cout << A[i] << " " << flush;
		} 
	}
	cout << endl << A[n] << endl;
	
	return 0;
}

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

int pos;
string s, ans;

string Letter() {
  int cnt = 0;
  while(!isalpha(s[pos])) {
    if(s[pos] == '+') ++cnt;
    else --cnt;
    ++pos;
  }
  int a = (((s[pos++]-'A') + cnt) % 26 + 26) % 26;
  return string(1, (char)(a + 'A'));
}

string Chipher() {
  string res;
  while(s[pos] != ']' && s[pos] != '$') {
    if(s[pos] == '[') {
      ++pos;
      string t = Chipher();
      ++pos;
      reverse(t.begin(), t.end());
      res += t;
    } else {
      res += Letter();
    }
  }
  return res;
}

void rec(int k) {
  if(s[k] == '$') {
    pos = 0;
    string tmp = Chipher();
    if(ans == "" || ans > tmp) ans = tmp;
    return;
  }
  if(s[k] == '?') {
    for(char c = 'A'; c <= 'Z'; ++c) {
      s[k] = c;
      rec(k+1);
    }
    s[k] = '?';
  } else {
    rec(k+1);
  }
}

int main() {
  while(cin >> s && s != ".") {
    s += '$';
    ans = "";
    rec(0);
    cout << ans << endl;
  }
  return 0;
}

Measured memory_bytes: 1204
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>

typedef struct{
  double x;
  double y;
}Point;

void kock(int, Point, Point);

double rad = 60/180.0*M_PI;

int main(){

  int n;
  Point firstpoint;
  Point finalpoint;
  firstpoint.x = 0;
  firstpoint.y = 0;

  finalpoint.x = 100;
  finalpoint.y = 0;


  scanf("%d",&n);

  printf("%f %f\n",firstpoint.x,firstpoint.y);

  kock(n,firstpoint,finalpoint);

  printf("%f %f\n",finalpoint.x,finalpoint.y);

  return 0;
}

void kock(int n, Point p1, Point p2){

  Point s;
  Point t;
  Point u;

  if(n == 0) return;

  s.x = (2*p1.x+1*p2.x)/3;
  s.y = (2*p1.y+1*p2.y)/3;

  t.x = (1*p1.x+2*p2.x)/3;
  t.y = (1*p1.y+2*p2.y)/3;

  u.x = (double)(t.x - s.x)*cos(rad) - (t.y - s.y)*sin(rad) + s.x;

  u.y = (double)(t.x - s.x)*sin(rad) + (t.y - s.y)*cos(rad) + s.y;

  kock(n-1, p1, s);
  printf("%f %f\n",s.x,s.y);

  kock(n-1, s, u);
  printf("%f %f\n",u.x,u.y);

  kock(n-1, u, t);
  printf("%f %f\n",t.x,t.y);

  kock(n-1, t, p2);
}

Measured memory_bytes: 644
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;

int main() {
	int x, y;
	int a[] = { 1,3,5,7,8,10,12 };
	int b[] = {4, 6, 9, 11};
	int count = 0;
	cin >> x >> y;

	for (int i = 0; i < 7; i++) {
		if (x == a[i] || y == a[i]) {
			count++;
		}
		if (count == 2) {
			cout << "Yes";
			return 0;
		}
	}
	count = 0;
	for (int i = 0; i < 4; i++) {
		if (x == b[i] || y == b[i]) {
			count++;
		}
		if (count == 2) {
			cout << "Yes";
			return 0;
		}
	}
	if (x == 2 && x == y) {
		cout << "Yes";
	}
	else {
		cout << "No";
	}
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <math.h>
#include <string>
using namespace std;

int main (){
        long long A,B,C,K;
        long long ans=0;

        cin >> A >> B >> C >>K;

        if (K%2 ==0) {
                ans=A-B;
        }else{
                ans=-A+B;
        }

        if (abs(ans) > 1000000000000000000) {
                cout << "Unfair" <<endl;
        }else{
                cout << ans <<endl;
        }
}


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

int	main()
{
    int N;
    cin >> N;
    int k;
    for (k = 1; k * (k - 1) / 2 < N; ++k);
    if (k * (k - 1) / 2 > N) {
        cout << "No" << endl;
        return 0;
    }
    vector<vector<int>> S(k, vector<int>(k - 1));
    for (int l = 1; l < k; ++l) {
        int head = l * (l - 1) / 2 + 1;
        for (int i = 0; i < l; ++i) {
            S[i][l - 1] = S[l][i] = head + i;
        }
    }
    cout << "Yes" << endl;
    cout << k << endl;
    for (int i = 0; i < k; ++i) {
        cout << k - 1;
        for (int j = 0; j < k - 1; ++j) {
            cout << " " << S[i][j];
        }
        cout << endl;
    }
}




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

int main() {
  int a, b;
  int sum = 0;
  int count = 0;
  cin >> a >> b;
  bool x = true;
  bool y = true;
  if(b == 1){
    cout << 0 << endl;
    y = false;
    x = false;
  }
  if(y){
  	if(a >= b){
    	cout << 1 << endl;
    	x = false;
  	}
  }
  if(x){
  	for(int i = 0;i<20;i++){
    	sum += a-1;
        count++;
    	if(sum + a >= b){
      		cout << count+1 << endl;
      		break;
      
    	}
  	}
  }  

}


Measured memory_bytes: 256
N, M, C = [int(x) for x in input().split()]
B = [int(x) for x in input().split()]
tot = 0
for i in range(N):
  A = [int(x) for x in input().split()]
  ans = C
  for j in range(M):
    ans += A[j]*B[j]
  if ans > 0:
    tot += 1
print(tot)

Measured memory_bytes: 3060
#include <iostream>

void funcB() {
  int x, y, leg;
  std::cin >> x >> y;
  leg = x * 2;
  if (leg == y) {
    std::cout << "Yes";
    return;
  }
  for (int i = 0; i < x; i++) {
    leg += 2;
    if (leg == y) {
      std::cout << "Yes";
      return;
    }
    if (leg > y) {
      break;
    }
  }
  std::cout << "No";

}

int main(void) {
  funcB();
  return 0;
}

Measured memory_bytes: 3120
#include<bits/stdc++.h>
using namespace std;
int n,i;
char s[10001];
int sum,maxn=0;
int main()
{
	cin>>n;
	for(i=1;i<=n;i++)cin>>s[i];
	for(i=1;i<=n;i++){
	if(s[i]=='I'){sum++;if(maxn<sum)maxn=sum;}	
	if(s[i]=='D'){sum--;if(maxn<sum)maxn=sum;}
	}
	cout<<maxn<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)

using namespace std;
typedef long long ll;
typedef unsigned long ul;
typedef pair<ul, ul> P;
const int INF = 1e9;
const int MOD =1e9+7;
const ll LINF = 1e18;

int main(){
    int N, K, Q;

    cin >> N >> K >> Q;
    vector<int> point(N, K);
    vector<int> q(Q);

    rep(i, Q) {
        cin >> q[i];
    }

    if(K > Q) {
        rep(i, N) {
            cout << "Yes" << endl;
        }
    } else {
        rep(i, Q) {
            point[q[i] - 1]++;
        }
        rep(i, N) {
            if (point[i] > Q) {
                cout << "Yes" << endl;
            } else {
                cout << "No" << endl;
            }
        }
    }
} 

Measured memory_bytes: 1408
#include <stdio.h>
#include <string.h>

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

void foo(int y,int x){
	int i;

	data[y][x] = 1;

	for(i = 0;i < 4;i++){
		if(y+dy[i] >= 0 && y+dy[i] <= 11 && x+dx[i] >= 0 && x+dx[i] <= 11){
			if(map[y+dy[i]][x+dx[i]] && !data[y+dy[i]][x+dx[i]]){
				foo(y+dy[i],x+dx[i]);
			}
		}
	}
}

int main(){
	int i,j,cnt;
	char str[13];

	while(scanf("%s",str) != EOF){
		for(i = 0;i < 12;i++){
			map[0][i] = str[i]-'0';
		}
		for(i = 1;i < 12;i++){
			scanf("%s",str);
			for(j = 0;j < 12;j++){
				map[i][j] = str[j]-'0';
			}
		}

		cnt = 0;
		memset(data,0,sizeof(data));

		for(i = 0;i < 12;i++){
			for(j = 0;j < 12;j++){
				if(map[i][j] && !data[i][j]){
					foo(i,j);
					cnt++;
				}
			}
		}

		printf("%d\n",cnt);
	}

	return 0;
}

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

#define fo(i,n)         for(int i=0;i<n;i++)
#define fo2(i,n)        for(int i=n-1;i>=0;i--)
#define Fo(i,k,n)       for(i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
#define ll              long long
#define si(x)	        scanf("%d",&x)
#define sl(x)	        scanf("%lld",&x)
#define ss(s)	        scanf("%s",s)
#define pi(x)	        printf("%d\n",x)
#define pi2(x)          printf("%d ",x)
#define pl(x)	        printf("%lld\n",x)
#define pl2(x)          printf("%lld ",x)
#define ps(s)	        printf("%s\n",s)
#define pn              printf("\n")
#define deb(x)          cout << #x << "=" << x << endl
#define deb2(x, y)      cout << #x << "=" << x << " , " << #y << "=" << y << endl
#define pb              push_back
#define F               first
#define S               second
#define all(x)          x.begin(), x.end()
#define clr(x)          memset(x, 0, sizeof(x))
#define sortall(x)      sort(all(x))
#define tr(it, a)       for(auto it = a.begin(); it != a.end(); it++)
#define PI              3.1415926535897932384626

typedef pair<int, int>ii;
typedef pair<ll, ll>pl;
typedef vector<int>vi;
typedef vector<ll>vl;
typedef vector<ii>vii;
typedef vector<pl>vpl;
typedef vector<vi>vvi;
typedef vector<vl>vvl;

/*int mpow(int base, int exp);
ll binpow(ll base , ll exp);
void ipgraph(int n, int m);
void dfs(int u);*/

const int mod = 1000000007;
const int N = 3e5+5, M = N;

//vi g[N];
//bool vis[N];






void solve()
{
    ll n, m;

    sl(n);

    string res="";

    while(n>0)
    {
        n--;

        res.push_back(char('a'+n%26));

        n/=26;
    }

    reverse(res.begin() , res.end());

    cout<<res<<"\n";
}


int main()
{
    int t = 1;

    //si(t);

    while(t--)
    {
        solve();
    }

    return 0;
}






















/*void dfs(int u) //DFS
{
    vis[u] = 1;

	for(int v:g[u])
    {
		if (!vis[v])
           dfs(v);
	}

	vis[u] = 0;
}

void ipgraph(int n, int m) //GRAPH INPUT
{
	int i, u, v;

	while(m--)
    {
		si(u); si(v);
		g[u].pb(v);
		g[v].pb(u);
	}
}



ll binpow(ll base, ll exp)
{
    ll res = 1;
    while (exp > 0)
    {
        if (exp & 1)
            res = res * base;
        base = base * base;
        exp >>= 1;
    }
    return res;
}

int mpow(int base, int exp)
{
    base %= mod;
    int result = 1;
    while (exp > 0)
    {
       if (exp & 1) result = ((ll)result * base) % mod;
       base = ((ll)base * base) % mod;
       exp >>= 1;
    }
    return result;
}
*/






//    #include <chrono>
//    using namespace std::chrono;
//    auto start = high_resolution_clock::now();
//    auto stop = high_resolution_clock::now();
//    auto duration = duration_cast<milliseconds>(stop - start);
//    cout << duration.count() << endl;
//#ifdef _DEBUG
//	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);
//#endif




Measured memory_bytes: 3688
S = [ord(x) - ord('a') for x in input()]
N = len(S)

ans = N - 1
for i in range(26):
    cnt = 0
    now_S = S[:]
    for j in range(N - 1):
        if all(x == i for x in now_S):
            break
        for k in range(N - j - 1):
            if now_S[k + 1] == i:
                now_S[k] = i
        now_S.pop()
        cnt += 1
    ans = min(ans, cnt)
print(ans)


Measured memory_bytes: 3060
###template###
import sys
def input(): return sys.stdin.readline().rstrip()
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt, ceil, floor
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
import heapq
INF = float("inf")
sys.setrecursionlimit(10**7)
# 4近傍（右, 下, 左, 上）
dy = [0, -1, 0, 1]
dx = [1, 0, -1, 0]
def inside(y: int, x: int, H: int, W: int) -> bool: return 0 <= y < H and 0 <= x < W
def mi(): return map(int, input().split())
def ii(): return int(input())
###template###

s = input()

sset = set(s)

for c in sset:
  if s.count(c) != 2:
    print('No')
    exit()

print('Yes')



Measured memory_bytes: 38896
#include <bits/stdc++.h>
#define GET_MACRO(_1,_2,_3,_4,_5,_6,_7,_8,NAME,...) NAME
#define pr(...) cerr<< GET_MACRO(__VA_ARGS__,pr8,pr7,pr6,pr5,pr4,pr3,pr2,pr1)(__VA_ARGS__) <<endl
#define pr1(a) (#a)<<"="<<(a)<<" "
#define pr2(a,b) pr1(a)<<pr1(b)
#define pr3(a,b,c) pr1(a)<<pr2(b,c)
#define pr4(a,b,c,d) pr1(a)<<pr3(b,c,d)
#define pr5(a,b,c,d,e) pr1(a)<<pr4(b,c,d,e)
#define pr6(a,b,c,d,e,f) pr1(a)<<pr5(b,c,d,e,f)
#define pr7(a,b,c,d,e,f,g) pr1(a)<<pr6(b,c,d,e,f,g)
#define pr8(a,b,c,d,e,f,g,h) pr1(a)<<pr7(b,c,d,e,f,g,h)
#define prArr(a) {cerr<<(#a)<<"={";int i=0;for(auto t:(a))cerr<<(i++?", ":"")<<t;cerr<<"}"<<endl;}
using namespace std;
using Int = long long;
using _int = int;
using ll = long long;
using Double = long double;
const Int INF = (1LL<<60)+1e9; // ~ 1.15 * 1e18
const Int mod = (1e9)+7;
const Double EPS = 1e-8;
const Double PI = 6.0 * asin((Double)0.5);
using P = pair<Int,Int>;
template<class T> T Max(T &a,T b){return a=max(a,b);}
template<class T> T Min(T &a,T b){return a=min(a,b);}
template<class T1, class T2> ostream& operator<<(ostream& o,pair<T1,T2> p){return o<<"("<<p.first<<","<<p.second<<")";}
template<class T1, class T2, class T3> ostream& operator<<(ostream& o,tuple<T1,T2,T3> t){
  return o<<"("<<get<0>(t)<<","<<get<1>(t)<<","<<get<2>(t)<<")";}
template<class T1, class T2> istream& operator>>(istream& i,pair<T1,T2> &p){return i>>p.first>>p.second;}
template<class T> ostream& operator<<(ostream& o,vector<T> a){Int i=0;for(T t:a)o<<(i++?" ":"")<<t;return o;}
template<class T> istream& operator>>(istream& i,vector<T> &a){for(T &t:a)i>>t;return i;}
//INSERT ABOVE HERE


signed main(){
  srand((unsigned)time(NULL));
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(12);

  int N;
  cin>>N;
  int H, W;
  cin>>H>>W;

  int ans = 0;
  for(int i=0;i<N;i++)
    for(int j=0;j<N;j++)
      if(i + H <= N && j + W <= N) ans++;
  cout<<ans<<endl;
      
  
  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

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

using namespace std;

void __print(int x) { cerr << x; }
void __print(long x) { cerr << x; }
void __print(long long x) { cerr << x; }
void __print(unsigned x) { cerr << x; }
void __print(unsigned long x) { cerr << x; }
void __print(unsigned long long x) { cerr << x; }
void __print(float x) { cerr << x; }
void __print(double x) { cerr << x; }
void __print(long double x) { cerr << x; }
void __print(char x) { cerr << '\'' << x << '\''; }
void __print(const char *x) { cerr << '\"' << x << '\"'; }
void __print(const string &x) { cerr << '\"' << x << '\"'; }
void __print(bool x) { cerr << (x ? "true" : "false"); }

template <typename T, typename V>
void __print(const pair<T, V> &x) {
    cerr << '{';
    __print(x.first);
    cerr << ',';
    __print(x.second);
    cerr << '}';
}
template <typename T>
void __print(const T &x) {
    int f = 0;
    cerr << '{';
    for (auto &i : x) cerr << (f++ ? "," : ""), __print(i);
    cerr << "}";
}
void _print() { cerr << "]\n"; }
template <typename T, typename... V>
void _print(T t, V... v) {
    __print(t);
    if (sizeof...(v)) cerr << ", ";
    _print(v...);
}
#ifdef LOCAL
#define debug(x...)               \
    cerr << "[" << #x << "] = ["; \
    _print(x)
#else
#define debug(x...)
#endif

#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end());
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

typedef long long ll;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int N;
    cin >> N;
    vector<int> H(N);
    rep(i, N) { cin >> H[i]; }
    bool ok = true;
    rep(i, N - 1) {
        debug(i, H, H[i], H[i + 1] - H[i]);
        if ((H[i] - H[i+1]) == 1) {
            H[i + 1]++;
            continue;
        }
        if (H[i + 1] >= H[i]) continue;
        ok = false;
    }
    if (ok) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }

    return 0;
}


Measured memory_bytes: 640