jiahuimbzuai/CoQuIR huggingface dataset:
//  [go]
package main

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

const mod = 998244353
const facNum = 300001

func main() {
	sc := newScanner(os.Stdin)
	K, A, B := sc.i(), sc.i(), sc.i()
	for i := A; i <= B; B ++ {
		if i % K == 0 {
			fmt.Println("OK")
			return
		}
	}
	fmt.Println("NG")
	
	//if K > A {
	//	fmt.Println("NG")
	//	return
	//}
	//m := A % K
	//if m == 0 {
	//	fmt.Println("OK")
	//	return
	//}
	//da := A / K
	//db := B / K
	//if db > da {
	//	fmt.Println("OK")
	//} else {
	//	fmt.Println("NG")
	//}

}

// fmt.Println("Yes")
// fmt.Println("No")

// I/O
type scanner struct {
	sc *bufio.Scanner
}

func newScanner(input io.Reader) *scanner {
	sc := bufio.NewScanner(input)
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 1024), int(1e+9))
	return &scanner{sc}
}

func (s *scanner) s() string {
	s.sc.Scan()
	return s.sc.Text()
}

func (s *scanner) i() int {
	i, e := strconv.Atoi(s.s())
	if e != nil {
		panic(e)
	}
	return i
}

func (s *scanner) f() float64 {
	f, e := strconv.ParseFloat(s.s(), 64)
	if e != nil {
		panic(e)
	}
	return f
}

func (s *scanner) bs() []byte {
	return []byte(s.s())
}

func (s *scanner) is(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = s.i()
	}
	return res
}

func (s *scanner) fs(n int) []float64 {
	res := make([]float64, n)
	for i := 0; i < n; i++ {
		res[i] = s.f()
	}
	return res
}

//const factorial = new
func Pow(a, n int) int {
	ans := 1
	for n > 0 {
		if (n & 1) == 1 {
			ans = ans * a % mod
		}
		a = a * a % mod
		n = n >> 1
	}
	return ans
}

func Gcd(a, b int) int {
	if a < b {
		return Gcd(b, a)
	}
	for b != 0 {
		a, b = b, a%b
	}
	return a
}

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

func combination(n, k int, fac, ifac []int) int {
	if n < k || n < 0 {
		return 0
	}
	if k == 0 {
		return 1
	}
	//while n != 0
	ans := ifac[k] * ifac[n-k] % mod
	return ans * fac[n] % mod
}

// 階乗: factorial
// コンビネーションを計算する際に前もって計算しておく
// fac[k] => k! (mod M)
// ifac[k] => k!^(M-2) (mod M)
// n: ex. 2 * 10^5 => 200001
// fac, ifac := factorial()
func factorial() (fac []int, ifac []int) {
	fac = make([]int, facNum)
	fac[0] = 1
	ifac = make([]int, facNum)
	ifac[0] = 1
	for i := 1; i < facNum; i++ {
		fac[i] = fac[i-1] * i % mod
		ifac[i] = ifac[i-1] * Pow(i, mod-2) % mod
	}
	return
}
//  [ruby]
K = gets.to_i
A, B = gets.split.map(&:to_i)

A.upto(B) do |i|
    if i % K == 0 then
        puts 'OK'
        exit
    end
end
puts 'NG'
//  [ruby]
k = gets.to_i
a, b = gets.split("\s").map(&:to_i)
able = false

1.upto(b) do |i|
  if k * i >= a && b >= k * i
    print 'OK'
    able = true
    break
  end
  if k * i > b
    break
  end
end

print 'NG' unless able
//  [ruby]
k=gets.to_i
a,b=gets.split.map(&:to_i)
i=0
a.upto(b){|n|
  if n%k==0
    puts "OK"
    i=1
    break
  end
  }

puts i==0? "NG" : ""
//  [ruby]
a,b,c=`dd`.split.map(&:to_i)
(b..c).each{|i|if i%a==0
  puts 'OK'
  exit}
puts 'NG'
//  [ruby]
x=gets.to_i
c=0
m=100
while x>=m do 
m+=(m*0.01).floor
c+=1 
end
p c
//  [rust]
// -*- coding:utf-8-unix -*-

use proconio::input;

// ABC086C - Traveling
// https://atcoder.jp/contests/abs/fasks/arc089_a
fn main() {
    input! {
        k: usize,
        a: usize,
        b: usize,
    }
    let mut ans = false;
    if a % k == 0 || b % k == 0 {
        ans = true;
    } else if b - a >= k {
        ans = true;
    } else if a % k > b % k {
        ans = true;
    }

    if ans == true {
        println!("OK");
    } else {
        println!("NG");
    }
}
//  [rust]
use proconio::{
   fastout, input,
   marker::{Bytes, Chars, Isize1, Usize1},
};

fn main() {
   input! {
      k:usize,
      a:usize,b:usize
   }

   for i in a..=b {
      if i % k == 0 {
         println!("OK");
         return;
      }
   }
   println!("NG");
}
//  [rust]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

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

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

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

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

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

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

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

fn main() {
    input! {k: i32, a: i32, b: i32};

    let x = k - a % k + a;

    if b >= x || k == 1 {
        println!("OK")
    } else if a == b && a % k == 0 {
        println!("OK")
    } else {
        println!("NG")
    }
}
//  [rust]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

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

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

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

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

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

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

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

fn main() {
    input! {k: i32, a: i32, b: i32};

    let x = a % k;

    if b - a + x >= k || k == 1 {
        println!("OK")
    } else if a == b && a % k == 0 {
        println!("OK")
    } else {
        println!("NG")
    }
}
//  [rust]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

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

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

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

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

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

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

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

