import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		String string = sc.nextLine();

		String regex = "hi";
		Pattern pt =Pattern.compile(regex);
		Matcher matcher = null;

		if (string.length() < 2) {
			System.out.println("No");
		}else {
			for (int i = 0; i < string.length(); i+=2) {
				matcher = pt.matcher(string.substring(i, i + 2));
				if (matcher.find() == false) {
					System.out.println("No");
					break;
				}
				if (i == string.length() - 2) {
					System.out.println("Yes");
				}
			}
		}
	}
}


import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		String string = sc.nextLine();

		String regex = "hi";
		Pattern pt =Pattern.compile(regex);
		Matcher matcher = null;

		for (int i = 0; i < string.length(); i+=2) {
			matcher = pt.matcher(string.substring(i, i + 2));
			if (matcher.find() == false) {
				System.out.println("No");
				break;
			}
			if (i == string.length() - 2) {
				System.out.println("Yes");
			}
		}

	}
}


package test;

import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		String string = sc.nextLine();

		String regex = "hi";
		Pattern pt =Pattern.compile(regex);
		Matcher matcher = null;

		for (int i = 0; i < string.length(); i+=2) {
			matcher = pt.matcher(string.substring(i, i + 2));
			if (matcher.find() == false) {
				System.out.println("No");
				break;
			}
			if (i == string.length() - 2) {
				System.out.println("Yes");
			}
		}

	}
}


