akhauriyash/Code-Regression huggingface dataset:
def divisors(n):
  small = []
  large = []
  i = 1
  while i * i <= n:
    if not n % i:
      small.append(i)
      large.append(n // i)
    i += 1
  if small[-1] == large[-1]:
    large.pop()
  return small + large[::-1]

n = int(input())
res = set(divisors(n - 1))
res.remove(1)

for d in divisors(n):
  if d == 1:
    continue
  now = n
  # simulation
  while not now % d:
    now //= d
  if now % d == 1:
    res.add(d)

print(len(res))

Measured memory_bytes: 39152
#include <iostream>
using namespace std;
const int AMAX = 100000;
long long cnt[AMAX + 1];
int main(void){
    int N;
    long long K;
    cin >> N >> K;
    for(int j = 0; j < N; ++j){
        int A, B;
        cin >> A >> B;
        cnt[A] += B;
    }
    for(int ans = 1; ans <= AMAX; ++ans){
        if(K <= cnt[ans]){
            cout << ans << endl;
            break;
        }
    
        K -= cnt[ans];
    }

    return 0;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
#include<iostream>
#include<cstdio>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
using namespace std;
#define rep(i,x) for(int i = 0; i < (int)(x); i++)
#define pb push_back
#define mp make_pair
#define debug(x) cerr << #x << ": " << (x) << "\n";
#define all(x) (x).begin(), (x).end()
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<ll,ll> Pll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef vector<vector<vector<ll>>> vvvl;
const ll MOD = 1e9+7;
const int n_max = 1e5+10;

int main(){
    ll h,w; cin >> h >> w;
    vvl c(10,vector<ll>(10,0));
    rep(i,10)rep(j,10){
        cin >> c[i][j];
    }

    // ワーシャルフロイド
    rep(k,10){
        rep(i,10){
            rep(j,10){
                c[i][j] = min(c[i][j], c[i][k] + c[k][j]);
            }
        }
    }
    vvl a(h,vl(w));
    rep(i,h)rep(j,w){
        cin >> a[i][j];
    }
    ll res = 0;
    rep(i,h)rep(j,w){
        if(a[i][j] == -1)continue;
        else res += c[a[i][j]][1];
    }
    cout << res << endl;
}

Measured memory_bytes: 512
#include <iostream>
#include <vector>
#include <string>
#include <map>
using namespace std;
typedef long long int ll;

ll a, b, c, d, e, N, H, W;
map<ll, ll> dp;
void input()
{
    cin >> N;
}

ll prime(ll n, ll d)
{
    if (n < d || d <= 1)
    {
        return 1;
    }

    int count = 1;
    while (n % d == 0)
    {
        n /= d;
        count++;
    }
    return count * prime(n, d + 1);
}

ll solve()
{
    int ans = 0;
    for (int i = 1; i <= N; i++)
    {
        if (i % 2 == 1 && prime(i, 2) == 8)
        {
            ans++;
        }
    }
    return ans;
}

int main()
{
    input();
    cout << solve() << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF = 1e18;
const ll MOD = 1e9+7;
#define REP(i,j,n) for(int i=j;i<n;i++)
#define rep(i,n) REP(i,0,n)

// Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);

    ll ans = 0;
    int n;cin>>n;
    REP(a,1,n)
    {
        ans += (n-1)/a;
    }
    cout << ans << endl;
}


Measured memory_bytes: 3652
import sys
input = sys.stdin.readline

import bisect

INF = 1e+11
A,B,Q=map(int, input().split())
s = [-INF]+[int(input()) for _ in range(A)]+[INF]
t = [-INF]+[int(input()) for _ in range(B)]+[INF]
x = [int(input()) for _ in range(Q)]

for i in range(Q):
    a,b= bisect.bisect_right(s,x[i]), bisect.bisect_right(t,x[i])
    ans = INF
    for S in [s[a-1], s[a]]:
        for T in [t[b-1], t[b]]:
            d1 = abs(S-x[i])+abs(S-T)
            d2 = abs(T-x[i])+abs(S-T)
            ans = min(ans, d1, d2)
    print(ans)



Measured memory_bytes: 18048
#include "bits/stdc++.h"

using namespace std;
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define ll long long

int main()
{
  IOS;
  string s, t;
  int i, ans=0;
  cin >> s >> t;
  for (i=0; i<s.length(); i++)
    {
      if (s[i]!=t[i])
        ans++;
    }
  cout << ans << endl;
  return 0;
}

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

using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;

#define REP(i, n, m) for(ll i=n; i<(ll)m; ++i)
#define IREP(i, n, m) for(ll i=n-1; i>=m; --i)
#define rep(i, n) REP(i, 0, n)
#define irep(i, n) IREP(i, n, 0)
#define all(v) v.begin(), v.end()
#define vprint(v) for(auto e:v){cout<<e<<" ";};cout<<endl;
#define vvprint(vv) for(auto v:vv){vprint(v)};

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << setprecision(20);

    ll x;
    cin >> x;

    if(x==0) cout << 1 << endl;
    else cout << 0 << endl;
}


Measured memory_bytes: 3644
#include "bits/stdc++.h"
using namespace std;

#define rep(i, n) for (int i = 0; i < (n); i ++)

#define int long long

signed main() {
        int n, m;
        cin >> n >> m;
        vector<int> a(n);
        for (int i = 0; i < n; i ++) cin >> a[i];
        vector<int> cnt(m + 1, 0);
        for (int i = 0; i < n - 1; i ++) {
                int l = a[i], r = a[i + 1];
                if (l == m) {
                        cnt[1] ++;
                        cnt[r] --;
                }
                else if (l < r) {
                        cnt[l + 1] ++;
                        cnt[r] --;
                } else {
                        cnt[l + 1] ++;
                        cnt[1] ++;
                        cnt[r] --;
                }
        }
        for (int i = 2; i <= m; i ++) cnt[i] += cnt[i - 1];
        vector<int> diff(m + 1, 0);
        for (int i = 1; i < n; i ++) diff[a[i]] += (a[i] - a[i - 1] + m) % m - 1;
        //for (int i = 1; i < m; i ++) cerr << diff[i] - cnt[i] << endl;
        int first = 0;
        for (int i = 0; i < n - 1; i ++) {
                int l = a[i], r = a[i + 1];
                if (l < r) first += (r - l + m) % m;
                else first += 1 + (r - 1 + m) % m;
        }
        //cerr << first << endl;
        vector<int> ans(m + 1);
        ans[1] = first;
        for (int i = 1; i < m; i ++) ans[i + 1] = ans[i] + diff[i] - cnt[i];
        //for (int i = 1; i <= m; i ++) {
        //        cerr << ans[i] << endl;
        //}
        int answer = ans[1];
        for (int i = 2; i <= m; i ++) answer = min(answer, ans[i]);
        cout << answer << endl;
        return 0;
}


Measured memory_bytes: 3328
def solve():
    x, n = map(int, input().split())
    ans = 0
    p = set(map(int, input().split()))
    for i in range(110):
        if i in p:
            continue
        else:
            if abs(i-x) < abs(ans-x):
                ans = i
    print(ans)


if __name__ == '__main__':
    solve()


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

int main() {
    int n, y;
    cin >> n >> y;
    for (int n10000 = 0; n10000 <= n; ++n10000) {
        for (int n5000 = 0; n10000 + n5000 <= n; ++n5000) {
            int n1000 = n - n10000 - n5000;
            if (10000 * n10000 + 5000 * n5000 + 1000 * n1000 == y) {
                cout << n10000 << " " << n5000 << " " << n1000 << "\n";
                return 0;
            }
        }
    }
    cout << "-1 -1 -1\n";
    return 0;
}


Measured memory_bytes: 256
import re

_S = input().replace('?', '_')[::-1]
T = input()[::-1]

pattern = ''
for c in T:
    pattern += '[_' + c + ']'

match = re.search(pattern, _S)
if not match:
    print('UNRESTORABLE')
else:
    S = _S[:match.start()] + T + _S[match.end():]
    S = S.replace('_', 'a')
    print(S[::-1])


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

using VS = vector<string>;    using LL = long long;
using VI = vector<int>;       using VVI = vector<VI>;
using PII = pair<int, int>;   using PLL = pair<LL, LL>;
using VL = vector<LL>;        using VVL = vector<VL>;

#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define SZ(a) int((a).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))
#define FOR(i, s, e) for (int(i) = (s); (i) < (e); (i)++)
#define FORR(i, s, e) for (int(i) = (s); (i) > (e); (i)--)
#define debug(x) cerr << #x << ": " << x << endl
const int INF = 1e9;                          const LL LINF = 1e16;
const LL MOD = 1000000007;                    const double PI = acos(-1.0);
int DX[8] = { 0, 0, 1, -1, 1, 1, -1, -1 };    int DY[8] = { 1, -1, 0, 0, 1, -1, 1, -1 };

/* -----  2018/07/07  Problem: soundhound2018_master_qual D / Link: __CONTEST_URL__  ----- */
/* ------問題------



-----問題ここまで----- */
/* -----解説等-----



----解説ここまで---- */

VL Dijkstra(vector<vector<PLL>>& G, int s) {
	VL dist(SZ(G), LINF);
	dist[s] = 0;
	priority_queue<PLL, vector<PLL>, greater<PLL>> que;
	que.push(PLL(0LL, s));

	while (!que.empty()) {
		PLL p = que.top(); que.pop();
		int v; /* 頂点*/ long long d; /* 頂点vまでの距離 */
		tie(d, v) = p;

		if (d > dist[v]) continue;

		FOR(i, 0, (int)G[v].size()) {
			int nv = G[v][i].first;
			if (dist[nv] > dist[v] + G[v][i].second) {
				dist[nv] = dist[v] + G[v][i].second;
				que.push(PLL(dist[nv], nv));
			}
		}
	}
	return dist;
}


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

	int N, M, S, T;
	cin >> N >> M >> S >> T;
	S--, T--;
	vector<vector<PLL>> GE(N), GS(N);
	FOR(i, 0, M) {
		int a, b, c, d;
		cin >> a >> b >> c >> d;
		a--, b--;
		GE[a].push_back(PLL(b, c));
		GE[b].push_back(PLL(a, c));
		GS[a].push_back(PLL(b, d));
		GS[b].push_back(PLL(a, d));
	}

	VL StoV = Dijkstra(GE, S);
	VL TtoV = Dijkstra(GS, T);
	VL ans(N, 0);
	LL mon = 1e15;
	LL ret = LINF;
	FORR(i, N - 1, 0 - 1) {// 緩和
		ret = min(ret, StoV[i] + TtoV[i]);
		ans[i] = mon - ret;
	}
	FOR(i, 0, N) {
		cout << ans[i] << endl;
	}

	return 0;
}