fn main() {
    input! {k: u64, a: u64, b: u64};

    let x = a % k;

    if b - a + x >= k || k == 1 {
        println!("OK")
    } else if a == b && a % k == 0 {
        println!("OK")
    } else {
        println!("NG")
    }
}
//  [swift]
let aa = Int(readLine()!)!
let arr=readLine()!.split{$0==" "}.map{Int(String($0))!}
var a=arr[0]
var b=arr[1]
var i = 0
while a <= b {
    if a%aa == 0 {
        print("OK")
        i = 1
        break
    }
    a+=1
}
if i == 0 {
    print("NG")
}
//  [swift]
func main() {
  let k = Int(readLine()!)!
  let ab = readLine()!.split(separator: " ").map { Int($0)! }
  let (a, b) = (ab[0], ab[1])

  for i in a...b {
    if i % k == 0 {
      print("OK")
      return
    }
  }

  print("NG")
  return
}

main()
//  [swift]
let k = Int(readLine()!)!
let i = readLine()!
    .split(separator: " ")
    .map { Int($0)! }
let (a, b) = (i[0], i[1])
let x = (a...b).contains { $0.isMultiple(of: k) }
let y = (a == b) && (a == k)
print(x || y ? "OK" : "NG")
//  [swift]
import Foundation
 
let input_line: String = readLine()!
let split: [String] = input_line.components(separatedBy: " ")
 
let K = Int(split[0])!
let A = Int(split[1])!
let B = Int(split[2])!

if (B - B % K >= A){
    print("OK")
}else{
    print("NG")
}
//  [swift]
let k = cin.n
let (a,b) = cin.pair

if b%k == 0 || a%k == 0 || b-k >= a {
  print("OK")
} else {
  print("NG")
}

import Foundation
#if os(Linux)
    import Glibc
#else
    import Darwin.C
#endif

enum cin {
    // 123
    static var n: Int { Int(readLine()!)! }
    // 12 23
    static var pair: (Int, Int) { let line = readLine()!.components(separatedBy: " "); return (Int(line[0])!, Int(line[1])!) }
    // 12 23 34
    static var triple: (Int, Int, Int) { let line = readLine()!.components(separatedBy: " "); return (Int(line[0])!, Int(line[1])!, Int(line[2])!) }
    // AtCoder
    static var line: String { readLine()! }
    // At Coder
    static var arrayStr: [String] { line.components(separatedBy: " ") }
    // 1 2 3 4
    static var array: [Int] { line.components(separatedBy: " ").map { Int($0)! } }
    // 1
    // 2
    // 3
    static func v_array(count: Int) -> [Int] { (0..<count).map { _ in n } }
}

extension Int {
    // 123 -> [1, 2, 3]
    var digits: [Int] { Array(String(self)).map { Int(String($0))! } }
}

extension Array where Element == Int {
    // [2, 1, 3, 2] -> 8
    var sum: Int { self.reduce(0, +) }
    // [2, 1, 3, 2] -> [1, 2, 2, 3]
    var orderBy: [Int] { sorted() }
    // [2, 1, 3, 2] -> [3, 2, 2, 1]
    var orderByDesc: [Int] { sorted(by: { $0 > $1 }) }
    // [2, 1, 3, 2] -> [2, 1, 3]
    var distinct: [Int] { Array(Set(self)) }
}

extension String {
    // e.g. cin.line.regex(match: "^(dream|dreamer|erase|eraser)*$")
    func regex(match pattern: String) -> Bool {
        let regex = try! NSRegularExpression(pattern: pattern)
        return regex.firstMatch(in: self, range: NSRange(location: 0, length: self.count)) != nil
    }
    // "ABC"[1] -> "B"
    subscript(i: Int) -> Character {
        get {
            self[index(at: i)]
        }
        set(char) {
            var characters = Array(self)
            characters[i] = char
            self = String(characters)
        }
    }
    func index(at offset: Int) -> String.Index { index(startIndex, offsetBy: offset) }
    // "ABC".swapAt(0, 1) -> "BAC"
    mutating func swapAt(_ index1: Int, _ index2: Int) {
        var characters = Array(self)
        characters.swapAt(index1, index2)
        self = String(characters)
    }
}
//  [swift]
let k = cin.n
let (a,b) = cin.pair

if b%k == 0 || b-k >= a {
  print("OK")
} else {
  print("NG")
}

import Foundation
#if os(Linux)
    import Glibc
#else
    import Darwin.C
#endif

enum cin {
    // 123
    static var n: Int { Int(readLine()!)! }
    // 12 23
    static var pair: (Int, Int) { let line = readLine()!.components(separatedBy: " "); return (Int(line[0])!, Int(line[1])!) }
    // 12 23 34
    static var triple: (Int, Int, Int) { let line = readLine()!.components(separatedBy: " "); return (Int(line[0])!, Int(line[1])!, Int(line[2])!) }
    // AtCoder
    static var line: String { readLine()! }
    // At Coder
    static var arrayStr: [String] { line.components(separatedBy: " ") }
    // 1 2 3 4
    static var array: [Int] { line.components(separatedBy: " ").map { Int($0)! } }
    // 1
    // 2
    // 3
    static func v_array(count: Int) -> [Int] { (0..<count).map { _ in n } }
}

extension Int {
    // 123 -> [1, 2, 3]
    var digits: [Int] { Array(String(self)).map { Int(String($0))! } }
}