#include<stdio.h>
#include<stdlib.h>
#include<algorithm>
#include<string.h>
using namespace std;
char str[105];
int main(void)
{
	scanf("%s", str);
	int len = strlen(str);
	if (len % 2) {
		printf("No\n");
		return 0;
	}
	bool flag = 0;
	for (int i = 0; i < len; i+=2)
		if (!((str[i] == 'h') && (str[i + 1] == 'i'))) {
			flag = 1;
			break;
		}
	if (flag)
		printf("No\n");
	else
		printf("Yes\n");
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vii = vector<vi>;
using in6 = int64_t;
using ind = double;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main() {
  string s;
  cin >> s;
  int check = 0;
  int size = (int)s.size();
  if(size % 2 == 0) size /= 2;
  else check++;
  rep(i,size) {
    string a = s.substr(i,2);
    if(a != "hi") {
      check++;
      break;
    }
    i++;
  }
  if(check == 0) cout << "Yes" << endl;
  else cout << "No" << endl;
}


#include<iostream>
#include<string.h>
#include<math.h>
#include<algorithm>
#include<map>
#include<set>
#include<stack>
#include<queue>
using namespace std;
typedef long long ll;
int main()
{
	int m,n,i,t,j,k;
	char s[1000];
	scanf("%s",&s);
	int flag=0;
	m=strlen(s);
	if(m%2!=0) flag=1;
	int p=0;
	while(m!=0&&flag==0)
	{
		if(s[p]!='h')
		{
			flag=1;
		}
		p++;m--;
		if(s[p]!='i')
		{
			flag=1;
		}
		p++;m--;
	}
	if(flag) printf("No");
	else printf("Yes");
}


#include <algorithm>
#include <bitset>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <cctype>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <limits>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace std;
using ll = long long;
using ld = long double;
#define endl "\n"
//#define int long long
#define all(V) V.begin(),V.end()
#define rep(i, n) for (int i = 0; i < n; i++)
#define REP(i,n) for(int i=1;i<=(n);i++)
const int MOD = 1e9 + 7;
const ll INF = 1LL << 60;
const int inf = 1 << 25;
constexpr long double pi = 3.141592653589793238462643383279;
int dx[] = { 1,0,-1,0 };
int dy[] = { 0,1,0,-1 };
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 fact_mod(ll n, ll mod) {
    ll f = 1; for (int i = 2; i <= n; i++) f = f * (i % mod) % mod;
    return f;
}
ll gcd(ll a, ll b) {
    if (b == 0) return a;
    return gcd(b, a % b);
}
ll lcm(ll a, ll b) {
    return a * b / gcd(a, b);
}
ll keta(ll n) {
    if (n == 0) return 1;
    ll count = 0;
    while (n != 0) {
        n /= 10;
        count++;
    }
    return count;
}
ll ketasum(ll n) {
    ll sum = 0;
    while (n != 0) {
        sum += n % 10;
        n /= 10;
    }
    return sum;
}
ll mch(ll n) {
    if (n == 1) return 1;
    else return n * mch(n - 1);
}
ll pow_mod(ll x, ll n, ll mod) {
    ll res = 1;
    while (n > 0) {
        if (n & 1) res = (res * x) % mod; //ビット演算(最下位ビットが1のとき)
        x = (x * x) % mod;
        n >>= 1; //右シフト(n = n >> 1)
    }
    return res;
}
ll inv_mod(ll a, ll mod) { //逆元
    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;
}
bool is_prime(const unsigned n) {
    switch (n) {
    case 0: // fall-through
    case 1: return false;
    case 2: // fall-through
    case 3: return true;
    } // n > 3 が保証された
    if (n % 2 == 0 || n % 3 == 0) return false;
    for (unsigned i = 5; i * i <= n; i += 6) {
        if (n % i == 0) return false; // (6の倍数)-1
        if (n % (i + 2) == 0) return false; // (6の倍数)+1
    }
    return true;
}

//宣言とか
bool ok;
/*signed*/int main(void) {
    string s;
    cin >> s;
    rep(i, s.size() - 1) {
        if (s[i] == 'h' && s[i + 1] == 'i') {
            ok = true;
            continue;
        }
        else ok = false;
    }
    if (ok) puts("Yes");
    else puts("No");
    return 0;
}


#include <algorithm>
#include <bitset>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <cctype>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <limits>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace std;
using ll = long long;
using ld = long double;
#define endl "\n"
//#define int long long
#define all(V) V.begin(),V.end()
#define rep(i, n) for (int i = 0; i < n; i++)
#define REP(i,n) for(int i=1;i<=(n);i++)
const int MOD = 1e9 + 7;
const ll INF = 1LL << 60;
const int inf = 1 << 25;
constexpr long double pi = 3.141592653589793238462643383279;
int dx[] = { 1,0,-1,0 };
int dy[] = { 0,1,0,-1 };
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 fact_mod(ll n, ll mod) {
    ll f = 1; for (int i = 2; i <= n; i++) f = f * (i % mod) % mod;
    return f;
}
ll gcd(ll a, ll b) {
    if (b == 0) return a;
    return gcd(b, a % b);
}
ll lcm(ll a, ll b) {
    return a * b / gcd(a, b);
}
ll keta(ll n) {
    if (n == 0) return 1;
    ll count = 0;
    while (n != 0) {
        n /= 10;
        count++;
    }
    return count;
}
ll ketasum(ll n) {
    ll sum = 0;
    while (n != 0) {
        sum += n % 10;
        n /= 10;
    }
    return sum;
}
ll mch(ll n) {
    if (n == 1) return 1;
    else return n * mch(n - 1);
}
ll pow_mod(ll x, ll n, ll mod) {
    ll res = 1;
    while (n > 0) {
        if (n & 1) res = (res * x) % mod; //ビット演算(最下位ビットが1のとき)
        x = (x * x) % mod;
        n >>= 1; //右シフト(n = n >> 1)
    }
    return res;
}
ll inv_mod(ll a, ll mod) { //逆元
    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;
}
bool is_prime(const unsigned n) {
    switch (n) {
    case 0: // fall-through
    case 1: return false;
    case 2: // fall-through
    case 3: return true;
    } // n > 3 が保証された
    if (n % 2 == 0 || n % 3 == 0) return false;
    for (unsigned i = 5; i * i <= n; i += 6) {
        if (n % i == 0) return false; // (6の倍数)-1
        if (n % (i + 2) == 0) return false; // (6の倍数)+1
    }
    return true;
}

//宣言とか
bool ok;
/*signed*/int main(void) {
    string s;
    cin >> s;
    rep(i, s.size() - 1) {
        if (s[i] == 'h' && s[i + 1] == 'i') ok = true;
    }
    if (ok) puts("Yes");
    else puts("No");
    return 0;
}


#include<bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (n); ++i)
//#define DEBUG
#ifdef DEBUG
#define DEBUG_PRINT(fm, ...) do{std::printf("%s:%d(%s)", __FILE__, __LINE__, __func__);std::cout << "DEBUG PRINT ";std::printf(fm, __VA_ARGS__);}while(0)
#define DEBUG_VAL(a, b) do{std::printf("%s:%d(%s)", __FILE__, __LINE__, __func__);std::cout <<"DEBUG VAL " << a << ":" << b << endl;}while(0)
#else
#define DEBUG_PRINT(...)do{}while(0);
#define DEBUG_VAL(a, b)do{}while(0);
#endif

using namespace std;
using ll = long long;
using v1 = vector<int>;
using vl = vector<long long>;
using v2 = vector<vector<int>>;
using v3 = vector<vector<char>>;
int main(){
    string s;
    cin >> s;
    if(s.size() <2){
        cout << "No" << endl;
        return 0;
    }
    string an = "";
    for(int i = 0; i < s.size(); i++){
        if(i%2 == 0) an += "h";
        else an += "i";
    }
    if(s == an) cout << "Yes" << endl;
    else cout << "No" << endl;
}


#include<stdio.h>
#include<string.h>
int main(){
    char s[11];
    scanf("%s",s);
    int p=strlen(s);
    if(p%2!=0){
        puts("No");
        return 0;
    }
    for(int i=0;i<p-1;){
        if(s[i]=='h'&&s[i+1]=='i'){
            i+=2;
        }
        else{
            puts("No");
            return 0;
        }
    }
    puts("Yes");
    return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(){

	int n;
	char s[1][10];

	scanf("%s", s[0]);

	n = strlen(s[0]);

	int state = 1;
	if(n % 2 == 0) {
		for(int i = 0; i < n - 1; i+= 2) {
			if(s[0][i] == 'h' && s[0][i+1] == 'i') {
				state = 1;
			} else {
				state = 0;
			}
		}
	} else {
		state = 0;
	}

	if(state == 0) {
		printf("No\n");
	} else {
		printf("Yes\n");
	}
	return 0;

}


#include <stdio.h>
#include<string.h>
int main()
{
    char s[15];
    scanf("%s",s);
    int l=strlen(s);
    if(l%2)
    printf("No\n");
    else
    {
        int flag=1,i=0;
        while(i<l)
        {
            if(s[i]!='h'||s[i+1]!='i')
            {
                flag=0;
                break;
            }
            i+=2;
        }
        if(flag==1)
        printf("Yes\n");
        else
        printf("No\n");
    }
}


#include<stdio.h>
#include<string.h>

int main() {
	char s[11];
	scanf("%s", s);
	int flag = 0;
	for (int i = 0; i < strlen(s); i++) {
		if (strlen(s) == 1) { printf("No"); return 0; }
		if (i % 2 == 0) {
			if (s[i] != 'h') {
				printf("No");
				return 0;
			}
		}
		else if (s[i] != 'i') {
			printf("No");
			return 0;
		}
	}
	printf("Yes");

	return 0;
}


#include<stdio.h>
#include<string.h>

int main() {
	char s[11];
	scanf("%s", s);
	int flag = 0;
	for (int i = 0; i < strlen(s); i++) {
		if (i % 2 == 0) {
			if (s[i] != 'h') {
				printf("No");
				return 0;
			}
		}
		else if (s[i] != 'i') {
			printf("No");
			return 0;
		}
	}
	printf("Yes");

	return 0;
}


#include<stdio.h>

int main()
{
  char s[11];
  scanf("%s",s);

  if(s == "hi"){
    puts("Yes");
    return 0;
  }
  if(s == "hihi"){
    puts("Yes");
    return 0;
  }
  if(s == "hihihi"){
    puts("Yes");
    return 0;
  }
  if(s == "hihihihi"){
    puts("Yes");
    return 0;
  }
  if(s == "hihihihihi"){
    puts("Yes");
    return 0;
  }

}


// inputに入力データ全体が入る
function Main(input) {
  input = input.split("\n");
  tmp = input[0]
  ans = tmp.replace(/hi/g,'')
  if(ans.length == 0){
    console.log('Yes')
  }else{
    console.log('No')
  }

}

//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


'use strict'

const main = (arg) => {
  const S = arg.split('\n')[0]

  if (S.split('hi').filter(v => v).length == 0) {
    console.log('Yes')
  } else {
    console.log('No')
  }
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'))


const main = (inputs) => {
  const word = inputs[0];
  var flag = true;
  for (var i = 0; i < word.length; i++) {
    var count = 0;
    if (i % 2 === 0 && word[i] === 'h') {
      count = count + 1;
    }
    if (i % 2 === 1 && word[i] === 'i') {
      count = count + 1;
    }
    if (count === 0) {
      flag = false;
      break;
    }
  }
  if (flag && word.length % 2 === 0) {
    console.log('Yes');
  } else {
    console.log('No');
  }
}

main(require('fs').readFileSync('/dev/stdin', 'UTF-8').trim().split("\n"));


function myin(){return require("fs").readFileSync("/dev/stdin", "utf8").trim();}

//0:何もしない  1:数値へ変換  2:半角SPで分割  3:改行で分割  4:半角SPで分割し、数値配列へ
//5:改行で分割し、数値配列へ  6:1文字に分割  7:1文字に分割し、数値配列へ
function myconv(i, no){
  switch(no){
    case 0: return i;
    case 1: return parseInt(i);
    case 2: return i.split(" ");
    case 3: return i.split("\n");
    case 4: return i.split(" ").map((a)=>Number(a));
    case 5: return i.split("\n").map((a)=>Number(a));
    case 6: return i.split("");
    case 7: return i.split("").map((a)=>Number(a));
  }}

function Main(input) {
  input = myconv(input, 3);
  const A = myconv(input[0], 4)[0];
  const B = myconv(input[0], 4)[1];
  const M = myconv(input[0], 4)[2];
  const a = myconv(input[1], 4);
  const b = myconv(input[2], 4);
  input.shift();
  input.shift();
  input.shift();
  let price = [];
  for(let i = 0; i < A; i++) {
    for(let j = 0; j < B; j++) {
      let p = a[i] + b[j];
      price.push(p);
    }
  }
  len = input.length;
  for(let i = 0; i < len; i++){
    let x = myconv(input[i], 4)[0];
    let y = myconv(input[i], 4)[1];
    let c = myconv(input[i], 4)[2];

    let k = (x-1)*B + y - 1;
    const origin_p = price[k];
    price.push(price[k] - c);
  }
  console.log(Math.min.apply(null, price));
}
Main(myin());


"use strict";
const Main = (input) =>{
   let xs = input.trim().split('');
   let len = xs.length;
   let ans = 0;

    for(let i =0; i<=len; i++) {
       if(i%2==0 && xs[i]=='h') {
       	ans+=1;
       }else if(i%2==1 && xs[i]=='i'&&xs[i+1]!='i'){
        ans+=1;
       }else{
        ans+=0;
       }
    }
    if(ans>=2){
    console.log('Yes');
    }else{
    console.log('No');
    }
}
Main(require('fs').readFileSync('/dev/stdin','utf8'));


"use strict";
const Main = (input) =>{
   let xs = input.trim().split('');
   let len = xs.length;
   let ans = 0;

    for(let i =0; i<=len; i++) {
       if(i%2==1 && xs[i]=='h'&&[i+1]!='h') {
       	ans+=1;
       }else if(i%2==0 && xs[i]=='i' &&xs[i+1]!='i'){
        ans+=1;
       }else{
        ans+=0;
       }
    }
    if(ans>=2){
    console.log('Yes');
    }else{
    console.log('No');
    }
}
Main(require('fs').readFileSync('/dev/stdin','utf8'));


package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"reflect"
	"sort"
	"strconv"
	"strings"
	// "regexp"
)

/* sort */
type pair struct {
	index  int64
	p1, p2 interface{}
}
type pairs []pair

func (slice pairs) Len() int {
	return len(slice)
}

func (slice pairs) Less(i, j int) bool {
	return slice[i].index < slice[j].index
}

func (slice pairs) Swap(i, j int) {
	slice[i], slice[j] = slice[j], slice[i]
}

/* sort */
type Int64Slice []int64

func (slice Int64Slice) Len() int {
	return len(slice)
}

func (slice Int64Slice) Less(i, j int) bool {
	return slice[i] < slice[j]
}

func (slice Int64Slice) Swap(i, j int) {
	slice[i], slice[j] = slice[j], slice[i]
}
func Int64s(a []int64)                    { sort.Sort(Int64Slice(a)) }
func Int64sSliceAreSorted(a []int64) bool { return sort.IsSorted(Int64Slice(a)) }

const (
	initialBufSize = 1e4
	maxBufSize     = 1e8
	INF            = 1e8
)

var (
	scanner = bufio.NewScanner(os.Stdin)
	writer  = bufio.NewWriter(os.Stdout)
	di      = []int64{-1, 0, 1, 0}
	dj      = []int64{0, -1, 0, 1}
	di8     = []int64{-1, -1, 0, 1, 1, 1, 0, -1}
	dj8     = []int64{0, -1, -1, -1, 0, 1, 1, 1}
)

func main() {
	buf := make([]byte, initialBufSize)
	scanner.Buffer(buf, maxBufSize)
	scanner.Split(bufio.ScanWords)
	S := readString()
	s := strings.Repeat("hi", len(S)/2)
	if S == s {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

/*==========================================
 *             Library
 *==========================================*/
func NextPermutation(x sort.Interface) bool {
	n := x.Len() - 1
	if n < 1 {
		return false
	}
	j := n - 1
	for ; !x.Less(j, j+1); j-- {
		if j == 0 {
			return false
		}
	}
	l := n
	for !x.Less(j, l) {
		l--
	}
	x.Swap(j, l)
	for k, l := j+1, n; k < l; {
		x.Swap(k, l)
		k++
		l--
	}
	return true
}
func doubleAry(h int64, w int64, init int64) (res [][]int64) {
	res = make([][]int64, h)
	for i := int64(0); i < h; i++ {
		res[i] = make([]int64, w)
		for j := int64(0); j < w; j++ {
			res[i][j] = init
		}
	}
	return
}

func aryEq(a []int64, b []int64) bool {
	return reflect.DeepEqual(a, b)
}

func clone(n []int64) (r []int64) {
	r = make([]int64, len(n))
	for i := 0; i < len(n); i++ {
		r[i] = n[i]
	}
	return
}
func write(s string) {
	writer.WriteString(s)
}

func print() {
	writer.Flush()
}

// scanner.Split(bufio.ScanWords) をコメントアウトしないと使用不可
func readLine() (s string) {
	if scanner.Scan() {
		s = scanner.Text()
	}
	return s
}

func readInt() (read int64) {
	scanner.Scan()
	read, err := strconv.ParseInt(scanner.Text(), 10, 64)
	if err != nil {
		panic(err)
	}
	return
}

func readFloat() (read float64) {
	scanner.Scan()
	read, err := strconv.ParseFloat(scanner.Text(), 64)
	if err != nil {
		panic(err)
	}
	return
}

func readRunes() (read []rune) {
	scanner.Scan()
	for _, v := range scanner.Text() {
		read = append(read, v)
	}
	return
}

func readString() (read string) {
	scanner.Scan()
	read = scanner.Text()
	return
}

func readStrings() (read []string) {
	scanner.Scan()
	for _, v := range scanner.Text() {
		read = append(read, string(v))
	}
	return
}

func s2i(s string) int64 {
	var intVal, e = strconv.ParseInt(s, 10, 64)
	if e != nil {
		panic(e)
	}
	return intVal
}

func i2s(i int64) string {
	var strVal = strconv.FormatInt(i, 10)
	return strVal
}

func s2f(s string) float64 {
	var floatVal, e = strconv.ParseFloat(s, 64)
	if e != nil {
		panic(e)
	}
	return floatVal
}

func abs(i int64) int64 {
	return int64(math.Abs(float64(i)))
}

func max(a ...int64) int64 {
	ans := int64(0)
	for i, v := range a {
		if i == 0 {
			ans = v
		}
		if ans < v {
			ans = v
		}
	}
	return ans
}
func min(a ...int64) int64 {
	ans := int64(0)
	for i, v := range a {
		if i == 0 {
			ans = v
		}
		if ans > v {
			ans = v
		}
	}
	return ans
}

func sum(i []int64) int64 {
	sum := int64(0)
	for _, val := range i {
		sum += val
	}
	return sum
}

func split(s string) []string {
	return strings.Fields(s)
}

func strAry2intAry(strs []string) []int64 {
	var ret = make([]int64, 0, len(strs))
	for _, str := range strs {
		var intVal = s2i(str)
		ret = append(ret, intVal)
	}
	return ret
}

func intAry2strAry(nums []int64) []string {
	var ret = make([]string, 0, len(nums))
	for _, num := range nums {
		var strVal = i2s(num)
		ret = append(ret, strVal)
	}
	return ret
}

func ary2str(strs []string) string {
	return strings.Join(strs, " ")
}

func reverse(res []int64) []int64 {
	for i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {
		res[i], res[j] = res[j], res[i]
	}
	return res
}
func reverseStr(res []string) []string {
	for i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {
		res[i], res[j] = res[j], res[i]
	}
	return res
}

func ini(res []int, init int) {
	if len(res) == 0 {
		return
	}
	res[0] = init
	for i := 0; i < len(res); i++ {
		copy(res[i:], res[:i])
	}
}

//
// func regexpExample() {
//     // Your code here!
//     var str = "13:20"
//     r := regexp.MustCompile(`(\d+):(\d+)`)
//     fmt.Println(r.FindStringSubmatch(str))
// }

// type Country struct {
//     gold int
//     silver int
//     blonze int
// }

// // 複数ソートのサンプル
// func stableSortExample() []Country{
//     var country = []Country {
//         {gold:1, silver:2, blonze:3},
//         {gold:1, silver:2, blonze:3},
//         {gold:1, silver:3, blonze:2},
//         {gold:1, silver:3, blonze:3},
//     }
//     sort.SliceStable(country, func(i, j int) bool { return country[i].blonze > country[j].blonze })
//     sort.SliceStable(country, func(i, j int) bool { return country[i].silver > country[j].silver })
//     sort.SliceStable(country, func(i, j int) bool { return country[i].gold > country[j].gold })
//     return country
// }


package main

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

var sc = bufio.NewScanner(os.Stdin)

func nextString() string {
	sc.Scan()
	return sc.Text()
}

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

func main() {
	S := nextString()

	ans := false
	hitachi := ""
	for i := 1; i <= 5; i++ {
		hitachi += "hi"
		if hitachi == S {
			ans = true
		}
	}

	if ans {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}


package main

import (
  "fmt"
  "regexp"
)

func main() {
  var s string
  fmt.Scan(&s)
  r := regexp.MustCompile(`^(hi)+$`)
  if r.MatchString(s) {
    fmt.Println("Yes")
  } else {
    fmt.Println("No")
  }
}


package main

import "fmt"

func main() {
	// Code for A - Hitachi String
	var S string
	fmt.Scanf("%s", &S)

	var ans string
	for i := 0; i < len(S); i++ {
		if i%2 == 0 {
			ans += "h"
		} else {
			ans += "i"
		}
	}

	if S == ans {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}


package main

import (
  "fmt"
  "strings"
)

func main() {
  var s string
  fmt.Scanf("%s", &s)

  ans := "No"
  if strings.Contains(s, "hi") {
    ans = "Yes"
  }
  fmt.Printf("%s\n", ans)
}


package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"reflect"
	"sort"
	"strconv"
	"strings"
	// "regexp"
)

/* sort */
type pair struct {
	index  int64
	p1, p2 interface{}
}
type pairs []pair

func (slice pairs) Len() int {
	return len(slice)
}

func (slice pairs) Less(i, j int) bool {
	return slice[i].index < slice[j].index
}

func (slice pairs) Swap(i, j int) {
	slice[i], slice[j] = slice[j], slice[i]
}

/* sort */
type Int64Slice []int64

func (slice Int64Slice) Len() int {
	return len(slice)
}

func (slice Int64Slice) Less(i, j int) bool {
	return slice[i] < slice[j]
}

func (slice Int64Slice) Swap(i, j int) {
	slice[i], slice[j] = slice[j], slice[i]
}
func Int64s(a []int64)                    { sort.Sort(Int64Slice(a)) }
func Int64sSliceAreSorted(a []int64) bool { return sort.IsSorted(Int64Slice(a)) }

const (
	initialBufSize = 1e4
	maxBufSize     = 1e8
	INF            = 1e8
)

var (
	scanner = bufio.NewScanner(os.Stdin)
	writer  = bufio.NewWriter(os.Stdout)
	di      = []int64{-1, 0, 1, 0}
	dj      = []int64{0, -1, 0, 1}
	di8     = []int64{-1, -1, 0, 1, 1, 1, 0, -1}
	dj8     = []int64{0, -1, -1, -1, 0, 1, 1, 1}
)

func main() {
	buf := make([]byte, initialBufSize)
	scanner.Buffer(buf, maxBufSize)
	scanner.Split(bufio.ScanWords)
	S := readString()
	for i := 0; i < len(S); i++ {
		if i%2 == 0 {
			if S[i] != 'h' {
				fmt.Println("No")
				return
			}
		} else {
			if S[i] != 'i' {
				fmt.Println("No")
				return
			}
		}
	}
	fmt.Println("Yes")
}

/*==========================================
 *             Library
 *==========================================*/
func NextPermutation(x sort.Interface) bool {
	n := x.Len() - 1
	if n < 1 {
		return false
	}
	j := n - 1
	for ; !x.Less(j, j+1); j-- {
		if j == 0 {
			return false
		}
	}
	l := n
	for !x.Less(j, l) {
		l--
	}
	x.Swap(j, l)
	for k, l := j+1, n; k < l; {
		x.Swap(k, l)
		k++
		l--
	}
	return true
}
func doubleAry(h int64, w int64, init int64) (res [][]int64) {
	res = make([][]int64, h)
	for i := int64(0); i < h; i++ {
		res[i] = make([]int64, w)
		for j := int64(0); j < w; j++ {
			res[i][j] = init
		}
	}
	return
}

func aryEq(a []int64, b []int64) bool {
	return reflect.DeepEqual(a, b)
}

func clone(n []int64) (r []int64) {
	r = make([]int64, len(n))
	for i := 0; i < len(n); i++ {
		r[i] = n[i]
	}
	return
}
func write(s string) {
	writer.WriteString(s)
}

func print() {
	writer.Flush()
}

// scanner.Split(bufio.ScanWords) をコメントアウトしないと使用不可
func readLine() (s string) {
	if scanner.Scan() {
		s = scanner.Text()
	}
	return s
}

func readInt() (read int64) {
	scanner.Scan()
	read, err := strconv.ParseInt(scanner.Text(), 10, 64)
	if err != nil {
		panic(err)
	}
	return
}

func readFloat() (read float64) {
	scanner.Scan()
	read, err := strconv.ParseFloat(scanner.Text(), 64)
	if err != nil {
		panic(err)
	}
	return
}

func readRunes() (read []rune) {
	scanner.Scan()
	for _, v := range scanner.Text() {
		read = append(read, v)
	}
	return
}

func readString() (read string) {
	scanner.Scan()
	read = scanner.Text()
	return
}

func readStrings() (read []string) {
	scanner.Scan()
	for _, v := range scanner.Text() {
		read = append(read, string(v))
	}
	return
}

func s2i(s string) int64 {
	var intVal, e = strconv.ParseInt(s, 10, 64)
	if e != nil {
		panic(e)
	}
	return intVal
}

func i2s(i int64) string {
	var strVal = strconv.FormatInt(i, 10)
	return strVal
}

func s2f(s string) float64 {
	var floatVal, e = strconv.ParseFloat(s, 64)
	if e != nil {
		panic(e)
	}
	return floatVal
}

func abs(i int64) int64 {
	return int64(math.Abs(float64(i)))
}

func max(a ...int64) int64 {
	ans := int64(0)
	for i, v := range a {
		if i == 0 {
			ans = v
		}
		if ans < v {
			ans = v
		}
	}
	return ans
}
func min(a ...int64) int64 {
	ans := int64(0)
	for i, v := range a {
		if i == 0 {
			ans = v
		}
		if ans > v {
			ans = v
		}
	}
	return ans
}

func sum(i []int64) int64 {
	sum := int64(0)
	for _, val := range i {
		sum += val
	}
	return sum
}

func split(s string) []string {
	return strings.Fields(s)
}

func strAry2intAry(strs []string) []int64 {
	var ret = make([]int64, 0, len(strs))
	for _, str := range strs {
		var intVal = s2i(str)
		ret = append(ret, intVal)
	}
	return ret
}

func intAry2strAry(nums []int64) []string {
	var ret = make([]string, 0, len(nums))
	for _, num := range nums {
		var strVal = i2s(num)
		ret = append(ret, strVal)
	}
	return ret
}

func ary2str(strs []string) string {
	return strings.Join(strs, " ")
}

func reverse(res []int64) []int64 {
	for i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {
		res[i], res[j] = res[j], res[i]
	}
	return res
}
func reverseStr(res []string) []string {
	for i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {
		res[i], res[j] = res[j], res[i]
	}
	return res
}

func ini(res []int, init int) {
	if len(res) == 0 {
		return
	}
	res[0] = init
	for i := 0; i < len(res); i++ {
		copy(res[i:], res[:i])
	}
}

//
// func regexpExample() {
//     // Your code here!
//     var str = "13:20"
//     r := regexp.MustCompile(`(\d+):(\d+)`)
//     fmt.Println(r.FindStringSubmatch(str))
// }

// type Country struct {
//     gold int
//     silver int
//     blonze int
// }

// // 複数ソートのサンプル
// func stableSortExample() []Country{
//     var country = []Country {
//         {gold:1, silver:2, blonze:3},
//         {gold:1, silver:2, blonze:3},
//         {gold:1, silver:3, blonze:2},
//         {gold:1, silver:3, blonze:3},
//     }
//     sort.SliceStable(country, func(i, j int) bool { return country[i].blonze > country[j].blonze })
//     sort.SliceStable(country, func(i, j int) bool { return country[i].silver > country[j].silver })
//     sort.SliceStable(country, func(i, j int) bool { return country[i].gold > country[j].gold })
//     return country
// }


S = gets.chomp
if S.length.even?
    puts S=="hi" * (S.length/2) ? "Yes" : "No"
else
    puts "No"
end


S = gets.chomp

if S.length % 2 == 1 then
  print "No"
else
  ans = "Yes"
  for j in 1..S.length / 2 do
    if S[2 * j-2] != "h" or S[2*j-1] != "i" then
      ans = "No"
    end
  end
  print ans
end


s = gets.chomp

if (s.start_with?("hi") && s.end_with?("hi"))
  puts 'Yes'
else
  puts 'No'
end


s = gets.chomp

x = s.length / 2
if s == 'hi' * x
  puts 'Yes'
else
  'No'
end


S = gets.chomp

if S.length % 2 == 1 then
  print "No"
else
  ans = "Yes"
  for i in 1..S.length / 2 do
    if S[2i-2] != "h" or S[2i-1] != "i" then
      ans = "No"
    end
  end
  print ans
end


require 'set'

def main
    s = gets.chomp

    (0..s.size/2-1).each do |i|
        if s[i*2,2] != "hi"
            puts "No"
            return
        end
    end
    puts "Yes"
end

main

## イディオムなど
# until s.empty? do
#
## 配列のインデックス
# s[0,6] # 0番目から6文字
# s[0..6] # 0番目から6番目まで
# s[5..-1] # 5番目から最後まで
#
## 全探索
# [0, 1].repeated_permutation(n) do |combination| # bit全探索
# array.combination(i) do |selected| # array から要素が i 個である部分列を全部抽出
#
## 無向グラフの幅優先探索(BFS)
# to = Array.new(n).map{Array.new()} # ある頂点と繋がる頂点のリスト
# m.times do
#     a,b = gets.chomp.split(" ").map(&:to_i)
#     to[a].push b
#     to[b].push a
# end
# q = Queue.new # BFS は queue
# ds = Array.new(n, -1)
# pre = Array.new(n, -1)
#
## その他
# a1 = Marshal.load(Marshal.dump(a2)) # 深いコピー
# matrix = Array.new(n).map{Array.new()} # 二次元配列の初期化
#


use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let s: Vec<char> = read::<String>().chars().collect();
    let l = s.len();
    if l % 2 == 1 {
        println!("No");
        return;
    }
    for i in (0 as usize)..l {
        if i % 2 == 0 && s[i] != 'h' {
            println!("No");
            return;
        } else if i % 2 == 1 && s[i] != 'i' {
            println!("No");
            return;
        }
    }
    println!("Yes");
}


// https://atcoder.jp/contests/hitachi2020/tasks/hitachi2020_a
//
#![allow(unused_imports)]
use std::io::*;
use std::io::Write;
use std::fmt::*;
use std::str::*;
use std::cmp::*;
use std::collections::*;

// Input macros.
// Original by tanakh: https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

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

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

#[allow(unused_macros)]
macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

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

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

    ($iter:expr, switch) => {
        {
            let ty = read_value!($iter, i32);
            if ty == 1 {
                vec![ty, read_value!($iter, i32), read_value!($iter, i32)]
            } else if ty == 2 {
                vec![ty, read_value!($iter, i32)]
            } else {
                vec![ty, read_value!($iter, i32)]
            }
        }
    };

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

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

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

#[allow(unused_macros)]
macro_rules! read_line {
    ($t:tt) => {
        {
            let mut s = String::new();
            std::io::stdin().read_line(&mut s).unwrap();
            s.trim_right().parse::<$t>().unwrap()
        }
    }
}

#[allow(unused_macros)]
macro_rules! dvec {
    ($t:expr ; $len:expr) => {
        vec![$t; $len]
    };

    ($t:expr ; $len:expr, $($rest:expr),*) => {
        vec![dvec!($t; $($rest),*); $len]
    };
}

#[allow(unused_macros)]
macro_rules! ifv {
    ($t:expr, $a:expr, $b: expr) => {
        if $t { $a } else { $b }
    }
}

#[allow(unused_macros)]
macro_rules! fill {
    ($t:expr, $v:expr) => {
        for i in 0..$t.len() {
            $t[i] = $v;
        }
    };
}

#[allow(unused_macros)]
macro_rules! join {
    ($t:expr, $glue:expr) => {
        $t.into_iter().map(|w| w.to_string()).collect::<Vec<_>>().join($glue)
    };
}

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

// ===

fn solve(a: Vec<char>) -> bool {
    let n = a.len();
    for i in 0..n/2 {
        if a[i*2] != 'h' || a[i*2+1] != 'i' {
            return false;
        }
    }
    return n % 2 == 0;
}

fn main() {
    input! {
        a: chars
    };
    println!("{}", ifv!(solve(a), "Yes", "No"));
}


use std::io::stdin;
use std::str::FromStr;
use std::io::prelude::*;

fn main() {
    let s: String = read();

    let his = ["hi", "hihi", "hihihi", "hihihihi", "hihihihihi"];
    let ans = if his.contains(&&s.as_str()) {
        "Yes"
    } else {
        "No"
    };
    println!("{}", ans);
}

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let token: String = stdin
        .lock()
        .bytes()
        .map(|b| b.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().unwrap()

}


use std::io::{stdin, Read, StdinLock};
use std::str::FromStr;

// reference: http://ir5.hatenablog.com/entry/20171209/1512821837

struct Scanner<'a> {
    cin: StdinLock<'a>,
}

impl<'a> Scanner<'a> {
    fn new(cin: StdinLock<'a>) -> Scanner<'a> {
        Scanner { cin: cin }
    }

    fn read1<T: FromStr>(&mut self) -> Option<T> {
        let token = self.cin.by_ref().bytes().map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect::<String>();
        token.parse::<T>().ok()
    }

    fn read<T: FromStr>(&mut self) -> T {
        self.read1().unwrap()
    }
}

use std::mem;
use std::cmp;

fn main() {
    let cin = stdin();
    let cin = cin.lock();
    let mut sc = Scanner::new(cin);

    let h: String = sc.read();
    let mut ok = true;
    for i in 0..h.len() {
        let c = h.chars().nth(i).unwrap();
        if i % 2 == 0 {
            if c != 'h' {
                ok = false
            }
        } else {
            if c != 'i' {
                ok = false
            }
        }
    }

    if ok {
        println!("{}", "Yes")
    } else {
        println!("{}", "No")
    }

}


use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let s: Vec<char> = read::<String>().chars().collect();
    let l = s.len();
    if l.len() % 2 == 1 {
        println!("No");
        return;
    }
    for i in (0 as usize)..l {
        if i % 2 == 0 && s[i] != 'h' {
            println!("No");
            return;
        } else if i % 2 == 1 && s[i] != 'i' {
            println!("No");
            return;
        }
    }
    println!("Yes");
}


use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let s: Vec<char> = read::<String>().chars().collect();
    let l = s.len();
    for i in (0 as usize)..l {
        if i % 2 == 0 && s[i] != 'h' {
            println!("No");
            return;
        } else if i % 2 == 1 && s[i] != 'i' {
            println!("No");
            return;
        }
    }
    println!("Yes");
}


let message = readLine()!
let check1 = "hi"
let check2 = "hihi"
let check3 = "hihihi"
let check4 = "hihihihi"
let check5 = "hihihihihi"
if message == check1 || message == check2 || message == check3 || message == check4 || message == check5{
  print("Yes")
}else{
  print("No")
}


let S = readLine()!
var T = ""
var ans = "No"
for _ in 0..<S.characters.count/2 {
  T += "hi"
  if S == T {
    ans = "Yes"
    break
  }
}
print(ans)


import Foundation

let n:String=readLine()!

if (n=="hi"||n=="hihi"||n=="hihihi"||n=="hihihihi"||n=="hihihihihi"){
   print("Yes")
}else{
   print("No")
}


let input_line: String = readLine()!

let hitatchistr = "hi"
var s = ""
var exists = false
for i in 0..<5 {
  s += hitatchistr
  if s == input_line {
  	print("YES")
    //return
    exists = true
  }
}

if exists {
	print("NO")
}


let input_line: String = readLine()!

var s = ""
var i = 0
for() {

}


let message = readLine()!
let check1 = "hi"
let check2 = "hihi"
if message == check1 || message == check2{
  print("Yes")
}else{
  print("No")
}


import * as fs from 'fs'
import {debug} from '../../util'

const input = fs.readFileSync('/dev/stdin', 'utf8').trim()

const output = (x: string | number | boolean): void => console.log(x)
const splitLine = (string: string): string[] => string.split('\n')
const splitBlank = (string: string): string[] => string.split(' ')
const toNumbers = (array: string[]): number[] => array.map(v => Number(v))
const range = (end: number, start :number = 0): number[] => [...Array(end - start)].map((v, i) => i + start)

// debug(input)

/* ここから */
const S = input
let hitachi = ''
let flag = false
for (const v of range(5)) {
    hitachi += 'hi'
    if (hitachi === S) {
        flag = true
        break
    }
}
flag ? output('Yes') : output('No')


// AtCoder Beginner Contest 130
// https://atcoder.jp/contests/hitachi2020
import * as fs from "fs";

const stdin = fs.readFileSync("/dev/stdin", "utf8");
const split = stdin.split("\n");
Main(split);

function Main(inputLines: string[]) {
  const input = inputLines[0];
  const tmp = input.replace(/hi/g, "");
  if (tmp.length < 1) {
    console.log("Yes");
    return;
  }
  console.log("No");
}


function Main(input: string) {
  const lines = input.split('\n');
  const length = lines[0].length;
  let result = length != 0;
  let i = 0;
  while (i < length) {
    if (lines[0].charAt(i) !== 'h' || lines[0].charAt(i + 1) !== 'i') {
      result = false;
      break;
    }
    i += 2;
  }
  console.log(result ? 'Yes' : 'No')
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));


import * as fs from 'fs'
import {debug} from '../../util'

const input = fs.readFileSync('/dev/stdin', 'utf8').trim()

const output = (x: string | number | boolean): void => console.log(x)
const splitLine = (string: string): string[] => string.split('\n')
const splitBlank = (string: string): string[] => string.split(' ')
const toNumbers = (array: string[]): number[] => array.map(v => Number(v))
const range = (end: number, start :number = 0): number[] => [...Array(end - start)].map((v, i) => i + start)

// debug(input)

/* ここから */
const S = input
S.match('hi') ? output('Yes') : output('No')


function Main(input: string) {
  const lines = input.split('\n');
  const length = lines[0];
  let result = length != 0;
  let i = 0;
  while (i < length) {
    if (lines[0].charAt(i) !== 'h' || lines[0].charAt(i + 1) !== 'i') {
      result = false;
      break;
    }
    i += 2;
  }
  console.log(result ? 'Yes' : 'No')
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));