Measured memory_bytes: 19016
n = int(input())
a = list(map(int, input().split()))

def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)

if n == 2:
    b = gcd(a[0], a[1])
    for i in range(1, b+1):
        if b%i == 0:
            print(i)
else:
    b = gcd(gcd(a[0], a[1]), a[2])
    for i in range(1, b+1):
        if b%i == 0:
            print(i)



Measured memory_bytes: 5600
var lines: string[] = [];
var reader: any = require("readline").createInterface({
  input: process.stdin,
  output: process.stdout
});
reader.on("line", function(line: string) {
  lines.push(line);
});

reader.on("close", function() {
  // N X
  var numbers: number[] = lines[0].split(" ").map(x => {
    return Number(x);
  });
  var numD: number = Number(numbers[0]);
  var numX: number = Number(numbers[1]);

  var total: number = numX;
  var min: number = numX;

  for (var i: number = 1; i < lines.length; i++) {
    total = total - Number(lines[i]);
    if (Number(lines[i]) < min) {
      min = Number(lines[i]);
    }
  }

  console.log(lines.length - 1 + Math.floor(total / min));
});


Measured memory_bytes: 7756
// a-five-variables.yml
#include <bits/stdc++.h>
using namespace std;

using ll = long long;
using pii = pair<int, int>;
template <typename V> using uset = unordered_set<V>;
template <typename K, typename V> using umap = unordered_map<K, V>;
template <typename C> int sz(C &v) { return v.size(); }

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

    for (int i = 0; i < 5; i++) {
        int x;
        cin >> x;
        if (x == 0)
            cout << (i + 1) << '\n';
    }

    return 0;
}



Measured memory_bytes: 3636
import sys

def chk(p,q):
    if q==p+1: return 1
    else:
        for i in range(p,q-1):
            if s[i]+s[i+1]==2: return 0

        return 1