extension Array where Element == Int {
    // [2, 1, 3, 2] -> 8
    var sum: Int { self.reduce(0, +) }
    // [2, 1, 3, 2] -> [1, 2, 2, 3]
    var orderBy: [Int] { sorted() }
    // [2, 1, 3, 2] -> [3, 2, 2, 1]
    var orderByDesc: [Int] { sorted(by: { $0 > $1 }) }
    // [2, 1, 3, 2] -> [2, 1, 3]
    var distinct: [Int] { Array(Set(self)) }
}

extension String {
    // e.g. cin.line.regex(match: "^(dream|dreamer|erase|eraser)*$")
    func regex(match pattern: String) -> Bool {
        let regex = try! NSRegularExpression(pattern: pattern)
        return regex.firstMatch(in: self, range: NSRange(location: 0, length: self.count)) != nil
    }
    // "ABC"[1] -> "B"
    subscript(i: Int) -> Character {
        get {
            self[index(at: i)]
        }
        set(char) {
            var characters = Array(self)
            characters[i] = char
            self = String(characters)
        }
    }
    func index(at offset: Int) -> String.Index { index(startIndex, offsetBy: offset) }
    // "ABC".swapAt(0, 1) -> "BAC"
    mutating func swapAt(_ index1: Int, _ index2: Int) {
        var characters = Array(self)
        characters.swapAt(index1, index2)
        self = String(characters)
    }
}
//  [typescript]
// inputに入力データ全体が入る
function Main(input) {
	input = input.split("\n");
	rangeLineString = input[1].split(" ");
	//入力値を取得
	var k = parseInt(input[0], 10);
	var a = parseInt(rangeLineString[0], 10);
	var b = parseInt(rangeLineString[1], 10);
	var canClear = false;
  	//割り切れるかチェック
  	for(a; a <= b; a++){
      if(a % k == 0){
        canClear = true;
      }
    }
  	//出力
  	if(canClear){
      console.log('OK');
    }else{
      console.log('NG');
    }
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [typescript]
import * as fs from "fs";

const input = (fs.readFileSync("/dev/stdin", "utf8") as string).split("\n");
const k = +input[0];
const [a, b] = input[1].split(" ").map((x: string): number => +x);

let result = false;
for (let i = a; i <= b; i++) {
	if (i % k === 0) result = true;
}

console.log(result ? "OK" : "NG");
//  [typescript]
import * as fs from 'fs';

export function Main(input: string) {
    const lines = input.split('\n');    // ?
    const k = parseInt(lines[0]);   // ?
    const [a, b] = lines[1].split(' ').map(int => parseInt(int));   // ?

    let result = 'NG';
    for (let i = ~~(a / k) * k; i <= b; i += k) {
        if (i >= a) {
            result = 'OK';
            break;
        }
    }

    //output

    console.log(result);
}

// Don't edit this line!
Main(fs.readFileSync("/dev/stdin", "utf8"));
//  [python]
A, B = map(int,input().split())
if A+B >= 10:
  print('error')
else:
  print(A+B)
//  [python]
A, B = map(int, input().split())
if A+B >= 10:
    print("error")
else:
    print(A+B)
//  [python]
a, b = map(int, input().split())
if a+b>9:
    print("error")
else:
    print(a+b)
//  [python]
a,b=map(int, input().split()) 
print("error" if a*b>=10 else a*b)
//  [python]
a,b = map(int,input().split())

print(a+b if a+b < 10 else error)
//  [python]
A, B = int(input().split())
if A+B < 10:
    print(A+B)
else:
    print('error')
//  [java]

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

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader input =new BufferedReader (new InputStreamReader (System.in));
		String str = input.readLine( );
		String[] ab = str.split(" ");
		int a = Integer.parseInt(ab[0]);
		int b = Integer.parseInt(ab[1]);

		if(a+b < 10){
			System.out.println(a+b);
		}else{
			System.out.println("error");
		}


	}

}
//  [java]
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) {
        try {
            // 標準入力
            InputStreamReader isr = new InputStreamReader(System.in);
            BufferedReader br = new BufferedReader(isr);
            String strArr[] = br.readLine().split(" ");
            int a = Integer.parseInt(strArr[0]);
            int b = Integer.parseInt(strArr[1]);
            int sum = a + b;
            if (sum >= 10) {
                System.out.println("error");
            } else {
                System.out.println(sum);
            }
       } catch (IOException e) {
            e.printStackTrace();
       }
    }
}
//  [java]
import java.util.Scanner;

public class A063 {

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

		if(A+B >= 10)
		{
			System.out.println("error");
		}
		else
		{
			System.out.println(A+B);
		}
	}

}
//  [java]


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

public class Main {
    static class FS {
        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());
        }

        double nextDouble() {
            return Double.parseDouble(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 long[] readLongArray(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        }
    }

    static final FS sc = new FS();
    static final PrintWriter out = new PrintWriter(System.out);
    static final int mod = 1000000007;

    public static void main(String[] args) {

        solve();
        out.close();

    }

    static void solve() {
        int a = sc.nextInt();
        int b = sc.nextInt();
        if (a + b == 10) {
            out.println("error");
        } else {
            out.println(a + b);
        }
    }
}
//  [cpp]
#include<stdio.h>
#include<string.h>
int main(){
	int a,b;
	while(scanf("%d%d",&a,&b)!=EOF){
		if(a+b<10)
			printf("%d\n",a+b);
			else
			printf("error\n");
	}
	return 0;
}
//  [cpp]
#include <stdio.h>
int main(int argc, char *argv[])
{
	int  a,b;
	scanf("%d%d",&a,&b);
	 if(a+b<10) printf("%d",a+b);
	 else printf("error"); 
	return 0;
}
//  [cpp]
#include<stdio.h>
int main()
{
	int a,b;
	scanf("%d%d",&a,&b);
	if(a+b<10) 
	 printf("%d",a+b);
    else printf("error");
}
//  [cpp]
#include <bits/stdc++.h>