function Main(input: string) {
  const length = input.length;
  let result = length != 0;
  let i = 0;
  while (i < length) {
    if (input.charAt(i) !== 'h' || input.charAt(i + 1) !== 'i') {
      result = false;
      break;
    }
    i += 2;
  }
  console.log(result ? 'Yes' : 'No')
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));


a,b,c,d = map(int,input().split())
if a+b>c+d:
  print('Left')
elif a+b<c+d:
  print('Right')
else:
  print('Balanced')


a, b, c, d = map(int, input().split())

if a+b > c+d:
    print('Left')
elif a+b < c+d:
    print('Right')
else:
    print('Balanced')


a, b, c, d = list(map(int, input().split()))

if (a+b) < (c+d):
    print ('Right')
elif (a+b) > (c+d):
    print ('Left')
else:
    print ('Balanced')


A, B, C, D = map(int,input().split())
if A + B < C + D:
  print("Left")
elif A + B == C + D:
  print("Balanced")
else:
  print("Right")


a = list(map(int, input().split()))
a = a[0] + a[1] - a[2] - a[3]
if a < 0:
    print('Left')
elif a > 0:
    print('Right')
else:
    print('Balanced')


a,b,c,d=map(int,input().split())

l=a+b;r=c+d

if l-r<0:
  print('right')