N,A,B,C,D=map(lambda x: int(x)-1,input().split())
N+=1
S=input()
s=[]
for i in range(N):
    if S[i]==".": s.append(0)
    else: s.append(1)

if chk(A,C)==0 or  chk(B,D)==0: print("No"),sys.exit()
if C<B or C<D: print("Yes"),sys.exit()



for i in range(B,D+1):
    if s[i-1]+s[i]+s[i+1]==0: print("Yes"),sys.exit()

print("No")


Measured memory_bytes: 4916
#include<bits/stdc++.h>
using namespace std;
int main()
{
string s,s1;
cin>>s>>s1;
int a,b;
cin>>a>>b;
string s2;
cin>>s2;
if(s2==s)
cout<<a-1<<" "<<b;
else
cout<<a<<" "<<b-1;
}

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

typedef long long ll;
#define FOR(i,a,b) for(int i=(a);i<(int)(b);i++)
#define rep(i,n) FOR(i,0,n)

// Spagetthi Source:
// http://www.prefield.com/algorithm/container/union_find.html
struct UnionFind {
  vector<int> data;
  UnionFind(int size) : data(size, -1) { }
  bool unionSet(int x, int y) {
    x = root(x); y = root(y);
    if (x != y) {
      if (data[y] < data[x]) swap(x, y);
      data[x] += data[y]; data[y] = x;
    }
    return x != y;
  }
  bool findSet(int x, int y) {
    return root(x) == root(y);
  }
  int root(int x) {
    return data[x] < 0 ? x : data[x] = root(data[x]);
  }
  int size(int x) {
    return -data[root(x)];
  }
};


int main() {
    int n, m;
    scanf("%d%d", &n, &m);
    UnionFind uf(n + m);

    rep(i,n){
        int k; scanf("%d", &k);
        rep(j,k){
            int l; scanf("%d", &l);
            --l;
            uf.unionSet(i, n + l);
        }
    }

    bool ok = true;
    rep(i,n) if(!uf.findSet(0,i)) ok = false;
    cout << (ok ? "YES" : "NO") << endl;;

    return 0;
}

Measured memory_bytes: 1024
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {
  private static class FastScanner {
    private BufferedReader reader = null;
    private StringTokenizer tokenizer = null;

    public FastScanner(InputStream in) {
      reader = new BufferedReader(new InputStreamReader(in));
      tokenizer = null;
    }

    public String next() {
      if (tokenizer == null || !tokenizer.hasMoreTokens()) {
        try {
          tokenizer = new StringTokenizer(reader.readLine());
        } catch (IOException e) {
          throw new RuntimeException(e);
        }
      }
      return tokenizer.nextToken();
    }

    public String nextLine() {
      if (tokenizer == null || !tokenizer.hasMoreTokens()) {
        try {
          return reader.readLine();
        } catch (IOException e) {
          throw new RuntimeException(e);
        }
      }

      return tokenizer.nextToken("\n");
    }

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

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

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

    public int[] nextIntArray(int n) {
      int[] a = new int[n];
      for (int i = 0; i < n; i++)
        a[i] = nextInt();
      return a;
    }

    public long[] nextLongArray(int n) {
      long[] a = new long[n];
      for (int i = 0; i < n; i++)
        a[i] = nextLong();
      return a;
    }
  }

  public static void main(String[] args) {
    FastScanner sc = new FastScanner(System.in);
    int x = sc.nextInt();
    int result = (x / 500) * 1000;
    result += ((x % 500) / 5) * 5;
    System.out.println(result);
  }
}

Measured memory_bytes: 21076
/* Simplicity and Goodness */
 
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
using namespace std;
typedef tree<int, null_type, less<int>, rb_tree_tag,
            tree_order_statistics_node_update> indexed_set;

void my_dbg() { cout << endl; }
template<typename Arg, typename... Args> void my_dbg(Arg A, Args... B) 
{ cout << ' ' << A; my_dbg(B...); }
#define dbg(...)  cout << "(" << #__VA_ARGS__ << "):", my_dbg(__VA_ARGS__)

#define scn(n) scanf("%d", &n)
#define lscn(n) scanf("%lld", &n)
#define pri(n) printf("%d ", (int)(n))
#define prin(n) printf("%d\n", (int)(n))
#define lpri(n) printf("%lld ", n)
#define lprin(n) printf("%lld\n", n)
#define rep(i,a,b) for(int i=(int)(a); i<(int)(b); i++)
#define pb push_back
#define mp make_pair
#define F first
#define S second

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;

const int inf = INT_MAX;
const int ninf = INT_MIN;
const int mod = 1e9+7;
const int N = 2e5+2;

void solve()
{
    int id = -1;

    rep(i, 1, 6) {
        int val;
        scn(val);

        if(val == 0)
            id = i;
    }

    prin(id);
}