#define ln "\n"
#define SORT(X) sort(X.begin(), X.end())
#define SORTi(X) sort(X.begin(), X.end(), greater<ll>())
#define REP(x, a, b) for (auto x = a; x <= b; x++)
#define REPi(x, b, a) for (auto x = b; x >= a; x--)
#define REPit(x, A) for (auto x = A.begin(); x != A.end(); x++)
#define REPr(x, A) for (auto x : A)
#define ll long long
#define ull unsigned long long
#define PB push_back
#define EB emplace_back
#define UMP unordered_map
#define UST unordered_set

using namespace std;

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

    ll N = 0;
    cin >> N;
    ll sum = 0;
    vector<ll> A(N);
    REP(i, 0, N - 1)
    {
        cin >> A[i];
        sum = sum + A[i];
    }
    SORT(A);
    if (sum % 10 == 0)
    {
        REP(i, 0, N)
        {
            if (A[i] % 10 != 0)
            {
                sum = sum - A[i];
                break;
            }
        }
    }
    if (sum % 10 == 0)
        cout << 0 << ln;
    else
        cout << sum << ln;
    return 0;
}
//  [cpp]
#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;
  cin >> a >> b;
  cout << (a + b < 10 ? a + b : "error") << endl;
}
//  [cpp]
#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:
  cin >> a >> b;
  cout << (a + b < 10 ? a + b : "error") << endl;
}
//  [c]
#include <stdio.h>

int main(void) {
	int a; int b;
	scanf("%d%d", &a,&b);
	if(a+b>=10) {
		printf("error");
	}
	else {
		printf("%d\n",a+b );
	}
}
//  [c]
#include <stdio.h>

int main(void)
{
	int a, b;
	
	scanf("%d %d", &a, &b);
	
	if(a+b >= 10)
		printf("error\n");
	else
		printf("%d\n", a+b);
	
	return 0;
}
//  [c]
#include <stdio.h>


int main()
{
    int a,b;
    scanf("%d%d",&a,&b);
    int c=0;
    c=a+b;
    if(c>=10)
        printf("error");
    else
    printf("%d",c);
    return 0;
}
//  [c]
#include <stdio.h>
 
int	main(void)
{
  int	i = 0;
  int	j = 0;
  
  scanf("%d %d", i, j);
  if ((i + j) >= 10)
    printf("error");
  else
    printf("%d", i + j);
  return (0);
}
//  [c]
#include <stdio.h>
 
int	main(void)
{
  int	i = 0;
  int	j = 0;
  
  scanf("%d %d", &i, &j);
  if (i + j > 10)
    printf("error");
  else
    printf("%d", i + j);
  return (0);
}
//  [c]
#include <stdio.h>

int	main(void)
{
  int	i = 0;
  int	j = 0;
  
  scanf("%d %d", i, j);
  if (i + j > 10)
    printf("error");
  else
    printf("%d", i + j);
  return (0);
}
//  [javascript]
/**
 * @param {String} input
 */
function Main(input){
    const inputs = input.split(' ');
    const num = Number(inputs[0]) + Number(inputs[1]);
    if(num >= 10) return "error";
    return num; 
}
console.log(Main(require("fs").readFileSync("/dev/stdin", "utf8")));
//  [javascript]
"use strict";
const Main = (input) => {
	let xs = input.trim().split(' ').map(v=>parseInt(v,10));
    let ans = '';
    if(xs[0] + xs[1] < 10){
    	ans = xs[0] + xs[1];
    }else if(xs[0] + xs[1] >= 10){
        ans = "error";
    }
    console.log(ans);
}
Main(require('fs').readFileSync('/dev/stdin','utf8'));
//  [javascript]
function Main(input) {
  const numbers = input.split(' ').map(n => Number(n));
  const a = numbers[0];
  const b = numbers[1];
  if(a + b >= 10) {
    console.log('error');
  } else {
    console.log(a + b);
  }
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function sum(a,b){
    const add = a+b;
    if(add >= 10){
        return "error";
    }
    return add;
}

const readline = require("readline");
const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});

rl.question("", function(x) {
    rl.question("", function(y) {
        const value1 = parseInt(x);
        const value2 = parseInt(y);
        const result = sum(value1,value2);
        console.log(result);
        rl.close();
    });
});
//  [javascript]
function sum(a,b){
    const add = a+b;
    if(add >= 10){
        return "error";
    }
    return add;
}

const readline = require("readline");
const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});

rl.question("Give me A=", function(x) {
    rl.question("Give me B=", function(y) {
        const value1 = parseInt(x);
        const value2 = parseInt(y);
        const result = sum(value1,value2);
        console.log(result);
        rl.close();
    });
});
//  [javascript]
function sum(a,b){
    const add = a+b;
    if(add >= 10){
        return "error";
    }
    return add;
}

const result1 = sum(1,2);
console.log(result1);

const result2 = sum(1,11);
console.log(result2);
//  [go]
package main
 
import "fmt"
 