elif l>r:
  print('Left')

else:
  print('Balanced')


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

class Main
{
	public static void main(String[] args) throws Exception
	{
		invoke(System.in);
//		invoke(new FileInputStream("/tmp/test.txt"));
	}

	public static void	invoke(InputStream is) throws IOException
	{
		// input
		BufferedReader	reader = new BufferedReader(new InputStreamReader(is));
		String	line = reader.readLine();

		String[]	va = line.split(" ");
		int	lsum = Integer.parseInt(va[0]) + Integer.parseInt(va[1]);
		int	rsum = Integer.parseInt(va[2]) + Integer.parseInt(va[3]);

		String	result;
		result =  ((lsum > rsum) ? "Left" : (lsum == rsum) ? "Balanced" : "Right");
		System.out.println(result);

	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.Set;
import java.util.StringTokenizer;

public class Main {
	private static final int MOD = (int)Math.pow(10, 9);
	public static void main(String[] args) {
		FastReader sc = new FastReader();
		int a = sc.nextInt();
      	int b = sc.nextInt();
      	int c = sc.nextInt();
      	int d = sc.nextInt();

      	String res = "No";

      	if (a + b == c + d) {
      		res = "Balanced";
      	} else if (a + b > c + d) {
      		res = "Left";
      	} else {
      		res = "Right";
      	}

        System.out.println(res);

	}

	static class FastReader {
	    BufferedReader br;
	    StringTokenizer st;

	    public FastReader() {
	      br = new BufferedReader(new InputStreamReader(System.in));
	    }

	    String next() {
	      while (st == null || !st.hasMoreElements()) {
	        try {
	          st = new StringTokenizer(br.readLine());
	        } catch (IOException  e) {
	          e.printStackTrace();
	        }
	      }
	      return st.nextToken();
	    }

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

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

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

	    String nextLine() {
	      String str = "";
	        try{
	            str = br.readLine();
	        } catch (IOException e) {
	            e.printStackTrace();
	        }
	        return str;
	      }
	  }
}


import java.io.*;
import java.util.*;
class Main {
	public static void main(String[] args) throws IOException{
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		//BufferedReader in = new BufferedReader(new FileReader("prob.in"));

		PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
		//PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("prob.out")));

		StringTokenizer st = new StringTokenizer(in.readLine());

		int a = Integer.parseInt(st.nextToken());
		int b = Integer.parseInt(st.nextToken());
		int c = Integer.parseInt(st.nextToken());
		int d = Integer.parseInt(st.nextToken());

		int e = a + b;
		int f = c + d;

		if(e == f){
			out.println("Balanced");
		}
		else if(e < f){
			out.println("Right");
		}
		else{
			out.println("Left");
		}

		in.close();
		out.close();

	}
}


import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int d = sc.nextInt();
		int left = a + b;
		int right = c + d;

		if (left < right) {
			System.out.println("Left");
		} else if (left > right) {
			System.out.println("Right");
		} else {
			System.out.println("Balanced");
		}

		sc.close();

	}

}


package com.codeCp;

import java.util.*;
import java.io.*;

public class Main {
    static class FastScanner {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer("");

        String next() {
            while (!st.hasMoreTokens())
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            return st.nextToken();
        }

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

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

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

    public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        int x = sc.nextInt(), y = sc.nextInt(), z = sc.nextInt(), z1 = sc.nextInt();
        if (x + y > z + z1) {
            System.out.println("Left");
        } else if (x + y == z + z1) {
            System.out.println("Balanced");
        } else {
            System.out.println("Right");
        }
    }
}


import java.util.*;
import java.io.*;
import java.lang.*;

public class ABC083A {
	public static void main (String[] args) {
		Scanner sc = new Scanner (System.in);
		int a = sc.nextInt();
		a+=sc.nextInt();
		int b = sc.nextInt();
		b+=sc.nextInt();
		sc.close();

		if (a != b) {
			System.out.println(a>b ? "Left" : "Right");
		} else {
			System.out.println("Balanced");
		}
	}
}
import java.util.*;
import java.io.*;
import java.lang.*;

public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner (System.in);
		int a = sc.nextInt();
		a+=sc.nextInt();
		int b = sc.nextInt();
		b+=sc.nextInt();
		sc.close();

		if (a != b) {
			System.out.println(a>b ? "Left" : "Right");
		} else {
			System.out.println("Balanced");
		}
	}
}


#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
int t,n,m;
int a,b,c,d;
int main(){
	int i,j;
	scanf("%d%d%d%d",&a,&b,&c,&d);
	if(a+b>c+d)
		printf("Left\n");
	else if(a+b==c+d)
		printf("Balanced\n");
	else
		printf("Right\n");
	return 0;
}


#include <stdio.h>
int main (){
int a ,b,c,d;
scanf ("%d%d%d%d",&a,&b,&c,&d);

if (a+ b > c +d )
    printf("Left\n");

else
   if (a+ b < c +d )
    printf("Right\n");

else if (a+ b == c +d )
    printf("Balanced\n");

return 0;
}


#include<stdio.h>
#include<math.h>
int main()
{
	int A,B,C,D,x,y;
	while(scanf("%d%d%d%d",&A,&B,&C,&D)!=EOF)
	{
		x=A+B;y=C+D;
		if(x==y)
		{
			printf("Balanced\n");
		}
		else{
			if(x>y)
			{
				printf("Left\n");
			}
			else{
				printf("Right\n");
			}
		}
	}
	return 0;
 }


#include<bits/stdc++.h>

#define Vsort(a) sort(a.begin(), a.end())
#define Vreverse(a) reverse(a.begin(), a.end())
#define Srep(n) for(int i = 0; i < (n); i++)
#define Lrep(i,a,n) for(int i = (a); i < (n); i++)
#define Brep(n) for(int bit = 0; bit < (1<<n); bit++)
#define rep2nd(n,m) Srep(n) Lrep(j,0,m)
#define vi vector<int>
#define vi64 vector<int64_t>
#define vvi vector<vector<int>>
#define vvi64 vector<vector<int64_t>>

using namespace std;

int main(){
  int a,b,c,d;
  cin >> a >> b >> c >> d;
  cout << (a + b == c + d ? "Balance" : a + b > c + d ? "Left" : "Right") << endl;
}


#include <bits/stdc++.h>

using namespace std;

int main() {

  int A, B,C,D;

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

int left =A+B;
int right=C+D;

if (lert>right) {

cout << "Left" << endl;

  }

  else if(left<right){

    // ここにプログラムを追記

    cout<<"Right"<<endl;
  }

  else if(left==right){
    cout<<"Balanced"<<endl;
    }

  }


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

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

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

}


#include <stdio.h>

int main()
{
	int a,b,c,d;
	int left = 0,right = 0;

	scanf(" %d %d %d %d",&a,&b,&c,&d);
	left = a + b;
	right = c + d;
	if(left<right){
	printf("Right");
	}
	if(right<left){
		printf("Left");
	}
	if(left == right){
	printf("Balanced");
	}
	return 0;
}


#include <stdio.h>