int main()
{
    int t = 1;
    // scn(t);

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

Measured memory_bytes: 3752
#include <iostream>
#include <cmath>
#include <vector>
#include <map>
#include <iomanip>
#include <algorithm>
#include <sstream>
#include <string>
#include <math.h>
#include <set>
#include <deque>
#include <queue>
#include <list>
using namespace std;
typedef long long ll;
const int mod = 1000000007;

int main() {
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    int i = 0;
  	while (i < n) {
    	string c;
    	cin >> c;
    	if(c == "W") {
    	  i++;
    	}
    	if(c == "P") { 
    	  i++;
    	}
    	if(c == "G") {
    	  i++;
    	}
    	if(c == "Y") {
    	  cout << "Four" << endl;
    	  break;
    	}
    	if(i == n - 1) {
    	  cout << "Three" << endl;
    	}
  	}
}

Measured memory_bytes: 3632
#pragma GCC optimize ("-O3")
#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
//#include <boost/multiprecision/cpp_int.hpp>
//using namespace boost::multiprecision;
using namespace std;

#define all(c) (c).begin(),(c).end()
#define endl "\n"
#define ff first
#define ss second
#define allr(c) (c).rbegin(),(c).rend()
#define ifr(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define pof pop_front
#define pob pop_back
#define pb emplace_back
#define pf emplace_front
#define fstm(m,n,r) m.reserve(n);m.max_load_factor(r)
#define mp make_pair
#define mt make_tuple
#define inf LLONG_MAX
#define os tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
//order_of_key (k) : Number of items strictly smaller than k .
//find_by_order(k) : K-th element in a set (counting from zero).
const double PI = acos(-1);
typedef complex<double> cd;
typedef long long ll;
ll gcd(){return 0ll;} template<typename T,typename... Args> T gcd(T a,Args... args) { return __gcd(a,(__typeof(a))gcd(args...)); }
typedef map<ll,ll> mll;
typedef map<string,ll> msll;
typedef unordered_map<ll,ll> umap;
typedef vector<ll> vll;
typedef pair<ll,ll> pll;
typedef long double ld;
#define mod 1000000007 
#define N 100001

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

    // int T;cin>>T;while(T--) 
    {
        int a[] = {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
        int k;
        cin>>k;
        cout<<a[k-1]<<endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cmath>
#include<algorithm>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<iomanip>
#define _USE_MATH_DEFINES
#include <math.h>
#include <functional>
using namespace std;

#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)

typedef long long ll;
const ll INF = 1e17;
const ll MOD = 1000000007;
const ll MAX = 1000001;

ll max(ll a, ll b) {
	if (a > b) { return a; }
	return b;
}

ll min(ll a, ll b) {
	if (a > b) { return b; }
	return a;
}

ll gcd(ll a, ll b) {
	if (b == 0) { return a; }
	if (a < b) { return gcd(b, a); }
	return gcd(b, a % b);
}

ll lcm(ll a, ll b) {
	return a * b / gcd(a, b);
}



///////////////////////////

int main() {
	ll N;
	cin >> N;
	cout << (ll)sqrt(N) * (ll)sqrt(N);

}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long 
signed main(){
  int q;
  cin>>q;
  while(q--){
    int a,b;
    cin>>a>>b;
    if(a>b)swap(a,b);
    if(a==b||a+1==b)cout<<2*a-2<<endl;
    else {
      int c=sqrt(a*b);
      if(c*c==a*b)c--;
      if(c*(c+1)<a*b)cout<<2*c-1<<endl;
      else cout<<2*c-2<<endl;
    }
  }
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
stack <char>node;
int main()
{
    string s;
    cin>>s;
    int len=s.size(),ans=0;
    for(int i=0;i<len;i++)
    {
        if(node.empty()||node.top()==s[i])
        {
            node.push(s[i]);
        }
        else
        {
            node.pop();
            ans+=2;
        }
    }
    printf("%d\n",ans);
}

Measured memory_bytes: 512
#include<iostream>
#include<string>
#include<string.h>
#include<algorithm>
#include<stdio.h>
#include<cmath>
#include<vector>
#include<utility>
#include<stack>
#include<queue>
#include<list>
#include<bitset>

#define FOR(i, a, b) for(int i=(a);i<=(b);i++)
#define RFOR(i, a, b) for(int i=(a);i>=(b);i--)
#define MOD 1000000007
#define INF 1000000000

using namespace std;

int main(void){
	int a, b;
	cin >> a >> b;
	if ((a*b) % 2 == 1) {
		cout << "Odd" << endl;
	}
	else {
		cout << "Even" << endl;
	}

	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

class Main {
	public static void main(String[] args) {
		int H, W, i, j;
		Scanner sc = new Scanner(System.in);
		while (true) {
			H = sc.nextInt();
			W = sc.nextInt();
			if (H == 0 && W == 0) break;
			for (i = 0; i < H; i++) {
				for(j = 0; j < W; j++) {
					if ((i + j) % 2 == 0) System.out.print("#");
					else System.out.print(".");
				}
				System.out.println();
			}
			System.out.println();
		}
	}
}



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

const int MOD = 1000000007;

int main(){
	int n, k;
	scanf("%d%d", &n, &k);
	long m = n + 1, l = k - 1;
	long ans = m*(m*m+5)/6 + l*(2*l*l+3*l-5-3*m*(l+1))/6;
	printf("%ld\n", ans % MOD);
}

Measured memory_bytes: 3784
#include <iostream>
#include <cstdio>
#include <cmath>
#include <string>

using namespace std;
typedef long long ll;

int main(){
  char a,b; cin>>a>>b;
  if(a==b){
    cout<<'='<<endl;
  }else{
   cout<<(a>b?'>':'<')<<endl;
  }
}

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

using namespace std;
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)

typedef long long ll;
typedef pair<ll, ll> P;
const ll INF = 1LL<<60;

ll gcd(ll a, ll b) {
  if(b == 0) return a;
  return gcd(b, a % b);
}

template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }

ll modpow(ll a, ll n, ll mod) {
  ll res = 1;
  while (n > 0) {
    if (n & 1) res = res * a % mod;
    a = a * a % mod;
    n >>= 1;
  }
  return res;
}

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

  int N, R;
  cin >> N >> R;

  cout << R + 100 * (10 - min(N, 10)) << endl;


  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep3(i, l, n) for (int i = l; i < (n); ++i)
#define sz(v) (int)v.size()
const int inf = 1e9 + 7;
const ll INF = 1e18;
// int mod = 998244353;
int mod = 1000000007;
#define abs(x) (x >= 0 ? x : -(x))
#define lb(v, x) (int)(lower_bound(all(v), x) - v.begin())
#define ub(v, x) (int)(upper_bound(all(v), x) - v.begin())
template<typename T1, typename T2> inline bool chmin(T1 &a, T2 b) { if (a > b) { a = b; return 1; } return 0; }
template<typename T1, typename T2> inline bool chmax(T1 &a, T2 b) { if (a < b) { a = b; return 1; } return 0; }
ll gcd(ll a, ll b) { if (b == 0) return a; return gcd(b, a % b); }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
ll pow(ll a, int b) { return b ? pow(a * a, b / 2) * (b % 2 ? a : 1) : 1; }
ll modpow(ll a, ll b, ll _mod) { return b ? modpow(a * a % _mod, b / 2, _mod) * (b % 2 ? a : 1) % _mod : 1; }
template<class T, class U> ostream& operator << (ostream& os, const pair<T, U>& p) { os << p.F << " " << p.S; return os; }
template<class T> ostream& operator << (ostream& os, const vector<T>& vec) { rep(i, sz(vec)) { if (i) os << " "; os << vec[i]; } return os; }
template<typename T> inline istream& operator >> (istream& is, vector<T>& v) { rep(j, sz(v)) is >> v[j]; return is; }
template<class T, class T2> inline void add(T &a, T2 b) { a += b; if (a >= mod) a -= mod; }


void solve();

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cout << fixed << setprecision(10);

    int T;
    // cin >> T;
    T = 1;

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

void solve() {
  string s;
  cin >> s;
  sort(all(s));
  if (s[0] == s[1] && s[2] == s[3] && s[0] != s[2]) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}


Measured memory_bytes: 256
N,M = map(int,input().split())
p = [i for i in range(N)]#parent
g = [[i] for i in range(N)]#group
for _ in range(M):
  x,y,z = map(int,input().split())
  x,y = p[x-1],p[y-1]
  if x==y:
    continue
  if len(g[x])<len(g[y]):
    x,y = y,x
  g[x] += g[y]
  for z in g[y]:
    p[z] = x
print(len(set(p)))

Measured memory_bytes: 26628
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define inf 1000000000
typedef long long ll;

int main()
{
    int a, b,c;
    cin >> a >> b >> c;
    int ans[12] = {};

    ans[a]++;
    ans[b]++;
    ans[c]++;
    for(int i=0;i<12;i++){
        if(ans[i]==2){
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
// #include <atcoder/all>
#define ll long long int
#define ld long double
#define yorn(f) cout<<((f)?"Yes":"No")<<endl;
#define YORN(f) cout<<((f)?"YES":"NO")<<endl;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define repi(i, n) for (ll i = 1; i < (ll)(n); i++)
#define all(x) (x).begin(), (x).end()
#define put(x) cout << x << endl;
#define println(x) cout << x << endl;
using namespace std;
// using namespace atcoder;
void Main()
{
    ll n;
    cin >> n;
    vector<ll> a(n);
    rep(i, n) cin >> a[i];

    vector<vector<ll> > fac(n+1, vector<ll>());
    for (int i = 1; i <= n; i++) {
        // fac[i]にiの約数を入れる
        for (int j = 1; i * j <= n; j++) {
            fac[i * j].push_back(i);
        }
    }

    vector<ll> c(n + 1);
    vector<ll> res;
    for (int i = n; i >= 1; i--) {
        int ai = a[i - 1];
        if (ai != c[i] % 2) {
            res.push_back(i);
            for (int f: fac[i]) {
                c[f]++;
            }
        }
    }

    if (res.size() <= 0) {
        put(0);
        return;
    }

    reverse(all(res));
    put(res.size());
    rep(i, res.size()) cout << res[i] << (i == res.size() - 1 ? "" : " ");
    cout << endl;
}
signed main(){ Main();return 0;}

Measured memory_bytes: 40320
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
using namespace std;
 
#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define pi M_PI
 
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

int a[101][101];

int main() {
    string s;
    getline(cin, s);
    REP(i,s.length()){
        if (s[i] >= 'a' && s[i] <= 'z') s[i] += 'A' - 'a';
        else if (s[i] >= 'A' && s[i] <= 'Z') s[i] += 'a' - 'A';
    }
    cout << s << endl;
    return 0;
}

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

using namespace std;

double dist(int x1, int y1, int x2, int y2) {
  return sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
}

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

  int n;
  cin >> n;
  vector<pair<int, pair<int, int>>> p(n);
  for (int i = 0; i < n; ++i) {
    p[i].first = i;
    cin >> p[i].second.first >> p[i].second.second;
  }
  double ans = 0;
  int cnt = 0;
  do {
    for (int i = 0; i < n - 1; ++i) {
      ans += dist(p[i].second.first, p[i].second.second, p[i + 1].second.first, p[i + 1].second.second);
    }
    ++cnt;
  }  while (next_permutation(p.begin(), p.end()));
  cout << fixed << setprecision(10) << ans / cnt;

  return 0;
}

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

public class Program{
  public static void Main(){
    var nk = Array.ConvertAll(Console.ReadLine().Split(' '), UInt32.Parse);
    var a = Array.ConvertAll(Console.ReadLine().Split(' '), UInt32.Parse);
    var gcd = a[0];
    var max = a[0];
    for(var i=1; i<nk[0]; i++){
      var m = Math.Max(gcd, a[i]);
      var n = Math.Min(gcd, a[i]);
      max = Math.Max(max, a[i]);
      for(;;){
        if(n==0) break;
        var tmp = n;
        n = m%n;
        m = tmp;
      }
      gcd = m;
    }
    Console.WriteLine((nk[1]%gcd==0&&nk[1]<=max)?"POSSIBLE":"IMPOSSIBLE");
  }
}


Measured memory_bytes: 19296
#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
using namespace std;
int n, m, a[20], b[10] = { 0, 2, 5, 5, 4, 5, 6, 3, 7, 6 }, c[10], ans[5], part[10009][2];
vector<int> vec, vec2;
bool del[10], got[10];
bool comp(int &a, int &b) {return c[a] < c[b];}
int main()
{
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin >> n >> m;

	for (int i = 0; i < m; i++) {
		cin >> a[i];
		c[b[a[i]]] = max(c[b[a[i]]], a[i]);
		if (!got[b[a[i]]]) {
			vec.push_back(b[a[i]]);
			got[b[a[i]]] = true;
		}
	}
	sort(vec.begin(), vec.end());
	for (int i = (int)vec.size() - 1; i >= 0; i--) {
		for (int j = 0; j < i; j++) {
			if (vec[i] % vec[j] == 0) {
				del[vec[i]] = true;
				break;
			}
		}
		if (del[vec[i]]) continue;
		for (int j = 0; j < i - 1; j++) {
			for (int k = j + 1; k < i; k++) {
				if (vec[i] == vec[j] + vec[k]) {
					del[vec[i]] = true;
					break;
				}
			}
			if (del[vec[i]]) break;
		}
		if (!del[vec[i]]) vec2.push_back(vec[i]);
	}
	sort(vec2.begin(), vec2.end(), comp);
	if (vec2.size() == 1) {
		ans[0] = n / vec2[0];
	}
	else {//vec2.size() == 2 or 3 or 4
		for (int j = 0; j*vec2[1] <= n; j++) {
			for (int i = 0; i*vec2[0] <= n; i++) {
				int tmp = i * vec2[0] + j * vec2[1];
				if (tmp > n) break;
				if (i + j >= part[tmp][0] + part[tmp][1]) {
					part[tmp][0] = i;
					part[tmp][1] = j;
				}
			}
		}
		if (vec2.size() == 2) {
			ans[0] = part[n][0];
			ans[1] = part[n][1];
		}
		else if (vec2.size() == 3) {
			for (int k = 0; k*vec2[2] <= n; k++) {
				int tmp = n - k * vec2[2];
				int newsum = part[tmp][0] + part[tmp][1] + k;
				if (tmp && part[tmp][0] == 0 && part[tmp][1] == 0) continue;	//Invalid.
				if (newsum >= ans[0] + ans[1] + ans[2]) {
					ans[0] = part[tmp][0];
					ans[1] = part[tmp][1];
					ans[2] = k;
				}
			}
		}
		else {
			for (int r = 0; r*vec2[3] <= n; r++) {
				for (int k = 0; r * vec2[3] + k * vec2[2] <= n; k++) {
					int tmp = n - r * vec2[3] - k * vec2[2];
					int newsum = part[tmp][0] + part[tmp][1] + k + r;
					if (tmp && part[tmp][0] == 0 && part[tmp][1] == 0) continue;	//Invalid.
					if (newsum >= ans[0] + ans[1] + ans[2] + ans[3]) {
						ans[0] = part[tmp][0];
						ans[1] = part[tmp][1];
						ans[2] = k;
						ans[3] = r;
					}
				}
			}
		}
	}
	for (int j = vec2.size() - 1; j >= 0; j--)
		for (int i = 0; i < ans[j]; i++)
			cout << c[vec2[j]];
	cout << "\n";
	//system("pause");
	return 0;
}

Measured memory_bytes: 384
# -*- coding: utf-8 -*-
import sys

N,K=map(int, sys.stdin.readline().split())
A=map(int, sys.stdin.readline().split())

keta=0

for i in range(50,-1,-1):
	if (K>>i)&1:
		keta=i+1
		break



C=[ 0 for i in range(keta) ]	#桁ごとのbit 1の出現回数


for a in A:
	for k in range(keta-1,-1,-1):
		#print "k, a>>k, (a>>k)&1 ::::: ",k, a>>k, (a>>k)&1
		if (a>>k)&1:		#その桁のbitが1なら、出現回数に+1
			C[k]+=1



X=0	# f(x)が最大となるX


len_c=len(C)

for i in range(len_c-1,-1,-1):
	ci=C[i]
	if  C[i]<(N+1)/2:
		if X+2**i<=K:
			X+=2**i		#桁ごとに見て、ゼロの数が多ければ、f(x)が最大となるXとなるXのidx番目の桁は1になる
					#1と0が同数の場合は、その桁を0にしたほうが、Xが小さくなるので有利

ans=0
for a in A:
	ans+=X^a

print ans

Measured memory_bytes: 42012
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

const inf = 1 << 60

func solve() {
	n := getInt()

	dp := make([]int, n+1)
	for i := range dp {
		dp[i] = inf
	}
	dp[0] = 0

	for i := 1; i <= n; i++ {
		for j := 1; i-j >= 0; j *= 6 {
			dp[i] = min(dp[i], dp[i-j]+1)
		}
		for j := 1; i-j >= 0; j *= 9 {
			dp[i] = min(dp[i], dp[i-j]+1)
		}
	}

	fmt.Fprintln(wr, dp[n])
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

// -----------------------------------------

var (
	sc = bufio.NewScanner(os.Stdin)
	wr = bufio.NewWriter(os.Stdout)
)

func main() {
	// buf := 200001
	// sc.Buffer(make([]byte, buf), buf)
	sc.Split(bufio.ScanWords)
	solve()
	wr.Flush()
}

func getInt() int {
	sc.Scan()
	i, err := strconv.Atoi(sc.Text())
	if err != nil {
		panic(err)
	}
	return i
}

func getIntSlice(n int) []int {
	is := make([]int, n)
	for i := range is {
		is[i] = getInt()
	}
	return is
}

func getString() string {
	sc.Scan()
	s := sc.Text()
	return s
}

func getRunes() []rune {
	return []rune(getString())
}


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

using namespace std;
#define sf(n) scanf("%d", &n)
#define pd(n) printf("%.12lf", n)
#define pf(n) printf("%d", n)
#define p() printf("\n")
#define ps() printf(" ")
#define ll long long
#define ull unsigned long long
#define MAX 1e9
#define mod 1000 * 1000 * 1000 + 7
#define pi 3.1415926536
#define ex 1e18
#define dbl 2e09
#define qu(q) queue<int> q
#define pqu(q) priority_queue<int> q
#define len(s) s.length()
#define sz(x) int(x.size())
#define pb(x) push_back(x)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define F first
#define S second

const int INF = 0x3f3f3f3f;
const ll LL_INF = 0x3f3f3f3f3f3f3f3f;

int b[10005],a[1000];
int main()
{
    int n, m, c;
    cin >> n >> m >> c;
    for (int i = 0; i < m; ++i)
    {
        cin >> b[i];
    }
    int ans = 0;
    while (n--)
    {
        int sum = 0;
        for (int i = 0; i < m; ++i)
        {
            cin >> a[i];
            sum += (a[i] * b[i]);
        }
        sum += c;
        if (sum > 0)
            ans += 1;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define YES() printf("YES\n")
#define NO() printf("NO\n")
#define Yes() printf("Yes\n")
#define No() printf("No\n")
#define in(x,y,h,w) x >= 0 && x < h && y >= 0 && y < w

#define int long long
//typedef    long long          ll;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      P;

template <typename T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template <typename T> T &chmax(T &a, const T &b) { return a = max(a, b); }
 
const int INF=1e+18;
const double EPS=1e-9;
const int MOD=1000000007;

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

template<long long mod = 1000000007>
struct modint{
	long long a;

	modint() : a(0){}
	modint(long long t){
		a = t % mod;
		if(a < 0) a += mod;
	}

	operator long long() const{ return a; }

	bool operator==(const modint &x) const{ return a == x.a; }
	bool operator!=(const modint &x) const{ return a != x.a; }

	modint operator-() const{ return modint(a ? (mod - a) : 0); }
	modint operator~() const{ return pow(mod - 2); }

	modint operator+(const modint &x) const{ return modint(*this) += x; }
	modint operator-(const modint &x) const{ return modint(*this) -= x; }
	modint operator*(const modint &x) const{ return modint(*this) *= x; }
	modint operator/(const modint &x) const{ return modint(*this) /= x; }

	modint &operator+=(const modint &x){
		a += x.a;
		if(a >= mod) a -= mod;
		return *this;
	}
	modint &operator-=(const modint &x){
		a -= x.a;
		if(a < 0) a += mod;
		return *this;
	}
	modint &operator*=(const modint &x){
		a = a * x.a % mod;
		return *this;
	}
	modint &operator/=(const modint &x){
		a = a * (~x).a % mod; 
		return *this;
	}

	friend ostream &operator<<(ostream &os,const modint &x){
		return os << x.a;
	}
	friend istream &operator>>(istream &is,modint &x){
		long long t;
		is >> t;
		x = modint(t);
		return is;
	}

	modint pow(long long x) const{
		modint ret = 1,tmp = a;
		for(;x;tmp *= tmp,x >>= 1){
			if(x & 1) ret *= tmp;
		}
		return ret;
	}
};

signed main(){
	int x,y;
	cin >> x >> y;
	if((x + y) % 3){
		cout << 0 << endl;
		return 0;
	}
	int d = (x + y) / 3;
	x -= d;
	y -= d;
	if(x < 0 || y < 0){
		cout << 0 << endl;
		return 0;
	}
	modint<> ans = 1;
	for(int i = 0;i < y;i++){
		ans = ans * modint<>(x + y - i) / modint<>(i + 1);
	}
	cout << ans << endl;
}

Measured memory_bytes: 256
import sys
def MI(): return map(int,sys.stdin.readline().rstrip().split())

N,K = MI()
xy = [tuple(MI()) for i in range(N)]

xy.sort()

from operator import itemgetter

ans = 10**19
for i in range(N-1):
    for j in range(i+1,N):
        a = xy[j][0]-xy[i][0]
        A = xy[i:j+1]
        if len(A) >= K:
            A = sorted(A, key=itemgetter(1))
            b = 10**18
            for k in range(len(A)-K+1):
                b = min(b,A[k+K-1][1]-A[k][1])
            ans = min(ans,a*b)

print(ans)


Measured memory_bytes: 74216
n = int(input())
a = list(input())

s = [0] * 10
d = [0] * 100
t = [0] * 1000

s[int(a[0])] = 1
s[int(a[1])] = 1
d[int(a[1]) * 10 + int(a[0])] = 1

for x in a[2:]:
    y = int(x)
    z = y * 100
    for i in range(100):
        if d[i] == 1:
            t[z + i] = 1
    z = y * 10
    for i in range(10):
        if s[i] == 1:
            d[z + i] = 1
    s[y] = 1

print(t.count(1))


Measured memory_bytes: 44260
from collections import Counter, defaultdict

N = int(input())

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

primes = []
for i in range(2, N + 1):
    primes += prime_factorize(i)

counters = Counter(primes)

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    return divisors

divisors = make_divisors(75)
cnt = defaultdict(int)
for k, v in counters.items():
    for d in divisors:
        if v + 1 >= d:
            cnt[d] += 1     
print(cnt[75] + cnt[25] * (cnt[3] - 1) + cnt[15] * (cnt[5] - 1)
+ max(cnt[5] * (cnt[5] - 1) * (cnt[3] - 2) // 2, 0))

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

signed main() {
    int N;
    cin >> N;

    vector<int> h(N + 5), dp(N + 5, 1e10);
    for (int i = 1; i <= N; i++) {
        cin >> h[i];
    }

    dp[1] = 0;
    for (int i = 1; i <= N; i++) {
        dp[i + 1] = min(dp[i] + abs(h[i] - h[i + 1]), dp[i + 1]);
        dp[i + 2] = min(dp[i] + abs(h[i] - h[i + 2]), dp[i + 2]);
    }
    cout << dp[N] << endl;

    return 0;
}


Measured memory_bytes: 1792
def ascend(a,b):
    mini = min(A[a:a+L])
    ans[a] = mini
    for i in range(a+1,b):
        if A[i+L-1] <= mini :
            mini = A[i+L-1]
        elif A[i-1] == mini :
            mini = min(A[i:i+L])
        ans[i] = mini

def descend(a,b):
    mini = min(A[b-1:b+L-1])
    ans[b-1] = mini
    for i in range(b-2,a-1,-1):
        if A[i] <= mini :
            mini = A[i]
        elif A[i+L] == mini:
            mini = min(A[i:i+L])
        ans[i] = mini
    
[N,L] = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
ans = [None]*(N-L+1)

Pcount = 0;
Mcount = 0;
if N > 10 ** 4:
    for i in range(100):
        if A[i+1] > A[i] : Pcount += 1
        if A[i+1] < A[i] : Mcount += 1
    if Pcount > 80 : descend(0, N-L+1)
    else : ascend(0,N-L+1)
else :
    ascend(0, N-L+1)
for i in ans[:-1] : print(i, end=" ")
print(ans[-1])

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

typedef long long ll;
#define REP(i,n) for(int i=0,_n=(int)(n);i<_n;++i)
#define ALL(v) (v).begin(),(v).end()
#define CLR(t,v) memset(t,(v),sizeof(t))
template<class T1,class T2>ostream& operator<<(ostream& os,const pair<T1,T2>&a){return os<<"("<<a.first<<","<<a.second<< ")";}
template<class T>void pv(T a,T b){for(T i=a;i!=b;++i)cout<<(*i)<<" ";cout<<endl;}
template<class T>void chmin(T&a,const T&b){if(a>b)a=b;}
template<class T>void chmax(T&a,const T&b){if(a<b)a=b;}


int nextInt() { int x; scanf("%d", &x); return x;}
ll nextLong() { ll x; scanf("%lld", &x); return x;}

int main2() {
  int N = nextInt();
  string s = "pphbhhphph";
  cout << s[N % 10] << "on" << endl;
  return 0;
}

int main() {
  main2();
  return 0;
}

Measured memory_bytes: 3664
# -*- coding: utf-8 -*-

N = int(input())

ans = 0

# toriaezu a > 10
for i in range(N):
    a = i + 1

    if a < 10:
        ans += 1
        continue

    if str(a)[-1] == '0':
        continue

    # a > b
    if str(a)[0] > str(a)[-1]:
        for j in range(len(str(a)) - 1):
            ans += (10 ** j) * 2

    # a < b
    elif str(a)[0] < str(a)[-1]:
        for j in range(len(str(a)) - 2):
            ans += (10 ** j) * 2

    # a == b
    else:
        # a:2XX2 > b:2YY2
        if a >= 100:
            ans += int(str(a)[1:-1]) * 2

        # a:2XX2 == b:2XX2
        ans += 1

        # a:2XX2, b:2Y3
        for j in range(len(str(a)) - 2):
            ans += (10 ** j) * 2

        # a:2XX2, b:2
        ans += 2

print(ans)


Measured memory_bytes: 3064
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush
from bisect import bisect_left,bisect_right 
import sys,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

n = inp()
d = []
s = set()
dd = {}
ind = 0
for i in range(n):
    x = input()
    if x in s:
        d[dd[x]][1] += 1
    else:
        dd[x] = ind
        d.append([x,1])
        ind += 1
        s.add(x)
d.sort(key = lambda x:x[1], reverse = True)
# print(d)
res = []
for key,va in d:
    if va < d[0][1]:
        break
    res.append(key)
res.sort()
for x in res:
    print(x)

Measured memory_bytes: 197044
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

var scanner = bufio.NewScanner(os.Stdin)

const (
	MAX  = 1000000
	SQRT = 1000
)

func main() {
	comp := make([]int, MAX+2)
	sieve := func() {
		for i := 3; i < SQRT; i += 2 {
			if comp[i] == 0 {
				for j := i * i; j < MAX; j += i {
					comp[j] = 1
				}
			}
		}
	}
	sieve()
	tbl := make([]int, MAX+2)
	tbl[2] = 1
	k := 1
	for i := 3; i < MAX; i += 2 {
		if comp[i] == 0 {
			k++
		}
		tbl[i+1], tbl[i] = k, k
	}
	for scanner.Scan() {
		n, _ := strconv.Atoi(scanner.Text())
		if n == 0 {
			break
		}
		ans := 0
		for i := 0; i < n; i++ {
			scanner.Scan()
			buf := strings.Split(scanner.Text(), " ")
			p, _ := strconv.Atoi(buf[0])
			m, _ := strconv.Atoi(buf[1])
			a, b := p-m, p+m
			if a < 2 {
				a = 2
			}
			if b > MAX {
				b = MAX
			}
			ans += tbl[b] - tbl[a-1] - 1
		}
		if ans < 0 {
			ans = 0
		}
		fmt.Println(ans)
	}
}



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

#define rep(i, n) for (int i = 0; i < (int) (n); i++)
#define reps(i, n, m) for (int i = (int) (n); i < (int) (m); i++)
#define PB push_back

using ll = long long;

using namespace std;

void init();
void solve();
void dfsl(int);

int main()
{
	init();
	solve();
}

struct person {
	vector<int> v;
	bool f;
};

struct lang {
	vector<int> v;
        bool f;
};

vector<person> p;
vector<lang> l;
int N, M;

void init()
{
	cin >> N >> M;
	rep(i, N) {
		person t;
		t.f = false;
		t.v.resize(0);
		p.PB(t);
	}
	rep(i, M) {
		lang t;
		t.v.resize(0);
                t.f = false;
		l.PB(t);
	}
	rep(i, N) {
		int k;
		cin >> k;
		rep(j, k) {
			int t;
			cin >> t;
			t--;
			p[i].v.PB(t);
			l[t].v.PB(i);
		}
	}
}

void dfsp(int x)
{
	if (p[x].f) return;
	p[x].f = true;
	for (int t : p[x].v) {
		dfsl(t);
	}
}

void dfsl(int x)
{
        if (l[x].f) return;
        l[x].f = true;
	for (int t : l[x].v) {
		dfsp(t);
	}
}

void solve()
{
	dfsp(0);
	rep(i, N) {
		if (!p[i].f) {
			cout << "NO" << endl;
			return;
		}
	}
	cout << "YES" << endl;
}


Measured memory_bytes: 10476
/******************************************************************************

                              Online C++ Compiler.
               Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.

*******************************************************************************/

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

int N, D, X;

int a[101];


int chocolatePerStudent(int t)
{
    int res = 0;
    
    for(int act = 1 ; act <= D; act += t)
    {
        res ++;
    }
    return res;
}
int main()
{
    cin >> N >> D >> X;
    
    int n = N;
    
    while(n--)
    {
        cin >> a[N- n -1];
    }
    
    int consumed = 0;
    for(int i = 0; i < N; ++i)
    {
        consumed += chocolatePerStudent(a[i]);
    }
    
    cout << consumed + X;
    
    return 0;
}




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

typedef long long ll;
typedef unsigned long long ull;
using namespace std;

bool flag=0;

int main()
{
    int n;
    cin>>n;
    for(int i=0;i<=n/4;i++)
        if((n-4*i)%7==0&&(n-4*i)/7>=0){flag=1;break;}
    puts(flag?"Yes":"No");
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, a, b) for(ll i = ll(a); i < ll(b); i++)
#define rer(i, a, b) for(ll i = ll(a) - 1; i >= ll(b); i--)
#define sz(v) (int)(v).size()
#define pb push_back
#define sc second
#define fr first
#define sor(v) sort(v.begin(),v.end())
#define rev(s) reverse(s.begin(),s.end())
#define lb(vec,a) lower_bound(vec.begin(),vec.end(),a)
#define ub(vec,a) upper_bound(vec.begin(),vec.end(),a)
#define uniq(vec) vec.erase(unique(vec.begin(),vec.end()),vec.end())
using namespace std;
typedef long long int ll;
typedef pair <int, int> P;

const ll MOD=1000000007;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    for(;;){
        string s, t;
        cin>>s;
        if(s==".") return 0;
        cin>>t;
        int cnt=0;
        int cur=0;
        int i=0, j=0;
        while(i<s.length()&&j<t.length()){
            if(!cur){
                if(s[i]!=t[j]) break;
                else {
                    if(s[i]=='"'&&t[j]=='"'){
                        cur=1;
                    }
                    i++; j++;
                }
            }
            else{
                int x=i, y=j;
                while(s[x]!='"'){
                    x++;
                }
                while(t[y]!='"'){
                    y++;
                }
                if(s.substr(i,x-i)!=t.substr(j,y-j)) cnt++;
                i=x+1;
                j=y+1;
                cur=0;
            }
        }
        if(i==s.length()&&j==t.length()){
            if(cnt==0) cout <<"IDENTICAL"<<"\n";
            else if(cnt==1) cout <<"CLOSE"<<"\n";
            else cout <<"DIFFERENT"<<"\n";
        }
        else cout <<"DIFFERENT"<<"\n";
    }
}


Measured memory_bytes: 3160