func main() {
	var a, b int
	fmt.Scan(&a, &b)
	sum := a + b
	if sum >= 10 {
		fmt.Println("error")
	} else {
		fmt.Println(sum)
	}
}
//  [go]
package main

import (
	"fmt"
)

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

	if a+b >= 10 {
		fmt.Println("error")
	} else {
		fmt.Println(a + b)
	}
}
//  [go]
package main

import (
	"fmt"
)

func main() {
	var a, b int
	if (a + b) < 10 {
		fmt.Println(a + b)
	} else {
		fmt.Println("error")
	}
}
//  [go]
package main

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


func main() {
	In := readLineInt()
	Result := In[0] + In[1]
	if Result >= 10 {
		fmt.Println("error")
	} else {
		fmt.Println(Result)
	}
}

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

func readLineInt() []int {
	result := make([]int, 0)
	for _, v := range strings.Split(readLine(), " ") {
		i, _ := strconv.Atoi(v)
		result = append(result, i)
	}
	return result
}

var reader = bufio.NewReaderSize(os.Stdin, 1e6)

func readLine() string {
	result := make([]byte, 0, 1e6)
	for {
		line, remains, e := reader.ReadLine()
		if e != nil {
			panic(e)
		}
		result = append(result, line...)
		if !remains {
			break
		}
	}
	ret
//  [go]
package main

import "fmt"

func main() {
	var a, b int
	fmt.Scan(&a, &b)
	if a + b <= 10 {
		fmt.Println(a + b)
	} else {
		fmt.Println("error")
	}
}
//  [ruby]
a, b = gets.chomp.split.map(&:to_i)
puts a + b >= 10 ? 'error' : a + b
//  [ruby]
a,b = gets.split.map(&:to_i)

if a+b >= 10
  puts "error"
else
  puts a+b
end
//  [ruby]
x = gets.chomp.split.map(&:to_i)
y = x.inject(:+)
if y >= 10
  puts "error"
  exit
end
puts y
//  [ruby]
a=gets.split.map(&:to_i).sum
puts a<=10 ? a : "error"
//  [ruby]
a gets.split.map(&:to_i).reduce(:+)

puts a > 9 ? 'error' : a
//  [ruby]
str = gets
arr = str.split(" "),map(&:to_i)

sum = arr[0] + arr[1]
puts sum >= 10 ? 'error' : sum
//  [rust]
macro_rules! get {
    ($t:ty) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().parse::<$t>().unwrap()
        }
    };
    ($($t:ty),*) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            (
                $(iter.next().unwrap().parse::<$t>().unwrap(),)*
            )
        }
    };
    ($t:ty; $n:expr) => {
        (0..$n).map(|_|
            get!($t)
        ).collect::<Vec<_>>()
    };
    ($($t:ty),*; $n:expr) => {
        (0..$n).map(|_|
            get!($($t),*)
        ).collect::<Vec<_>>()
    };
}

fn main() {
    let (a, b) = get!(i32, i32);
    let x = a + b;
    if x < 10 {
        println!("{}", x);
    } else {
        println!("error");
    }
}
//  [rust]

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")
}

use std::cmp::max;
use std::cmp::min;

fn main() {
    let a: usize = read();
    let b: usize = read();
    if a + b >= 10 {
        println!("{}", "error");
    } else {
        println!("{}", a + b);
    }
}
//  [rust]
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")
    };
}

fn main() {
    input! {
        a: u32,
        b: u32,
    }
    if a + b >= 10 {
        println!("error");
    } else {
        println!("{}", a + b);
    }
}
//  [rust]

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")
}

use std::cmp::max;
use std::cmp::min;

fn main() {
    let a: usize = read();
    let b: usize = read();
    if a + b > 10 {
        println!("{}", "error");
    } else {
        println!("{}", a + b);
    }
}
//  [rust]
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}
#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}
#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

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

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

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

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


fn main() {
    input! {
        a: usize,
        b: usize,
    }
    if a + b >= 10 {
        println!("Error")
    } else {
        println!("{}", a + b)
    }
}
//  [rust]
use std::io::prelude::*;
use std::io;

fn main() {
    let mut stdin = io::stdin();
    let mut buf = String::new();

    stdin.read_to_string(&mut buf).unwrap();
    
    let mut buf = buf.split(' ');

    let (a, b) = {
        let a: i32 = buf.next().unwrap().parse().unwrap();
        let b: i32 = buf.next().unwrap().parse().unwrap();
        (a, b)
    };
    
    if a + b < 10 {
        println!("{}", a + b);
    } else {
        println!("error");
    }

}
//  [swift]
let i=readLine()!.characters.split(" ").reduce(0){$0+Int(String($1))!};print(i<10 ?i:"error")
//  [swift]
import Foundation


import Foundation

let input_line: String = readLine()!
let split: [String] = input_line.components(separatedBy: " ") //ブランクで区切られている場合

let A = Int(split[0])!
//String -> Intの型変換はnilが返る可能性があるので、ラップされたOptional<Int>型が返るので強制アンラップ
let B = Int(split[1])!

if (A+B < 10){
    print(A+B)
}else{
    print("error")
}
//  [swift]
import Foundation


import Foundation

let input_line: String = readLine()!
let split: [String] = input_line.components(separatedBy: " ") //ブランクで区切られている場合

let A = Int(split[0])!
//String -> Intの型変換はnilが返る可能性があるので、ラップされたOptional<Int>型が返るので強制アンラップ
let B = Int(split[1])!