int main(void) {

	int a = 0, b = 0, c = 0, d = 0;

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

	if ((a + b) < (c + d)) {
		printf("Right\n");
	}
	else if ((a + b) > (c + d)) {
		printf("Left\n");
	}
	else
		printf("Balanced\n");

	return 0;
}


#include <stdio.h>
int main(void){
    int a, b, c, d;
    int sum1=0, sum2=0;

    scanf("%d", &a);
    scanf("%d", &b);
    sum1 = a + b;

    scanf("%d", &c);
    scanf("%d", &d);
    sum2 = c + d;

    if(sum1 > sum2){
        printf("Left\n");
    }else if(sum2 > sum1){
        printf("Right\n");
    }else{
        printf("Balanced\n");
    }

    return 0;
}


#include <stdio.h>

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

	scanf("%d %d %d %d",&A,&B,&C,&D);

	if (A+B>C+D)
	{
	printf("Left");

	}
	if else (A+B<C+D)
	{
	printf("Right");

	}
	if else(A+B==C+D)
	{
	printf("Balanced");

	}

	return 0;
}


#include<stdio.h>
int main()
{
    int A,B,C,D;
    scanf("%d %d %d %d",&A,&B,&C,&D);
    if(A+B>C+D) {
        printf("Left");
    }
    else if(A+B=C+D) {
        printf("Balanced");
    }
    else {
        printf("Right");
    }
    return 0;
}


#include<stdio.h>
int main()
{
    int A,B,C,D;
    scanf("%d%d%d%d",&A,&B,&C,&D);
    if(A+B>C+D) {
        printf("Left\n");
    }
    else if(A+B=C+D) {
        printf("Balanced\n");
    }
    else {
    printf("Right\n");
    }
    return 0;
}


function main(input) {
    var a = input[0].split(" ")[0]-0;
    var b = input[0].split(" ")[1]-0;
    var c = input[0].split(" ")[2]-0;
    var d = input[0].split(" ")[3]-0;
  var l = a+b;
  var r = c+d;

    console.log(l==r?"Balanced":(l>r?"Left":"Right"));

}
main(require('fs').readFileSync('/dev/stdin', 'utf8').trim().split("\n"))


const input = require("fs").readFileSync("/dev/stdin", "utf8").split(/\s/);
const a = input[0] - 0;
const b = input[1] - 0;
const c = input[2] - 0;
const d = input[3] - 0;

if (a + b < c + d) {
  console.log("Right");
} else if (a + b > c + d) {
  console.log("Left");
} else {
  console.log("Balanced");
}


'use strict'

function main(input) {

    input = input.split(/\n|\s/).map(v => ~~v)
    const sum = input[0] + input[1] - (input[2] + input[3])

    let ans = 'Balanced'

    if (sum > 0) {
        ans = 'Left'
    } else if (sum < 0) {
        ans = 'Right'
    }
    console.log(ans)

}
main(require("fs").readFileSync("/dev/stdin", "utf8"));


function main(input) {
    const args = input.split(' ');
    const N = parseInt(args[0], 10),
          A = parseInt(args[1], 10),
          B = parseInt(args[2], 10);

    const nums = Array.from(new Array(N), (v, i) => ++i).filter((i) => {
        var n = i.toString().split('').reduce((p, c) => p + parseInt(c), 0);
        return (n >= A && n <= B);
    });

    console.log(nums.reduce((p, c) => p + c, 0));
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));


function Main(input){
	input = input.split(" ");
  	if(input[0] + input[1] > input[2] + input[3]) {
    	console.log('Left')
    } else if(input[0] + input[1] < input[2] + input[3]) {
      	console.log('Right')
    } else {
      	console.log('Balanced')
    }
}
Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());


const inputText = require("fs")
  .readFileSync("/dev/stdin", "utf8")
  .trim()
  .split("")
  .map((i) => parseInt(i, 10));

const left = inputText[0] + inputText[1];
const right = inputText[2] + inputText[3];

if (left < right) {
  console.log("Right");
} else if (left > right) {
  console.log("Left");
} else {
  console.log("Balanced");
}


package main

import "fmt"

func main() {
	var a, b, c, d int
	fmt.Scan(&a, &b, &c, &d)

	if l, r := a+b, c+d; l > r {
		fmt.Println("Left")
	} else if l < r {
		fmt.Println("Right")
	} else {
		fmt.Println("Balanced")
	}
}


package main

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

func main() {
	solve(os.Stdin, os.Stdout)
}

func solve(in io.Reader, out io.Writer) {
	bs := NewBufScanner(in)
	bw := NewBufWriter(out)
	defer bw.w.Flush()

	left := bs.IntScan() + bs.IntScan()
	right := bs.IntScan() + bs.IntScan()
	if left == right {
		bw.Printf("Balanced")
	} else if left > right {
		bw.Printf("Left")
	} else {
		bw.Printf("Right")
	}
}

// BufScanner original scanner
type BufScanner struct {
	s *bufio.Scanner
}

// NewBufScanner constructer
func NewBufScanner(in io.Reader) *BufScanner {
	s := bufio.NewScanner(in)
	s.Buffer(make([]byte, 1024), 1e+9)
	s.Split(bufio.ScanWords)
	return &BufScanner{
		s: s,
	}
}

// Scan Scan Data
func (b *BufScanner) Scan() string {
	b.s.Scan()
	return b.s.Text()
}

// IntScan Scan Data
func (b *BufScanner) IntScan() int {
	v, err := strconv.Atoi(b.Scan())
	if err != nil {
		panic(err)
	}
	return v
}

// BufWriter original writer
type BufWriter struct {
	w *bufio.Writer
}

// NewBufWriter constructer
func NewBufWriter(out io.Writer) *BufWriter {
	w := bufio.NewWriter(out)
	return &BufWriter{
		w: w,
	}
}

// Printf Output file
func (b *BufWriter) Printf(format string, a ...interface{}) {
	fmt.Fprintf(b.w, format, a...)
}


package main

import "fmt"

func main() {
	var a, b, c, d int
	fmt.Scan(&a, &b, &c, &d)
	if a+b > c+d {
		fmt.Println("Left")
	} else if a+b < c+d {
		fmt.Println("Right")
	} else {
		fmt.Println("Balanced")
	}
}


package main

import (
	"fmt"
)

func main() {
	var a, b, c, d int
	fmt.Scanf("%d", &a)
	fmt.Scanf("%d", &b)
	left := a + b
	right := c + d
	if left == right {
		fmt.Printf("%s", "Balanced")
	} else if left < right {
		fmt.Printf("%s", "Left")
	} else {
		fmt.Printf("%s", "Right")
	}
}


package main

import (
	"fmt"
)

func main() {
	var a, b, c, d int
	fmt.Scanf("%d", &a)
	fmt.Scanf("%d", &b)
	left := a + b
	right := c + d
	if left == right {
		fmt.Printf("%s", "Balanced")
	} else if left > right {
		fmt.Printf("%s", "Left")
	} else {
		fmt.Printf("%s", "Right")
	}
}


package main

import "fmt"

func findSumOfDigits(n int) int{
	sum := 0
	for n > 0 {
		sum += n % 10
		n /= 10
	}
	return sum
}

func main() {
	var (
		n, a, b, total int
	)
	fmt.Scan(&n, &a, &b)
	for i := 1; i <= n; i++ {
		sum := findSumOfDigits(i)
		if a <= sum && sum <= b {
			total += sum
		}
	}
	fmt.Println(total)
}


a,b,c,d = gets.chomp.split(' ').map(&:to_i)
l = a+b
r = c+d
if (l > r)
  puts 'Left'
elsif(l == r)
  puts 'Balanced'
else
  puts 'Right'
end


#!/usr/bin/env ruby

def main
    a,b,c,d = gets.chomp.split(" ").map(&:to_i)
    if (a+b) > (c+d)
        puts "Left"
    elsif (a+b) == (c+d)
        puts "Balanced"
    else
        puts "Right"
    end
end

main


# abc083 A
a, b, c, d = gets.split.map(&:to_i)
puts a + b == c + d ? 'Balanced' : a + b > c + d ? 'Left' : 'Right'


n, a, b = gets.strip.split.map(&:to_i)

# 各桁の和を求める
def digit_sum n
    sum = 0
    while n > 0 do
        sum += n % 10
        n /= 10
    end
    sum
end

ans = (1..n)
        .map { |i| [i, digit_sum(i)] }
        .select { |d| a <= d[1] && d[1] <= b }
        .inject(0) { |sum, d| sum + d[0] }

puts ans


a,b,c,d = gets.strip.split.map(&:to_i)
if a+b>c+d
  puts "Left"
elsif a+b=c+d
  puts "Balanced"
else
  puts "Right"
end


use std::io;

fn procon_read<T: std::str::FromStr>() ->  Vec<T> {
	let mut buf = String::new();
	io::stdin().read_line(&mut buf).expect("");
	let iter = buf.split_whitespace();
	let mut v: Vec<T> = Vec::new();
	for i in iter {
		v.push(i.parse().ok().unwrap());
	}
	v
}

fn main() {
	let v:Vec<i32> = procon_read();
	let a = v[0];
	let b = v[1];
	let c = v[2];
	let d = v[3];
	if a+b > c+d {
		println!("Left");
	}else if a+b < c+d {
		println!("Right");
	}else{
		println!("Balanced");
	}
}


use std::cmp::Ordering;

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

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

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

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

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

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

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

fn main() {
    input!{
        a: i32, b: i32, c: i32, d: i32
    }
    println!("{}",
    match (a+b).cmp(&(c+d)) {
        Ordering::Greater => "Left",
        Ordering::Equal => "Balanced",
        Ordering::Less => "Right"
    });
}


use std::io::*;
use std::str::FromStr;

pub fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let a: usize = read();
    let b: usize = read();
    let c: usize = read();
    let d: usize = read();

    if a + b > c + d {
        println!("Left");
        return;
    }
    if a + b < c + d {
        println!("Right");
        return;
    }

    println!("Balanced")
}


use std::io::{stdin, Stdin, BufRead};

fn main() {
    let stdin = stdin();
    let args = read(&stdin);
    let args = args.split_whitespace();
    let args = args.into_iter().map(|s| s.parse().unwrap()).collect::<Vec<i32>>();
    let n = args[0];
    let a = args[1];
    let b = args[2];

    let mut numbers = Vec::new();
    for i in a..n+1 {
        let mut sum = 0;
        let mut res = i;
        loop {
            let modulo = res % 10;
            sum += modulo;

            res = (res / 10) as i32;
            if res <= 10 {
                sum += res;
                break;
            }
        }

        if a <= sum && sum <= b {
            numbers.push(i);
        }

    }
    println!("{}", numbers.iter().sum::<i32>());
}

fn read(stdin: &Stdin) -> String {
    let mut buf = String::new();
    stdin.lock().read_line(&mut buf).unwrap();
    buf
}


fn mainfn main() {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    let v : Vec<i32> = s.trim().split_whitespace().map(|e| e.parse().ok().unwrap()).collect();
    let x = v[0] + v[1];
    let y = v[2] + v[3];
    if x > y {
        println!("Left");
    }
    else if x == y {
        println!("Balanced");
    }
    else {
        println!("Right");
    }
}


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

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

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

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

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

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

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

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

#[allow(dead_code)]
fn practice_1() {
    input! {
    n: i32,
    m: [i32; 2],
    s: chars,
    }
    let s: Vec<char> = s;
    let s: String = s.iter().collect();

    println!("{} {}", n + m[0] + m[1], s);
}

#[allow(dead_code)]
fn abc086_a() {
    input! {
    n: [i32; 2],
    }
    let prod: i32 = n[0] * n[1];
    let res = if prod % 2 == 0 {
        "Even"
    } else {
        "Odd"
    };
    println!("{}", res)
}

#[allow(dead_code)]
fn abc081_a() {
    input! {
    s: chars,
    }
    let s: Vec<char> = s;
    let res: u32 = s.iter().map(|n| n.to_digit(10).unwrap()).sum();

    println!("{}", res)
}

#[allow(dead_code)]
fn abc081_b() {
    input! {
    n: i32,
    arr: [i32; n],
    }
    let mut arr: Vec<i32> = arr;
    let mut cnt = 0;

    loop {
        if arr.iter().any(|v| (v % 2) == 1) {
            break;
        }
        arr = arr.iter().map(|v| v / 2).collect();
        cnt += 1;
    }

    println!("{}", cnt)
}