if (A+B < 10){
    print("A+B")
}else{
    print("error")
}
//  [typescript]
const main = (input) => {
  input = input.trim();
  input = input.split(' ');
  const a = parseInt(input[0], 10);
  const b = parseInt(input[1], 10);
  
  if (a+b>=10) {
    console.log("error");
  }else{
    console.log(a+b);
  }
  
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [typescript]
const stdin = require('fs').readFileSync('/dev/stdin', 'utf8')

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

console.log(a + b >= 10 ? 'error' : a + b)
//  [typescript]
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]=nrin(2)
  out(a+b>=10?'error':a+b)
}
main()
//  [typescript]
const main = (input) => {
  input = input.trim();
  input = input.split(' ');
  const a = parseInt(input[0], 10);
  const b = parseInt(input[1], 10);
  
  if (a+b=>10) {
    console.log("error");
  }else{
    console.log(a+b);
  }
  
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [typescript]
const main = (input) => {
  input = input.split(' ');
  const a = parseInt(input[0], 10);
  const b = parseInt(input[1], 10);
  
  if (a+b=>10) {
    console.log("error");
  }else{
    console.log(a+b);
  }
  
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [typescript]
const main = (input) => {
  input = input.split(' ');
  const a = parseInt(input[0], 10);
  const b = parseInt(input[1], 10);
  
  if (a+b<=10) {
    console.log("error");
  }else{
    console.log(a+b);
  }
  
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [python]
a, b, c, k = map(int, input().split())

ans = a - b
if k & 1:
 ans *= -1

print(ans)
//  [python]
a,b,c,k = map(int,input().split())
if k%2 == 0:
    print(a-b)
else:
    print(b-a)
//  [python]
def main():
    a, b, c, k = map(int, input().split())

    ans = (-1) ** (k % 2) * (a - b)

    print(ans)


if __name__ == "__main__":
    main()
//  [python]
print((-1)**k*(a-b))
//  [python]
a,b,c,k=map(int,input().split())
d=(b+c)-(c+a)
print(d if d<10**18 else "unfair")
//  [java]
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long A = sc.nextLong();
		long B = sc.nextLong();
		long C = sc.nextLong();
		long K = sc.nextLong();
		for (int i = 0; i < K; i++) {
			long tempa = B + C;
			long tempb = A + C;
			long tempc = B + A;
			A = tempa;
			B = tempb;
			C = tempc;
			if (Math.abs(A-B)>1000000000000000000l) {
				System.out.println("Unfair");
				return ;
			}
		}
		System.out.println(A-B);
	}
}
//  [java]
import java.util.*;
import java.io.*;
public class Main{
        public static void main(String[] args){
                Scanner sc = new Scanner(System.in);
                Map hs = new HashMap();
                PrintWriter ou = new PrintWriter(System.out);
                long a = Long.parseLong(sc.next());
                long b = Long.parseLong(sc.next());
                long k = Long.parseLong(sc.next());
                k = Long.parseLong(sc.next());
                sc.close();
                ou.print((long)((a - b) * Math.pow(-1 , k)) + "\n");
                ou.flush();
        }
}
//  [java]
import java.util.Scanner;

public class  Main{
	public static void main(String [] args) {
		Scanner sc = new Scanner(System.in);
		long A = sc.nextLong();
		long B = sc.nextLong();
		long C = sc.nextLong();
		long K = sc.nextLong();
		
		
		long a[] = new long[3];
		long b[] = new long[3];
		long c[] = new long[3];
		
		a[0] = 0;
		b[0] = 0;
		c[0] = 0;
		a[1] = A;
		b[1] = B;
		c[1] = C;
		a[2] = A;
		b[2] = B;
		c[2] = C;
		
		if(A == B && B == C)			System.out.println(a[2] - b[2]);
		else {
		
		for(int i = 1; i <= K; i++) {
			a[2] = a[0] + b[1] + c[1];
			b[2] = b[0] + a[1] + c[1];
			c[2] = c[0] + a[1] + b[1];
			
			a[0] = a[2];
			b[0] = b[2];
			c[0] = c[2];
			
			a[1] = a[1];
			b[1] = b[1];
			c[1] = c[1];
			
			//System.out.println(a[2] + " " + b[2] + " " + c[2]);
		}
		
		System.out.println(a[2] - b[2]);
		}
	}
}
//  [cpp]
#include <cstdio>
#define repi(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,a) repi(i,0,a)
#define all(a) (a).begin(), (a).end()

using ll = long long;

/*
A B C
B+C C+A A+B
C+2A+B A+2B+C
*/

ll A, B, C, K;

int main()
{
  scanf( "%lld%lld%lld%lld", &A, &B, &C, &K );
  printf( "%lld\n", K%2?B-A:A-B );
  
  return 0;
}
//  [cpp]
#include <cstdio>
#include <algorithm>
#define LL long long
using namespace std;
const LL mb=1e18;
LL k;int a,b,c;
int main()
{
	scanf("%d%d%d",&a,&b,&c);
	scanf("%lld",&k);
	if (abs(a-b)>mb) printf("Unfair");
	else  
	if (k%2) printf("%d",b-a);
	else printf("%d",a-b);
}
//  [cpp]
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<queue>
#include<map>
#include<vector>
#include<functional>

using namespace std;

long long A, B, C, K;
int main(void) {
	scanf("%lld %lld %lld %lld", &A, &B, &C, &K);
	if (K % 2 == 0) { printf("%lld\n", A - B); }
	else { printf("%lld\n", B - A); }
	return 0;
}
//  [cpp]
#include<iostream>
#include <algorithm>
#include <cmath>
#include <set>
#include<map>	
#include<cstring>
#include<iomanip>
#include <string>
#include <vector>	
#include<unordered_map>
#include<unordered_set>
using namespace std;


typedef long long unsigned llu;
typedef long double ld;
#define ll long long
#define PI 3.14159265358979323846
#define For(i, a, b) for (int i = a, sz = (int)b; i < sz; i++)
#define rFor(i, a, b, c) for (int i = (a); i >= (b); i -= (c))
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define fill(a, b) memset(a, b, sizeof(a))
#define IO ios_base::sync_with_stdio(false), cin.tie(0),cout.tie(0)
const int mod = 1000000007;
const ll inf = 1000000000009;
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b) { return a*b/gcd(a,b);}

//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdoutn

ll mx=1e18;

int main()
{
	IO;
	ll a{},b{},c{},k{};
	cin>>a>>b>>c>>k;
	ll dif=(a-b)+(a-c),diff=(b-a)+(b-c);
	if(k>0){
		(abs((dif*k)-(diff*k))>mx)?cout<<"Unfair\n":cout<<(dif*k)-(diff*k)<<'\n';
	}
	else cout<<a-b<<'\n';
	//system("pause");
	return 0;
}
//  [cpp]
#include<iostream>
#include <algorithm>
#include <cmath>
#include <set>
#include<map>	
#include<cstring>
#include<iomanip>
#include <string>
#include <vector>	
#include<unordered_map>
#include<unordered_set>
using namespace std;


typedef long long unsigned llu;
typedef long double ld;
#define ll long long
#define PI 3.14159265358979323846
#define For(i, a, b) for (int i = a, sz = (int)b; i < sz; i++)
#define rFor(i, a, b, c) for (int i = (a); i >= (b); i -= (c))
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define fill(a, b) memset(a, b, sizeof(a))
#define IO ios_base::sync_with_stdio(false), cin.tie(0),cout.tie(0)
const int mod = 1000000007;
const ll inf = 1000000000009;
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b) { return a*b/gcd(a,b);}

//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdoutn

ll mx=1e18;

int main()
{
	IO;
	ll a{},b{},c{},k{};
	cin>>a>>b>>c>>k;
	ll dif=abs(a-b)+abs(a-c),diff=abs(b-a)+abs(b-c);
	if(k>0){
		(abs((dif*k)-(diff*k))>mx)?cout<<"Unfair\n":cout<<(dif*k)-(diff*k)<<'\n';
	}
	else cout<<a-b<<'\n';
	//system("pause");
	return 0;
}
//  [cpp]
#include<iostream>
#include <algorithm>
#include <cmath>
#include <set>
#include<map>	
#include<cstring>
#include<iomanip>
#include <string>
#include <vector>	
#include<unordered_map>
#include<unordered_set>
using namespace std;


typedef long long unsigned llu;
typedef long double ld;
#define ll long long
#define PI 3.14159265358979323846
#define For(i, a, b) for (int i = a, sz = (int)b; i < sz; i++)
#define rFor(i, a, b, c) for (int i = (a); i >= (b); i -= (c))
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define fill(a, b) memset(a, b, sizeof(a))
#define IO ios_base::sync_with_stdio(false), cin.tie(0),cout.tie(0)
const int mod = 1000000007;
const ll inf = 1000000000009;
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b) { return a*b/gcd(a,b);}

//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdoutn

ll mx=1e18;

int main()
{
	IO;
	ll a{},b{},c{},k{};
	cin>>a>>b>>c>>k;
	a+=k,b+=k,c+=k;
	if(k>0){
		if((abs((b+c)-(a+c)))>mx)cout<<"Unfair\n";
		else cout<<(llu)((b+c)-(a+c))<<'\n';
	}
	else cout<<a-b<<'\n';
	//system("pause");
	return 0;
}
//  [c]
#include <stdio.h>

int main()
{
	int A, B, C;
	long long K;
	scanf("%d %d %d %lld", &A, &B, &C, &K);
	
	if (K % 2 == 0) printf("%d\n", A - B);
	else printf("%d\n", B - A);
	fflush(stdout);
	return 0;
}
//  [c]
#include <stdio.h>
#include <stdlib.h>
#define ll long long

int main(void) {
    ll a, b, c, k, ans;
    scanf("%lld %lld %lld %lld", &a, &b, &c, &k);
    if (k % 2 == 1) ans = b - a;
    else ans = a - b;
    
    if (llabs(ans) > 1000000000000000000) printf("Unfair\n");
    else printf("%lld\n", ans);
    return 0;
}
//  [c]
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
int main(void){
    //b+c,a+c,a+b b+c-a-c=b-a 1 3 5 7
    //2a+c+b,a+2b+c,a+b+2c a-b 2 4 6 8
int a,b,c;
long long int k;
scanf("%d %d %d %lld",&a,&b,&c,&k);
if(k%(long long int)2==0){printf("%d\n",a-b);}
else{printf("%d\n",b-a);}
 
}
//  [c]
t;main(a,b,c){
int k;
scanf("%d%d%d%ld",&a,&b,&c,&k);
t=k%2?b-a:a-b;
printf(abs(t)>pow(10,18)?"Unfair":"%d",t);
}
//  [c]
#include <stdio.h>
int main(void){
    // Your code here!
    long int a,b,c,k;
    scanf("%ld %ld %ld %ld\n",&a,&b,&c,&k);
    
    long int ans=0;
    if(k%2==0){
        ans=a-b;
    }else{
        ans=b-a;
    }
    
    if(a-b>abs(1000000000000000000)){
        printf("Unfair\n");
    }else{
        printf("%ld\n",a-b);
    }
    
}
//  [c]
#include <stdio.h>
int main(void){
    // Your code here!
    long int a,b,c,k;
    scanf("%ld %ld %ld %ld\n",&a,&b,&c,&k);
    
    long int pa=0;
    long int pb=0;
    for(long int i=0;i<k;i++){
        pa=b+c;
        pb=a+c;
        c=a+b;
        a=pa;
        b=pb;
    }
    
    if(a-b>1000000000000000000){
        printf("Unfair\n");
    }else{
        printf("%d\n",a-b);
    }
    
}
//  [javascript]
function Main(input){
  input = input.split(" ");
  input[3] = input[3].split("").map(Number);
  input[3] = input[3][input[3].length-1];
  console.log(input[3]%2==1?input[1]-input[0]:input[0]-input[1]);
}Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());
//  [javascript]
'use strict';