#[allow(dead_code)]
fn abc083_b() {
    input! {
    arr: [i32; 3],
    }

    let n: i32 = arr[0];
    let a: i32 = arr[1];
    let b: i32 = arr[2];

    let mut res = 0;

    (0..n + 1)
        .map(|i| {
            let d0 = i - (i / 10) * 10;
            let d1 = (i / 10) - (i / 100) * 10;
            let d2 = (i / 100) - (i / 1000) * 10;
            let d3 = (i / 1000) - (i / 10000) * 10;
            let d4 = (i / 10000) - (i / 100000) * 10;
            (i, d0 + d1 + d2 + d3 + d4)
        })
        .filter(|(_, total)| {
            (a <= *total) && (*total <= b)
        })
        .for_each(|(i, _)| {
            res += i;
        });

    println!("{:?}", res)
}

#[allow(dead_code)]
fn abc087_b() {
    input! {
    n_500: i32,
    n_100: i32,
    n_50: i32,
    total: i32,
    }

    let n_500: i32 = n_500;
    let n_100: i32 = n_100;
    let n_50: i32 = n_50;
    let total: i32 = total;
    let mut cnt = 0;

    for i in 0..n_500 + 1 {
        for j in 0..n_100 + 1 {
            for k in 0..n_50 + 1 {
                let total_tried = i * 500 + j * 100 + k * 50;
                if total_tried == total {
//                    println!("{}, {}, {}", i, j, k);
                    cnt += 1;
                }
            }
        }
    }

    println!("{}", cnt)
}

fn main() {
    abc083_b()
}


var i=readLine()!.characters.split(" ").map{Int(String($0))!},s="Balanced";if i[0]+i[1]>i[2]+i[3]{s="Left"};if i[0]+i[1]<i[2]+i[3]{s="Right"};print(s)


import Glibc
extension String: CollectionType {}

var inp = readLine()!.split(" ").map { Int($0)! }
if inp[0] + inp[1] < inp[2] + inp[3] {
  print("Right")
} else if inp[0] + inp[1] > inp[2] + inp[3] {
  print("Left")
} else {
  print("Balanced")
}


import Foundation

if let str = readLine() {
    let arr = str.split(separator: " ").map { Int($0)!}
    switch arr[0] + arr[1] - arr[3] - arr[4] {
    case 0:
        print("Balanced")
    case 1...:
        print("Left")
    default:
        print("right")
    }
}


import Foundation

var line: String

line = readLine()!

var nums: [Int] = Array<Int>()
for num in line.components(separatedBy:" ") {
	nums.append(Int(num)!)
}

if nums[0] + nums[1] < nums[2] + nums[3] {
	print("Right")
}else if nums[0] + nums[1] > nums[2] + nums[3] {
	print("Left")
}else{
	print("Balanced")
}


var line: String

line = readLine()!

var nums: [Int] = Array<Int>()
for num in line.components(separatedBy:" ") {
	nums.append(Int(num)!)
}

if nums[0] + nums[1] < nums[2] + nums[3] {
	print("Right")
}else if nums[0] + nums[1] > nums[2] + nums[3] {
	print("Left")
}else{
	print("Balanced")
}


const main = (input) => {
  input = input.split(' ');
  const A = parseInt(input[0], 10);
  const B = parseInt(input[1], 10);
  const C = parseInt(input[2], 10);
  const D = parseInt(input[3], 10);

  if (A+B>C+D) {
    console.log("Left");
  }else if(A+B==C+D) {
    console.log("Balanced");
  }else{
    console.log("Right");
  }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


const stdin = require('fs').readFileSync('/dev/stdin', 'utf8')

const [a, b, c, d] = stdin.split('\n')[0].split(' ').map(Number)

const res = x => {
  const l = a + b
  const r = c + d

  if(l === r){
    return 'Balanced'
  } else if ( l < r){
    return 'Right'
  } else {
    return 'Left'
  }
}

console.log(res())


const input=require('fs').readFileSync('/dev/stdin', 'utf8').split(/[\s]/);const nin=()=>{const r = input[0];input.shift();return Number(r)};const nrin=(n)=>{const a:number[]=[];rep(n,()=>a.push(nin()));return a};const sin=()=>{const r = input[0];input.shift();return String(r)};const out=(...a)=>{console.log(...a)};const floor=(a)=>{return Math.floor(a)};const abs=(a)=>{return Math.abs(a)};const min=(...a)=>{return Math.min(...a)};const max=(...a)=>{return Math.max(...a)};const rep=(n, callback)=>{for(let i = 0;i < n; i++){callback()}};const strrep=(s, i, v)=>{return s.slice(0, i)+v+s.slice(i+1);};const permutation=({result=[],pre=[],post,n=post.length})=>{if(n>0){post.forEach((_,i)=>{const rest=[...post];const elem=rest.splice(i, 1);permutation({result, pre: [...pre,...elem],post:rest,n:n-1})})}else{result.push(pre)}return result};const sw=(s,a:any[],op:'=='|'>='|'>'|'<='|'<'='==')=>{for(let i=0;i<a.length;i+=2){if(op==='=='){if(s==a[i])return a[i+1]}else if(op==='>='){if(s>=a[i])return a[i+1]}else if(op==='<='){if(s<=a[i])return a[i+1]}else if(op==='>'){if(s>a[i])return a[i+1]}else if(op==='<'){if(s<a[i])return a[i+1]}}return a[a.length-1];};const or=(a,...b)=>{for(let i=0;i<b.length;i++)if(a==b[i])return true;return false};const maxindex=(...a)=>{return a.indexOf(Math.max.apply(null,a))};const asc=(ar:number[])=>{return ar.sort((a,b)=>{return a-b})};const desc=(ar:number[])=>{return ar.sort((a,b)=>{return b-a})};const ceil=a=>{return Math.ceil(a)};const srin=s=>{const a:string[]=[];rep(s,()=>a.push(sin()));return a};let ssinteger=-1;const ssin=()=>{ssinteger++;return input[0][ssinteger]};
const main = ()=>{
  let [a,b,c,d]=nrin(4)
  out(a+b==c+d?'Balanced':a+b>c+d?'Left':'Right')
}
main()


const lines = [];
const reader = require("readline").createInterface({
  input: process.stdin,
  output: process.stdout,
});
reader.on("line", function (line) {
  lines.push(line);
});

reader.on("close", function () {
  const input = (lines[0] as string).split(" ");
  const maximum = input[0];
  const min = Number(input[1]);
  const max = Number(input[2]);

  console.log(sum(maximum, min, max));
});

function sum(maximum: string, min: number, max: number): number {
  let sum = 0;

  for (let i = 1; i <= Number(maximum); i++) {
    const iSum = digitSum(i);
    if (iSum >= min && iSum <= max) {
      sum = sum + i;
    }
  }

  return sum;
}

function digitSum(number): number {
  const numberArray: number[] = [];
  for (let i = 0; i < String(number).length; i++) {
    numberArray.push(+String(number).charAt(i));
  }
  return numberArray.reduce((accumulator, element) => {
    return accumulator + Number(element);
  });
}


s=require('fs').readFileSync('/dev/stdin','utf8').split(' ').map(n=>n|0)
for(c=0,i=0;++i<=s[0];s[1]<=a&&a<=s[2]&&(c+=i))
	a=(i+'').split('').map(n=>n|0).reduce((a,b)=>a+b)
console.log(c)


N,L = map(int,input().split())
inf = float('inf')
eat = inf
ans = 0
for i in range(N):
    eat = min(eat, abs(L+i))
if L > 0:
    s = eat - L + 1
else:
    s = abs(eat + L -1)

for i in range(1,N+1):
    if s == i:
        continue
    ans += L + i -1
print(ans)


N, L = map(int, input().split())
a = [L + i for i in range(N)]
b = list(map(lambda x:abs(x), a))
c = b.index(min(b))
del a[c]
print(sum(j for j in a))


N, L = map(int, input().split())

res = []
for i in range(N):
    res.append(L + (i + 1) - 1)

m = res[0]
for r in res:
    if abs(r) < abs(m):
        m = r
res.remove(m)

print(sum(res))


a,b=map(int,input().split())
if b>=0:
  print(int((a+2*b)*(a-1)/2))
elif a+b>=0:
  print(int((a+2*b-1)*a/2))
else:
  print(int((a+2*b-2)*(a-1)/2))


a,b=map(int,input().split())
if b>=0:
  print(int((a+2*b)*(a-1)/2))
elif a+b>=0:
  print(int((a+b-2)*a/2))
else:
  print(int((a+2*b-2)*(a-1)/2))


n,l = map(int,input().split())
ans = l
k = 0
sum = 0
for i in range(1,n):
    if abs(ans) > abs(l + i):
        k = i
for i in range(n):
    if i != k:
        sum += l + i
print(sum)


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split(" ");
    int n = Integer.parseInt(str[0]);
    int l = Integer.parseInt(str[1]);
    int ans = 0;
    int min = Integer.MAX_VALUE;
    for(int i=1; i<=n; i++) {
      ans += l+i-1;
      if(Math.abs(l+i-1)<Math.abs(min)) {
        min = l+i-1;
      }
    }
    System.out.println(ans-min);
  }
}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] in = br.readLine().split(" ");
        int n = Integer.parseInt(in[0]);
        int l = Integer.parseInt(in[1]);

        int[] taste = new int[n];
        int sum = 0;
        int min = 1000000000;
        int ans = -1;
        for(int i = 0; i < n; i++) {
            taste[i] = l + i;
            sum += taste[i];
        }

        for(int i = 0; i < n; i++) {
            int tmp = Math.abs(taste[i]);
            if(tmp < min) {
                min = tmp;
                ans = i;
            }
        }

        System.out.println(sum - taste[ans]);
    }
}


import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.util.NoSuchElementException;

public class Main {

    static PrintWriter out;
    static InputReader sc;

    static void solve() {
        int N = sc.nextInt();
        int L = sc.nextInt();
        int[] t = new int[N];
        int pie = 0;
        for (int i = 0; i < N; i++) {
            t[i] = L + i;
            pie += t[i];
        }
        int idx = 0;
        int min = Integer.MAX_VALUE / 4;
        for (int i = 0; i < N; i++) {
            if (Math.abs(t[i]) < min) {
                idx = i;
                min = Math.abs(t[i]);
            }
        }
        out.println(pie - t[idx]);
    }

    public static void main(String[] args) {
        sc = new InputReader(System.in);
        out = new PrintWriter(System.out);
        solve();
        out.flush();
    }

    public static class ArraysFillEx {

        public static void fill(Object array, Object value) {

            // 第一引数が配列か判定
            Class<?> type = array.getClass();
            if (!type.isArray()) {
                throw new IllegalArgumentException("not array");
            }

            // クラスの型を判定
            String arrayClassName = array.getClass().getSimpleName().replace("[]", "").toLowerCase();
            String valueClassName = value.getClass().getSimpleName().toLowerCase().replace("character", "char")
                    .replace("integer", "int");
            if (!arrayClassName.equals(valueClassName)) {
                throw new IllegalArgumentException("does not match");
            }

            // 処理
            if (type.getComponentType().isArray()) {
                for (Object o : (Object[]) array) {
                    fill(o, value);
                }
            } else if (array instanceof boolean[]) {
                Arrays.fill((boolean[]) array, (boolean) value);
            } else if (array instanceof char[]) {
                Arrays.fill((char[]) array, (char) value);
            } else if (array instanceof byte[]) {
                Arrays.fill((byte[]) array, (byte) value);
            } else if (array instanceof short[]) {
                Arrays.fill((short[]) array, (short) value);
            } else if (array instanceof int[]) {
                Arrays.fill((int[]) array, (int) value);
            } else if (array instanceof long[]) {
                Arrays.fill((long[]) array, (long) value);
            } else if (array instanceof float[]) {
                Arrays.fill((float[]) array, (float) value);
            } else if (array instanceof double[]) {
                Arrays.fill((double[]) array, (double) value);
            } else {
                Arrays.fill((Object[]) array, value);
            }
        }

    }

    static class InputReader {

        private InputStream in;
        private byte[] buffer = new byte[1024];
        private int curbuf;
        private int lenbuf;

        public InputReader(InputStream in) {
            this.in = in;
            this.curbuf = this.lenbuf = 0;
        }

        public boolean hasNextByte() {
            if (this.curbuf >= this.lenbuf) {
                this.curbuf = 0;
                try {
                    this.lenbuf = this.in.read(this.buffer);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (this.lenbuf <= 0) {
                    return false;
                }
            }
            return true;
        }

        private int readByte() {
            if (this.hasNextByte()) {
                return this.buffer[this.curbuf++];
            } else {
                return -1;
            }
        }

        private boolean isSpaceChar(int c) {
            return !(c >= 33 && c <= 126);
        }

        private void skip() {
            while (this.hasNextByte() && this.isSpaceChar(this.buffer[this.curbuf])) {
                this.curbuf++;
            }
        }

        public boolean hasNext() {
            this.skip();
            return this.hasNextByte();
        }

        public String next() {
            if (!this.hasNext()) {
                throw new NoSuchElementException();
            }
            StringBuilder sb = new StringBuilder();
            int b = this.readByte();
            while (!this.isSpaceChar(b)) {
                sb.appendCodePoint(b);
                b = this.readByte();
            }
            return sb.toString();
        }

        public int nextInt() {
            if (!this.hasNext()) {
                throw new NoSuchElementException();
            }
            int c = this.readByte();
            while (this.isSpaceChar(c)) {
                c = this.readByte();
            }
            boolean minus = false;
            if (c == '-') {
                minus = true;
                c = this.readByte();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res = res * 10 + c - '0';
                c = this.readByte();
            } while (!this.isSpaceChar(c));
            return minus ? -res : res;
        }

        public long nextLong() {
            if (!this.hasNext()) {
                throw new NoSuchElementException();
            }
            int c = this.readByte();
            while (this.isSpaceChar(c)) {
                c = this.readByte();
            }
            boolean minus = false;
            if (c == '-') {
                minus = true;
                c = this.readByte();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res = res * 10 + c - '0';
                c = this.readByte();
            } while (!this.isSpaceChar(c));
            return minus ? -res : res;
        }

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

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

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

        public char[][] nextCharMap(int n, int m) {
            char[][] map = new char[n][m];
            for (int i = 0; i < n; i++) {
                map[i] = this.next().toCharArray();
            }
            return map;
        }
    }

    static void tr(Object... o) {
        out.println(Arrays.deepToString(o));
    }
}


import java.util.*;

public class Main {
	public static void main(String[] args) throws Exception{
		Scanner scn = new Scanner(System.in);
		int n = scn.nextInt();
      	int l = scn.nextInt();
		int[] a = new int[n+1];
      	a[0] = 0;
		for(int i=1; i<=n; i++){
			a[i] = l + i -1;
		}
      	int sum = 0;
      	for(int i=1; i<=n; i++){
          sum += a[i];
        }
      	int low = Math.abs(a[1]);
      	int num = 0;
      	int eat = 0;
      	for(int i=1; i<=n; i++){
          num = Math.abs(a[i]);
          if(low>num){
            low = num;
            eat = a[i];
          }
        }
      	System.out.println(sum-eat);
	}
}


import java.util.*;

public class Main {
	public static void main(String[] args) throws Exception{
		Scanner scn = new Scanner(System.in);
		int n = scn.nextInt();
      	int l = scn.nextInt();
		int[] a = new int[n+1];
      	a[0] = 0;
		for(int i=1; i<=n; i++){
			a[i] = l + i -1;
		}
      	int sum = 0;
      	for(int i=1; i<=n; i++){
          sum += a[i];
        }
      	int low = Math.abs(a[1]);
      	int num = 0;
      	int eat = 0;
      	for(int i=1; i<=n; i++){
          num = Math.abs(a[i]);
          if(low>num){
            low = num;
            eat = a[i]
          }
        }
      	System.out.println(sum-eat);
	}
}


import java.util.*;

public class Main {
	public static void main(String[] args) throws Exception{
		Scanner scn = new Scanner(System.in);
		int n = scn.nextInt();
      	int l = scn.nextInt();
		int[] a = new int[n+1];
      	a[0] = 0;
		for(int i=1; i<=n; i++){
			a[i] = l + i -1;
		}
      	int sum = 0;
      	for(int i=1; i<=n; i++){
          sum += a[i];
        }
      	int low = Math.abs(a[1]);
      	int num = 0;
      	for(int i=1; i<=n; i++){
          num = Math.abs(a[i]);
          if(low>num) low = num;
        }
      	System.out.println(sum-low);
	}
}


#include <stdio.h>
#include <stdlib.h>
#include <algorithm>

using namespace std;

int main(int argc, char *argv[]) {
  // read inputs
  int N, L;
  scanf("%d %d", &N, &L);

  // solve
  int closest_to_zero = L, total = 0;
  for (int i = 0; i < N; i++) {
    const int k = L + i;
    total += k;
    if (abs(k) < abs(closest_to_zero)) {
      closest_to_zero = k;
    }
  }
  printf("%d\n", total - closest_to_zero);

  return 0;
}


#include<cstdio>
#include<cmath>
using namespace std;
int a[200];
int main()
{
	int n,l;int sum=0;
	int check=9999,ans;
	scanf("%d%d",&n,&l);
	for(int i=1;i<=n;i++)
	{
		a[i]=l+i-1;
	//	printf("%d\n",a[i]);
		if(a[i]==0) check=1;
		sum+=a[i];
	}
	for(int i=1;i<=n;i++)
	{
		if(abs(a[i])<=check) check=abs(a[i]),ans=a[i];
	}
	printf("%d",sum-ans);
	return 0;
}


#include<stdio.h>
#include<stdlib.h>

int main()
{
	int n,l,z,t,y;
	scanf("%d %d",&n,&l);
	t=(n)*(l-1)+n*(n+1)*0.5;
	if(l>0) printf("%d\n",t-l);
	else
	{
		z=10000;
		for(int i=0;i<n;i++)
		{
			y=l+i;
			if(abs(y)<abs(z))
			z=y;
		}
		printf("%d\n",t-z);
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#include <math.h>
#include <iomanip>
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const int INF=1e9;
const int mod = 1000000007;

int main(){
  int N,L;
  cin>>N>>L;
  int MIN=INF,sum=0;
  int x=0;
  for(int i=1;i<=N;i++){
    sum+=L+i-1;
    if(MIN>abs(L+i-1)){x=L+i-1;}
  }
  cout<<sum-x<<endl;
  return 0;
}


#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
#define sz(x) int(x.size())
using namespace std;
typedef long long ll;
const int inf = 100100100;

int main(){
  int n,l;
  cin >> n >> l;

  int tot = (l-1)*n+n*(n+1)/2;
  int cnt = 1;

  int mn = inf;
  for(int i = 1; i <=n; i++){
    if(mn >= abs(l+i-1))){
      mn = abs(l+i-1);
      cnt = i;
    }
  }
  cout << tot - (l+cnt-1) << endl;

}


#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
#define sz(x) int(x.size())
using namespace std;
typedef long long ll;
const int inf = 100100100;

int main(){
  int n,l;
  cin >> n >> l;

  int tot = (l-1)*n+n*(n+1)/2;
  int cnt = 1;

  int mn = inf;
  for(int i = 1; i <=n; i++){
    if(mn >= abs(tot+(l+i-1))){
      mn = abs(tot+(l+i-1));
      cnt = i;
    }
  }
  cout << tot - (l+cnt-1) << endl;

}


#include <stdio.h>

int main(void)
{
        int n,l,s,i;

        scanf("%d%d",&n,&l);

        int d[n],e[n];

        for(i=0;i<n;i++){
                d[i]=l+i;
        }

        s=0;
        for(i=0;i<n;i++)
                s+=d[i];
        if(l+n-1>0){
               if(l<=0) printf("%d\n",s);
               else printf("%d\n",s-d[0]);
        }
        else printf("%d\n",s-d[n-1]);
        return 0;
}


#include<stdio.h>

int main(void)
{
  int n;
  int l;
  int a;

  scanf("%d %d",&n,&l);

  if(l>=0)
    a=l;
  else
  {
    if(n+l-1>=0)
      a=0;
    else
      a=n+l-1;
  }
  printf("%d",n*l+n*(n-1)/2-a);

  return 0;

}


#include <stdio.h>

int main(void) {
  int N,L;

  scanf("%d",&N); scanf("%d",&L);

 if(L>=0)
  printf("%d",(N-1)*(2*L+N)/2);
else if(L+N>=2)
  printf("%d",N*(2*L+N-1)/2);
else
  printf("%d",(N-1)*(2*L+N-2)/2);
  return 0;
}


#include <stdio.h>

int main(){
  int N,L,S=0;
  scanf("%d %d",&N,&L);
  S=N*L+(N*(N-1))/2;
  if(L>=0) S-=L;
  else if(N<-L) S-=L+(N-1);
  printf("%d\n",S);
  return 0;
}


#include <stdio.h>
#include <stdlib.h>

int main(void)
{
	int n, l, i, sum = 0;
	int min;
	scanf("%d %d", &n, &l);

	//味の合計値と、おいしさの絶対値が最小になるときの値を求める
	min = l;
	for (i = 1; i <= n; i++) {
		sum += l + i - 1;//味の合計

		if (min >= abs(l + i - 1)) {//おいしさの絶対値が最小になるときの値を求める
			min = abs(l + i - 1);
		}
	}

	printf("%d\n", sum - min);

	return 0;
}


#include<stdio.h>

int main(void)
{
  //N,Lを入力
  int N,L;
  scanf("%d%d",&N,&L);

  //りんごの味を配列にする
  int i,app[N];
  for(i=0;i<N;i++)
    app[i]=L+i;

  //味の絶対値が最も小さいりんごを求め>る
  int tmp,bite=300,bitenum;
  for(i=0;i<N;i++){
    tmp = app[i];
    if(tmp<0)
      tmp = -tmp;
    if(tmp<bite){
      bite = tmp;
      bitenum = i;
    }
  }

  //debug
  for(i=0;i<N;i++)
    printf("app[%d]=%d\n",i,app[i]);
  printf("bite=%d\n",bite);

  //パイの味を求める
  int pie=0;
  for(i=0;i<N;i++)
    pie += app[i];
  pie -= app[bitenum];

  //出力して終了
  printf("%d\n",pie);
  return 0;
}


// inputに入力データ全体が入る
function Main(input) {
	// 1行目がinput[0], 2行目がinput[1], …に入る
  input = input.split(" ");
  var appleNum = Number(input[0]) - 1;
  var azi = Number(input[1]);
  var result = 0;
  var abs = azi;

  for(var i = 0; i <= appleNum ; i++){
    result = result +  (azi + i);
    if(Math.abs(abs) > Math.abs(azi + i)){
      abs = (azi + i);
    }
  }
  console.log(result - abs);
 }
 //*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
 Main(require("fs").readFileSync("/dev/stdin", "utf8"));


// inputに入力データ全体が入る
function Main(input) {
    input = input.split(" ");
    var N = parseInt(input[0],10);
    var L = parseInt(input[1],10);
    var aziSouwa = [];
    for(var i = 1; i < N+1; i++){
        aziSouwa.push(L + i - 1);
    }
    var value = 0;
    var diff = [];
    var index = 0;

    aziSouwa.forEach(function(val,i){
    diff[i] = Math.abs(value - val);
    index = (diff[index] < diff[i]) ? index : i;
    });
    aziSouwa.splice(index,1);
    var souwa = aziSouwa.reduce(function(total, data){return total + data});
    console.log(souwa);
};
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


function main(input) {
  const lines = input.split('\n');
  lines.forEach(line => {
    if (line.length === 0) {
      return;
    }
    const vs = line.split(' ');
    console.log(flow(parseInt(vs[0], 10), parseInt(vs[1], 10)));
  });
}

function flow(length, start) {
  var result = 0;
  var minimum = null;
  for(var i = 1; i <= length; i++) {
    var current = start+i-1;
    if (minimum === null) {
      minimum = current;
    }
    if (Math.abs(minimum) > Math.abs(current)) {
      minimum = current;
    }
    result += start+i-1;
  }
  if (minimum === null) {
    minimum = 0;
  }
  return result - minimum;
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));


"use strict"
const create = () => {
    const input = require("fs").readFileSync("/dev/stdin", "utf8").trim().split("\n");
    const res = {
        "list": input, "index": 0, "max": input.length,
        "hasNext": function() {return this.index < this.max},
        "next": function() { if (!this.hasNext()) {throw "ArrayIndexOutOfBoundsException";}else{return this.list[this.index++];}}
    };
    return res;
}
const o = create();
const next = () => o.next()
const nextInt = () => parseInt(o.next())
const nextStrArray = () => o.next().split(" ")
const nextIntArray = () => o.next().split(" ").map(el => parseInt(el))
const nextCharArray = () => o.next().split("")
const hasNext = () => o.hasNext()
const myout = (...x) => console.log(...x)
const Main = () => {
    let [n,l] = nextIntArray()
    let sum = 0
    let min = Number.POSITIVE_INFINITY
    for(let i = 0; i<n;i++){
        let taste = l + i - 1
        sum += taste
        if(Math.abs(min) > Math.abs(taste)){
            min = taste
        }
    }
    console.log(sum - min)
}
Main()


"use strict"
const create = () => {
    const input = require("fs").readFileSync("/dev/stdin", "utf8").trim().split("\n");
    const res = {
        "list": input, "index": 0, "max": input.length,
        "hasNext": function() {return this.index < this.max},
        "next": function() { if (!this.hasNext()) {throw "ArrayIndexOutOfBoundsException";}else{return this.list[this.index++];}}
    };
    return res;
}
const o = create();
const next = () => o.next()
const nextInt = () => parseInt(o.next())
const nextStrArray = () => o.next().split(" ")
const nextIntArray = () => o.next().split(" ").map(el => parseInt(el))
const nextCharArray = () => o.next().split("")
const hasNext = () => o.hasNext()
const myout = (...x) => console.log(...x)
const Main = () => {
    let [n,l] = nextIntArray()
    let sum = 0
    let min = Number.POSITIVE_INFINITY
    for(let i = 0; i<n;i++){
        let taste = l + i - 1
        sum += taste
        if(Math.abs(min) > Math.abs(taste)){
            min = taste
        }
    }
    console.log(sum + min)
}
Main()


function Main(input){
	input = input.split(" ").map(Number);
	if(input[1]>=0){
		console.log((input[1]+input[1]+input[0])*(input[0]-1)/2);
	}else if(input[0]+input[1]-1>=0){
		console.log((input[0]+input[1]-2)*input[0]);
	}else{
		console.log((input[1]+input[1]+input[0]-2)/2*(input[0]-1))
	}
}Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());