const DELIMITER = " ";
const A_INDEX = 0;
const B_INDEX = 1;
const K_INDEX = 3;
const LIMIT = Math.pow(10, 18);

const process = input => {
    const indexArr = input.split(DELIMITER);
    const ans = parseInt(indexArr[A_INDEX]) - parseInt(indexArr[B_INDEX]);
    const KString = indexArr[K_INDEX];
    // JS rounds up large numbers; simply get last digit for modulo
    const K = parseInt(KString.charAt(KString.length-1));

    if (Math.abs(ans) > LIMIT) {
        console.log('Unfair')
    } else {
        console.log(K % 2 === 0 || ans === 0 ? ans : -ans);
    }
}

process(require("fs").readFileSync("/dev/stdin", "utf8").trim());
//  [javascript]
'use strict'
 
function Main(input) {
  const takahashi = Number(input.split(' ')[0]);
  const chuhashi = Number(input.split(' ')[1]);
  const syohashi = Number(input.split(' ')[2]);
  //const K = Number(input.split(' ')[3]);
  const K = input.split(' ')[3];
  const Ka = Number(K.slice(-1));
 
  const answer = chuhashi - takahashi;
  
  if(Ka % 2 === 0 && answer !== 0) {
    console.log(answer * -1);
  } else {
    console.log(answer);
  }
}
 
Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());
//  [javascript]
process.stdin.resume();
process.stdin.setEncoding('utf8');

var lines = [];
var reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});
reader.on('line', (line) => {
  lines.push(line);
});
reader.on('close', () => {
    const [A,B,C,K] = lines[0].split(" ").map(v=>v);
    const ans = (K%2===0?B-C:C-B);
    console.log((Math.abs(ans)>Math.pow(2,18)?"Unfair":ans));
    
});
//  [javascript]
process.stdin.resume();
process.stdin.setEncoding('utf8');

var lines = [];
var reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});
reader.on('line', (line) => {
  lines.push(line);
});
reader.on('close', () => {
    const [A,B,C,K] = lines[0].split(" ").map(v=>v);
    const ans = (K%2===0?A-B:B-A);
    console.log((Math.abs(ans)>Math.pow(2,18)?"Unfair":ans));
    
});
//  [javascript]
process.stdin.resume();
process.stdin.setEncoding('utf8');

var lines = [];
var reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});
reader.on('line', (line) => {
  lines.push(line);
});
reader.on('close', () => {
    const [A,B,C,K] = lines[0].split(" ").map(v=>BigInt(v));
    console.log((K%2n===0?A-B:B-A).toString());
    
});
//  [go]
package main

import "fmt"

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

	if k%2 == 1 {
		fmt.Println(b - a)
	} else {
		fmt.Println(a - b)
	}
}
//  [go]
package main

import (
	"fmt"
)

func main() {
	var A, B, C, K, ans int
	fmt.Scan(&A, &B, &C, &K)
	if K%2 == 0 {
		ans = A - B
	} else {
		ans = B - A
	}
	if ans > 1e18 || ans < -1e18 {
		fmt.Println("Unfair")
	} else {
		fmt.Println(ans)
	}
}
//  [go]
package main

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

var sc = bufio.NewScanner(os.Stdin)

func init() {
	const maxWord = (1 << 30)
	buf := []byte{}
	sc.Buffer(buf, maxWord)
	sc.Split(bufio.ScanWords)
}

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

func main() {
	a, _ := strconv.Atoi(input())
	b, _ := strconv.Atoi(input())
	strconv.Atoi(input())
	k, _ := strconv.Atoi(input())
	if k%2 == 0 {
		fmt.Println(a - b)
	} else {
		fmt.Println(b - a)
	}
}
//  [go]
package main

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

var sc = bufio.NewScanner(os.Stdin)

func main() {
	scanInit()

	a := nextInt()
	b := nextInt()
	c := nextInt()
	k := nextInt()


	ans := a - b
	if k%2 == 1 {
		ans = b - a
	}

	if abs(ans) > pow(10, 18) {
		fmt.Println("Unfair")
		return
	}

	fmt.Println(ans)

}
func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}
func pow(a, b int) int {
	var ret int = 1
	for b > 0 {
		if (b & 1) == 1 {
			ret *= a
		}
		a *= a
		b >>= 1
	}
	return ret
}

// ---- readfunc
func scanInit() {
	const cap = 200 * 1024 // Default=64
	var buf = make([]byte, cap)
	sc.Buffer(buf, cap)
	sc.Split(bufio.ScanWords)
	return
}
func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}
func nextStr() string {
	sc.Scan()
	return sc.Text()
}