package main

import "fmt"

func main() {
	var N, L int
	fmt.Scanf("%d %d", &N, &L)
	total := 0
	for i := 1; i <= N; i++ {
		total += L + i - 1
	}
	min := 10000000000000
	minTaste := 0
	for i := 1; i <= N; i++ {
		taste := total - (L + i - 1)
		diff := total - taste
		if diff < 0 {
			diff = -diff
		}
		if diff < min {
			min = diff
			minTaste = taste
		}
	}
	fmt.Println(minTaste)
}


package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
)

var (
	read  = bufio.NewReader(os.Stdin)
	write = bufio.NewWriter(os.Stdout)
)

func chmin(a *float64, b float64) bool {
	if *a > b {
		*a = b
		return true
	}
	return false
}

func chmax(a *float64, b float64) bool {
	if *a < b {
		*a = b
		return true
	}
	return false
}

func yesno(result bool) {
	if result {
		fmt.Fprintln(write, "Yes")
	} else {
		fmt.Fprintln(write, "No")
	}
}

func printansStr(result bool, a, b string) {
	if result {
		fmt.Fprintln(write, a)
	} else {
		fmt.Fprintln(write, b)
	}
}

func printansInt(result bool, a, b int) {
	if result {
		fmt.Fprintln(write, a)
	} else {
		fmt.Fprintln(write, b)
	}
}

func main() {
	defer write.Flush()

	var n, l int
	fmt.Fscan(read, &n, &l)

	sum := 0
	val := 0
	valabs := 10000000.0
	for i := 1; i <= n; i++ {
		sum += l + i - 1
		if chmin(&valabs, math.Abs(float64(l+i-1))) {
			val = l + i - 1
		}
	}
	sum -= val
	fmt.Fprintln(write, sum)
}


package main

import (
  	"sort"
	"fmt"

)
func main() {

	var N,L int

	fmt.Scan(&N,&L)

	aji := make([]int,N)

	for i:=1;i<=N;i++{

		aji[i-1] = L+i-1

	}

	sort.Sort(sort.IntSlice(aji))

	sum :=0

	temp :=0
	min :=0
	index :=0

	if aji[0] > 0{

		for i:=1;i<=len(aji)-1;i++{

			sum = sum + aji[i]
		}

		fmt.Println(sum)

	}else{

		for j:=0;j<len(aji);j++{

			if aji[j] < 0 {

				temp = aji[j] *-1

			}else{
				temp = aji[j]

			}

			if j==0{

				min =temp

			}else if min >= temp {

			 min = temp

			 index =j
			}

		}

		for j:=0;j<len(aji);j++{

			if j != index {

				sum =sum + aji[j]
			}

		}

		fmt.Println(sum)
	}

}


package main

import "fmt"

func main() {
	var n, l int
	fmt.Scan(&n, &l)

	ans := 0
	min := 1000
	for i := 1 ; i  <= n ;i++ {
		ans += l + i - 1
		if  min > abs(l + i - 1 ) {
			min =  abs(l + i - 1 )
		}
	}
	fmt.Println(ans - min)
}
func abs(n int) int {
	y := n >> 63
	return (n ^ y) - y
}


package main

import (
	"fmt"
)

func main() {
	var N, L int
	fmt.Scan(&N, &L)

	allSum := (L + L + N - 1) * N / 2

	if L+N-1 <= 0 {
		fmt.Println(allSum - L + N - 1)
	} else if L >= 0 {
		fmt.Println(allSum - L)
	} else {
		fmt.Println(allSum)
	}
}


package main

import (
	"fmt"
)

func main() {
	var N, L int
	fmt.Scan(&N, &L)

	allSum := (L + L + N - 1) * N / 2
	//	fmt.Println(allSum)
	if N >= 0 && L >= 0 {
		fmt.Println(allSum - L)
	} else if L < 0 && L+N-1 > 0 {
		fmt.Println(0)
	} else {
		fmt.Println(allSum - (L + N - 1))
	}
}


n,l = gets.chomp.split.map(&:to_i)

pai = []

(1..n).each do |i|
  pai.push(l + i -1)
end

puts pai.inject(:+) - pai.min_by{|x| (x-0).abs}


n, l = gets.chomp.split.map(&:to_i)

vals = (1..n).map { |i| l + i - 1 }
min = vals.min_by { |v| v.abs }

puts vals.reduce(:+) - min


n, l = gets.chomp.split.map(&:to_i)
bf = n * (l + l + n - 1) / 2
af = (l...l + n).to_a
af.sort_by! {|t| t.abs }
puts bf - af[0]


n,l = gets.chomp.split(' ').map(&:to_i)
apples = (l...(l+n)).to_a
choice = apples.map{|a|a.abs}.min
puts apples.sum - choice


n,l = gets.strip.split.map(&:to_i)
ary = Array.new(n,0)
for i in 1..n
  ary[i] = (l-1+i).abs
end
puts (n-1)*(l-1)+n*(n+1)/2-(ary.index(ary.min))-1


n,l=gets.split.map &:to_i
a=(l..n+l-1).to_a
max=a[0]
a.each{|i|
max=[i.abs,max.abs].min==i.abs? i : max
}
puts a.sum-max


use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("filed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let n: i32 = read();
    let l: i32 = read();
    let left = l;
    let right = l + n - 1;

    let eat = if right <= 0 {
        right
    } else if left >= 0 {
        left
    } else {
        0
    };

    let ans = (right + left) * (right - left + 1) / 2 - eat;

    println!("{}", ans);
}


use std::io::*;
use std::str::FromStr;

/*
The read function reads a string according to each one.
*/
fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

//main function
fn main() {
    let n: i32 = read();
    let l: i32 = read();
    let mut min:i32 = 400;
    let mut mini:i32 = 400;
    let mut sum = 0;
    for i in 0..n{
	let  number = l+i;
	sum += number;

	let absnum = if number < 0 {number*-1 } else {number};
	min = if absnum < min { mini = number; absnum} else {min}
    }
    println!("{}",sum-mini);
}


use std::io::stdin;

fn main() {
    let mut x = String::new();
    stdin().read_line(&mut x).unwrap();
    let x: Vec<isize> = x.trim().split_whitespace().flat_map(str::parse).collect();
    let (n, l) = (x[0], x[1]);

    let mut tastes: Vec<(isize, isize)> = (1..n+1)
        .map(|i| l + i - 1)
        .map(|i| (if i < 0 { -i } else { i }, i))
        .collect();
    tastes.sort();
    println!("{}", tastes.into_iter().skip(1).map(|(_, i)| i).sum::<isize>());
}


use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("filed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let n:i64 = read();
    let l:i64 = read();
    let left = l;
    let right = l - n - 1;

    let eat = if right <= 0 {
        right
    } else if left >= 0 {
        left
    } else {
        0
    };
    let ans = (right+left) * (right - left + 1) / 2 - eat;
    println!("{}", ans);
}


use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("filed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let n:i64 = read();
    let l:i64 = read();
    let mut ans:i64 = (0..n).map(|x| l-x).collect::<Vec<i64>>().iter().sum();
    let left = l;
    let right = l - n - 1;

    let eat = if right <= 0 {
        right
    } else if left >= 0 {
        left
    } else {
        0
    };
    println!("{}", ans - eat);
}


use std::cmp::min;
use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("filed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let n: usize = read();
    let l: i32 = read();
    let arr: Vec<i32> = (1..=n).map(|x| x as i32 + l - 1).collect();
    let standard: i32 = arr.iter().sum();
    let mut ans = std::i32::MAX;
    for i in arr {
        ans = min((standard - (standard - i)).abs(), ans);
    }
    println!("{}", standard - ans);
}


func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

let nl = readInts()
let n = nl[0]
let l = nl[1]
var valueall=0
for i in 1...n{
  valueall+=(l+i-1)
}
var first=1
for i in 1...n{
  if abs(l+i-1)<abs(l+first-1){
    first=i
  }
}
print(valueall-l-first+1)


func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

let nab=readInts()
let n=nab[0]
let l=nab[1]
var sum=0
var min=l
for i in 2...n{
  var c=l+i-1
  sum+=c
  if(abs(c)<abs(min)){sum-=c
                      sum+=min
                      min=c
                      }
}

print(sum)


func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}
let suuji = readInts()
let n = suuji[0]
let l = suuji[1]
var sum = 0
var min = l
for i in 2...n {
  var b = l + i - 1
  sum+=b
  if (abs(b)<abs(min)) {
    sum-=b
    sum+=min
    min=b
  }
}
print(sum)


func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}
let suuji = readInts()
let n = suuji[0]
let l = suuji[1]
var sum = 0
var min = l
for i in 2...n {
  var b = l + i - 1
  sum+=b
  if (abs(b)<abs(min)) {
    sum-=b
    sum+=min
  }
}
print(sum)


func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

func main() {
    let a = readInts()
    let n = a[0]
    let l = a[1]
    let sum = l * n + n * (n - 1) / 2
    var dmin = Int.max
    var closest = 0
    for i in 0..<n {
        let tmp = sum - (l + i)
        let d = abs(sum - tmp)
        if d < dmin {
            dmin = d
            closest = tmp
        }
    }
    print(closest)
}

main()


let arr=readLine()!.characters.split{$0==" "}.map{Int(String($0))!}

var n = arr[0]
var l = arr[1]
var i = 0
var min : Int
var o = 0

min = abs( l + i + 1)
for i in 1...n {
  o += l + i - 1
  if( abs( l + i - 1)  < abs(min) ) { min = l + i - 1   }
}

print( o - min )


export class Main {
  static main(input): string {
    const [n, l]: number[] = input.split("\n")[0].split(" ").map(a => parseInt(a));
    if (l < 0 && 0 <= n + l - 1) {
      let result = 0;
      for (let i = 1; i <= n; ++i) {
        result += i + l - 1;
      }
      return `${result}`;
    } else if (l < 0) {
      let result = 0;
      for (let i = 1; i < n; ++i) {
        result += i + l - 1;
      }
      return `${result}`;
    } else {
      let result = 0;
      for (let i = 2; i <= n; ++i) {
        result += i + l - 1;
      }
      return `${result}`;
    }
  }
}
console.log(Main.main(require("fs").readFileSync("/dev/stdin", "utf8")));