jiahuimbzuai/CoQuIR huggingface dataset:
//  [java]
import java.io.IOException;
import java.io.InputStream;
import java.util.NoSuchElementException;
import java.lang.Math;

public class Main {
	public static void main(String[] args) {
		FS reader = new FS();
		// write reader
		int A = reader.nextInt();
		int B = reader.nextInt();
		solver(A, B);
	}
	
	public static void solver(int A, int B) {
		// write logic
		System.out.println(Math.max(Math.max(A+B, A-B), A*B));
	}
	
	// Read Class
	static class FS {
		private final InputStream in = System.in;
		private final byte[] buffer = new byte[1024];
		private int ptr = 0;
		private int buflen = 0;
		private boolean hasNextByte() {
			if (ptr < buflen) {
				return true;
			} else {
				ptr = 0;
				try {
					buflen = in.read(buffer);
				} catch (IOException e) {
					e.printStackTrace();
				}
				if (buflen <= 0) {
					return false;
				}
			}
			return true;
		}
	
		private int readByte() { return hasNextByte() ? buffer[ptr++] : -1;}
		private boolean isPrintableChar(int c) {return 33 <= c && c <= 126;}
		private void skipUnprintable() {while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;}
	
		public boolean hasNext() { skipUnprintable(); return hasNextByte();}
		public String next() {
			if (!hasNext()) throw new NoSuchElementException();
			StringBuilder sb = new StringBuilder();
			int b = readByte();
			while(isPrintableChar(b)) {
				sb.appendCodePoint(b);
				b = readByte();
			}
			return sb.toString();
		}
		public int nextInt() {
			return (int)nextLong();
		}
		public long nextLong() {
			if (!hasNext()) throw new NoSuchElementException();
			long n = 0;
			boolean minus = false;
			int b = readByte();
			if (b == '-') {
				minus = true;
				b = readByte();
			}
			if (b < '0' || '9' < b) {
				throw new NumberFormatException();
			}
			while(true) {
				if ('0' <= b && b <= '9') {
					n *= 10;
					n += b - '0';
				} else if(b == -1 || !isPrintableChar(b)) {
					return minus ? -n : n;
				} else {
					throw new NumberFormatException();
				}
				b = readByte();
			}
		}
	}
}
//  [java]
import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner stdIn = new Scanner(System.in);
		int A = stdIn.nextInt();
		int B = stdIn.nextInt();
		int ans1 = 0, ans2 = 0, ans3 = 0;
		int ans = 0;
		ans1 = A + B;
		ans2 = A - B;
		ans3 = A * B;
		if(ans1 > ans2){
			if(ans1 > ans3){
				ans = ans1;
			}
		}
		if(ans2 > ans1){
			if(ans2 > ans3){
				ans = ans2;
			}
		}
		if(ans3 > ans1){
			if(ans3 > ans2){
				ans = ans3;
			}
		}
		System.out.println(ans);
		stdIn.close();
	}
}
//  [java]
import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner stdIn = new Scanner(System.in);
		int A = stdIn.nextInt();
		int B = stdIn.nextInt();
		int ans1 = 0, ans2 = 0, ans3 = 0;

		ans1 = A + B;
		ans2 = A - B;
		ans3 = A * B;
		if(ans1 > ans2){
			if(ans1 > ans3){
				System.out.println(ans1);
			}
		}
		if(ans2 > ans1){
			if(ans2 > ans3){
				System.out.println(ans2);
			}
		}
		if(ans3 > ans1){
			if(ans3 > ans2){
				System.out.println(ans3);
			}
		}
		stdIn.close();
	}
}
//  [java]
import java.util.*; import java.io.*; import java.math.*;
public class Main{
	//Don't have to see. start------------------------------------------
	static class InputIterator{
		ArrayList<String> inputLine = new ArrayList<String>(1024);
		int index = 0; int max; String read;
		InputIterator(){
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			try{
				while((read = br.readLine()) != null){
					inputLine.add(read);
				}
			}catch(IOException e){}
			max = inputLine.size();
		}
		boolean hasNext(){return (index < max);}
		String next(){
			if(hasNext()){
				return inputLine.get(index++);
			}else{
				throw new IndexOutOfBoundsException("There is no more input");
			}
		}
	}
	static HashMap<Integer, String> CONVSTR = new HashMap<Integer, String>();
	static InputIterator ii = new InputIterator();//This class cannot be used in reactive problem.
	static PrintWriter out = new PrintWriter(System.out);
	static void flush(){out.flush();}
	static void myout(Object t){out.println(t);}
	static void myerr(Object t){System.err.print("debug:");System.err.println(t);}
	static String next(){return ii.next();}
	static boolean hasNext(){return ii.hasNext();}
	static int nextInt(){return Integer.parseInt(next());}
	static long nextLong(){return Long.parseLong(next());}
	static double nextDouble(){return Double.parseDouble(next());}
	static ArrayList<String> nextStrArray(){return myconv(next(), 8);}
	static ArrayList<String> nextCharArray(){return myconv(next(), 0);}
	static ArrayList<Integer> nextIntArray(){
		ArrayList<String> input = nextStrArray(); ArrayList<Integer> ret = new ArrayList<Integer>(input.size());
		for(int i = 0; i < input.size(); i++){
			ret.add(Integer.parseInt(input.get(i)));
		}
		return ret;
	}
	static ArrayList<Long> nextLongArray(){
		ArrayList<String> input = nextStrArray(); ArrayList<Long> ret = new ArrayList<Long>(input.size());
		for(int i = 0; i < input.size(); i++){
			ret.add(Long.parseLong(input.get(i)));
		}
		return ret;
	}
	static String myconv(Object list, int no){//only join
		String joinString = CONVSTR.get(no);
		if(list instanceof String[]){
			return String.join(joinString, (String[])list);
		}else if(list instanceof ArrayList){
			return String.join(joinString, (ArrayList)list);
		}else{
			throw new ClassCastException("Don't join");
		}
	}
	static ArrayList<String> myconv(String str, int no){//only split
		String splitString = CONVSTR.get(no);
		return new ArrayList<String>(Arrays.asList(str.split(splitString)));
	}
	public static void main(String[] args){
		CONVSTR.put(8, " "); CONVSTR.put(9, "\n"); CONVSTR.put(0, "");
		solve();flush();
	}
	//Don't have to see. end------------------------------------------
	static void solve(){//Here is the main function
		ArrayList<String> one = nextIntArray();
		int A = one.get(0);
		int B = one.get(1);
		int output = Math.max(A + B, Math.max(A - B, A * B));
		myout(output);
	}
	//Method addition frame start




	//Method addition frame end
}
//  [cpp]
#include <cstdio>
#include <algorithm>
int main() {
  int a, b;
  scanf("%d%d", &a, &b);
  printf("%d", std::max(std::max(a + b, a - b), a * b));
}
//  [cpp]
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<stdint.h>
#include<malloc.h>
#include<math.h>
#include<x86intrin.h>


int my_gets(char *buf,int nBuf,FILE *fp){
    int ch;

    while(--nBuf >0){
        ch=getc(fp);
        if(ch==EOF || ch=='\n')
            break;
        *(buf++)=(char)ch;
    }
    *(buf)='\0';

    return nBuf;
}

void InputIntAry(int *a,int nDigit,int N){      //nDigitは想定される最大桁数
    char *buf,*ptr;

    buf=(char*)malloc( (N*(nDigit+2)) * sizeof(char) );
    my_gets(buf,N*(nDigit+2),stdin);

    ptr=strtok(buf," ");
    while(ptr!=NULL && N-->0){
        *(a++)=atoi(ptr);
        ptr=strtok(NULL," ");
    }
    free(buf);
}

int CmpInt(const void *a, const void *b){        //b-aを返す(qsortなら4321)
    return *((int*)b)- *((int*)a);
}

typedef struct{
    int A,B;
} JobInfo_t;

int CmpJob(const void *p1, const void *p2){
    JobInfo_t Job1=*(JobInfo_t*)p1, Job2=*(JobInfo_t*)p2;

    if(Job1.A == Job2.A){
        return Job2.B - Job1.B;
    }
    else{
        return Job1.A - Job2.A;
    }
}

#define MAX_OF(a,b) (((a)>(b))?(a):(b))

int main(){
    int A,B;

    scanf("%d %d",&A,&B);
    printf("%d\n", MAX_OF(A+B,MAX_OF(A*B,A-B)));

    return 0;
}

/*int main(){
    int N,M;
    JobInfo_t Job[100000];

    scanf("%d %d%*c", &N, &M);
    for(int i=0;i<N;i++){
        scanf("%d %d%*c", &(Job[i].A), &(Job[i].B));
    }
    qsort(Job, N, sizeof(JobInfo_t), CmpJob);

    int allowed=0,max;
    for(int i=0;i<N;i++){
        
    }
    return 0;
} */
//  [cpp]
#include <stdio.h>
#include <stdlib.h>

int main() {
	int a,b;
	scanf("%d %d", &a, &b);
	int m = a+b;
	if (m < a-b) m = a-b;
	if (m < a*b) m = a*b;
	printf("%d", m);
	return 0;
}
//  [cpp]
#include<iostream>
using namespace std;
int main()
{
  int a,b;
  cin>>a>>b;
  if(a+b>=a*b&&a+b>=a-b){
    cout<<a+b;
  }
  else if(a-b>=a+B&&a-b>=a*b){
    cout<<a-b;
  }
  else if(a*b>=a+b&&a*b>=a-b){
    cout<<a*b;
  }
}
//  [cpp]
#include<iostream>
int main(){
  int a,b;
  std::cin>>a>>b;
  std::cout<<std::max({a*b,a+b,a-b});
}
//  [cpp]
#pragma GCC optimize("O3")

#define _GLIBCXX_DEBUG
#include <iostream>
#include <vector>
#include <string>
#include <string_view>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <cassert>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
using namespace std;

/*----------macros----------*/

//output================
#define endl '\n'
#define fcout(a) cout << fixed << setprecision((int)(a))

//typedef===============
typedef long long       ll;
typedef long double     ld;
typedef pair<int, int>  Pii;
typedef pair<ll, ll>    Pll;

//const number==========
constexpr ll INF9   = (ll)1e9 + 1;
constexpr ll INF18  = (ll)1e18 + 1;
constexpr ll MOD    = 1000000007;
constexpr ll MOD2   = 998244353;
constexpr ld PI     = 3.141592653589793L;

//member================
#define pb push_back
#define eb emplace_back
#define pf push_front
#define mp make_pair
#define fi first
#define se second

//others================
#define all(x)          (x).begin(), (x).end()
#define rall(x)         (x).rbegin(), (x).rend()
#define rep(i, n)       for(int i = 0; (i) < (n); ++(i))
#define reps(i, n)      for(int i = 1; (i) <= (n); ++(i))
#define rrep(i, n)      for(int i = n - 1; (i) >= 0 ; --(i))
#define repbit(bit, n)  for(int bit = 0; (bit) < (1 << (n)); ++(bit))
#define ifbit(bit, i)   if((bit) & (1 << (i)))
#define CtoI(c)         int((c)) - int('0')
#define ItoC(c)         char((c) + '0')

//functions=============
template<typename T1, typename T2>
inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }

template<typename T1, typename T2>
inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }

//vector<int> dx = {1, 0, -1, 0}, dy = {0, 1, 0, -1};
//vector<int> dx2 = { 1,1,0,-1,-1,-1,0,1 }, dy2 = { 0,1,1,1,0,-1,-1,-1 };

/*--------additional--------*/



/*----------main------------*/

int main() {
/*----------fastio----------*/
    std::cin.tie(nullptr);
    std::cout.tie(nullptr);
    std::ios::sync_with_stdio(false);
/*----------solve-----------*/

    int a, b; cin >> a, b;
    cout << max(a + b, max(a - b, a * b)) << endl;

return 0;
}
//  [c]
#include <stdio.h>
int main(void){
    int a,b, ans;
    scanf("%d %d", &a, &b);
    int p = a + b;
    int m = a - b;
    int k = a * b;
    if (m > p) {
        if (m > k) {
            ans = m;
        } else {
            ans = k;
        }
    } else {
        if (p > k) {
            ans = p;
        } else {
            ans = k;
        }
    }
    printf("%d", ans);
    return 0;
}
//  [c]
#include<stdio.h>

int main(void){
    int A,B;
    int a[3],max;
    scanf("%d %d",&A,&B);
    a[0] = A+B;
    a[1] = A-B;
    a[2] = A*B;
    max = a[0];
    for(int i=0;i<3;i++){
        if(max < a[i]) max = a[i];
    }
    printf("%d",max);
    return 0;
}
//  [c]
#include <stdio.h>

int main (void) {
    int a, b;
    scanf("%d%d", &a, &b);

    if ( a + b > a - b  ) {
        if ( a + b > a * b ) {
            printf("%d\n", a + b);
        }
        else {
            printf("%d\n", a * b);
        }
    }
    else {
        if ( a - b > a * b ) {
            printf("%d\n", a - b);
        }
        else {
            printf("%d\n", a * b);
        }
    }
    return 0;
}
//  [c]
#include<stdio.h>
#include<string.h>

int main()
{
   int k,x; //x is black //k is number
   scanf("%d %d",&k,&x)
   for(int i=x-k+1;i<=x+k-1;i++){
		printf("%d ",i);
	}
}
//  [c]
#include <stdio.h>
int main(){
int a,b,c,d,e,max=-1000;
scanf ("%d%d",&a,&b);
c=a+b;
d=a-b;
e=a*b;
if (max<c){
max=c;
}
if (max<d){
max=d;
}
if (max<e){
max=e;
}
printf("%d",max)
return 0;
}
//  [c]
#include<stdio.h>
int main()
{
    int a,b,sum,mul,subs,arr[3];
    while(scanf("%d%d",&a,&b)==2)
    {
        sum=a+b;
        subs=a-b;
        mul=a*b;
        
        if(sum>=subs&&sum>=mul)
            printf("sum\n");
        else if(subs>=sum&&subs>=mul)
            printf("subs\n");
        else
            printf("mul\n");
    }
    return 0;
}
//  [javascript]
function main(input) {
  const args = input.split(' ');
  const a = parseInt(args[0], 10);
  const b = parseInt(args[1], 10);
  
  var max = a + b;
  if(max < a - b) {
    max = a - b;
  }
  if(max < a * b) {
    max = a * b;
  }
  console.log(max)
  
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
'use strict';(function(input){
  
  input=input.trim().split(/\s+/).map(x=>x-0);
  const A=input[0],
        B=input[1];
  console.log(Math.max(A+B,A-B,A*B));
})(require('fs').readFileSync('/dev/stdin','utf8'));
//  [javascript]
function Main(input) {
    input = input.trim()
  input = input.split(" ").map(Number);
  console.log(Math.max(input[0]+input[1],input[0]-input[1],input[0]*input[1]))
}Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main(input) {
  input = input.split(" ");
  var k = Number(input[0]);
  var x = Number(input[1]);
  var floor = x-k+1;
  var ceiling = x+k-1;
  var output = "";
  
  if(floor<-10000){
    floor=-10000;
  }

  if(ceiling>10000){
    ceiling=10000;
  }

  for(var i = floor ; i<= ceiling ; i++){
    output = output + String(i) + " ";
  }

  output = output.trim();

  console.log(output);
}
 
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main(input) {
  input = input.split(" ");
  var a = input[0];
  var b = input[1];
  console.log(Math.max(a+b,a-b,a*b));
}
 
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main(input) {
  input = input.split(" ");
  var a = input[0];
  var b = input[1];
  console.log(math.max(a+b,a-b,a*b));
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [go]
package main

import (
  "fmt"
)

func maxInt(a ...int) int {m := a[0]; for _, x := range a {if x > m {m = x}}; return m}
func minInt(a ...int) int {m := a[0]; for _, x := range a {if x < m {m = x}}; return m}

func main() {
  var a, b int
  fmt.Scan(&a, &b)
  fmt.Println(maxInt(a+b, a-b, a*b))
}
//  [go]
package main

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

const (
	defaultBufferSize = 1024
	maxBufferSize     = 1e6
	Mod               = 1e9 + 7
)

var sc = bufio.NewScanner(os.Stdin)

// sc.Buffer(make([]byte, defaultBufferSize), maxBufferSize)

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

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

func readInt64() int64 {
	sc.Scan()
	i, err := strconv.ParseInt(sc.Text(), 10, 64)
	if err != nil {
		panic(err)
	}
	return int64(i)
}

func readfloat64() float64 {
	sc.Scan()
	f, err := strconv.ParseFloat(sc.Text(), 64)
	if err != nil {
		panic(err)
	}
	return f
}

func abs(a int) int {
	if a < 0 {
		return a * -1
	}
	return a
}

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

func gcd(x, y int) int {
	if y == 0 {
		return x
	}
	return gcd(y, x%y)
}

func ModComb(n, k int) int {
	if k == 0 {
		return 1
	}
	x, y := n, k
	for i := 1; i < k; i++ {
		x = x * (n - i) % Mod
		y = y * (k - i) % Mod
	}
	inv := ModInv(y)
	return x * inv % Mod
}

func ModFact(x int) int {
	fact := 1
	for i := 1; i <= x; i++ {
		fact = fact * i % Mod
	}
	return fact
}

func ModInv(x int) int {
	return ModPow(x, Mod-2)
}

func ModPow(a, n int) int {
	res := 1
	for n > 0 {
		if n%2 != 0 {
			res = res * a % Mod
		}
		a = a * a % Mod
		n /= 2
	}
	return res
}

func pow(a, n int) int {
	if n == 0 {
		return 1
	}

	ans := 0
	if n%2 == 0 {
		ans = pow(a*a, n/2)
	} else {
		ans = a * pow(a*a, (n-1)/2)
	}
	return ans
}

func intSliceReverse(slice []int) []int {
	for i, j := 0, len(slice)-1; i < j; i, j = i+1, j-1 {
		slice[i], slice[j] = slice[j], slice[i]
	}
	return slice
}

func stringReverse(str string) string {
	runes := []rune(str)
	for i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {
		runes[i], runes[j] = runes[j], runes[i]
	}
	return string(runes)
}

func primeFactorization(x int) map[int]int {
	result := make(map[int]int, 0)
	for i := 2; i*i <= x; i++ {
		for x%i == 0 {
			result[i]++
			x /= i
		}
	}
	if x != 1 {
		result[x]++
	}
	return result
}

func isPrime(x int) bool {
	if x == 1 {
		return false
	}
	for i := 2; i*i <= x; i++ {
		if i == x {
			continue
		}
		if x%i == 0 {
			return false
		}
	}
	return true
}

func main() {
	sc.Split(bufio.ScanWords)
	a, b := readInt(), readInt()

	ans := -201
	ans = max(ans, a+b)
	ans = max(ans, a-b)
	ans = max(ans, a*b)
	fmt.Println(ans)
}

func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}
//  [go]
package main

import "fmt"

func main() {
	var a, b int
	fmt.Scanf("%d %d", &a, &b)

	max := a + b
	if a-b > max {
		max = a - b
	}
	if a*b > max {
		max = a * b
	}

	fmt.Println(max)
}
//  [go]
package main

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

func main() {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)

	sc.Scan()
	a, _ := strconv.Atoi(sc.Text())

	sc.Scan()
	b, _ := strconv.Atoi(sc.Text())

	l := []int{a + b, a - b, a * b}
	sort.Slice(l, func(i, j int) bool {
		return l[i] < l[j]
	})

	sort.Ints(l)

	fmt.Println(l[2])
}
//  [go]
package main

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

func main() {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)

	sc.Scan()
	a, _ := strconv.Atoi(sc.Text())

	sc.Scan()
	b, _ := strconv.Atoi(sc.Text())

	l := []int{a + b, a - b, a * b}
	sort.Slice(l, func(i, j int) bool {
		return l[i] < l[j]
	})

	fmt.Println(l[2])
}
//  [go]
// by https://atcoder.jp/contests/abc070/tasks/abc070_c
package main

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

var sc = bufio.NewScanner(os.Stdin)

func main() {
	var headTmp = nextLine()
	// fmt.Println(headTmp)
	var head = strings.Split(headTmp, " ")
	// fmt.Println(head)

	var N int
	var M int
	N, _ = strconv.Atoi(head[0])
	M, _ = strconv.Atoi(head[1])
	var A []int
	var B []int
	// var BB []int
	for i := 0; i < N; i++ {
		var bodyTmp = nextLine()
		// fmt.Println(bodyTmp)

		var body = strings.Split(bodyTmp, " ")
		var a, _ = strconv.Atoi(body[0])
		var b, _ = strconv.Atoi(body[1])
		A = append(A, a)
		B = append(B, b)
		// i=1~Mまでaがiより小さいか確かめる
		// １より小さいならばbを取得
		// その中で一番大きいbを取得
	}
	// fmt.Println(B)
	// sort.Sort(sort.Reverse(sort.IntSlice(B)))
	// fmt.Println(B)
	// var resA []int
	// var resB []int
	var totalMoney int

	for j := 1; j < M+1; j++ {
		// fmt.Println("j", j)

		var maxIndex int
		var maxB int

		for i := 0; i < N; i++ {
			// fmt.Println("i", i)

			// j日後より短い中で
			if A[i] <= j {
				//　価値が最大の仕事を探す
				if B[i] > maxB {
					maxIndex = i
					// fmt.Println("maxIndex", maxIndex)

					maxB = B[i]
					// fmt.Println("maxB", maxB)
				}
				// var bb = B[i]
				// BB = append(BB, bb)
			}

		}
		// resA = append(resA, A[maxIndex])
		// resB = append(resB, maxB)

		if maxB > 0 {
			totalMoney += maxB

			B[maxIndex] = 0
			// fmt.Println("maxIndex", maxIndex)

			// fmt.Println("B", B)
		}

		// A[maxIndex] = 0
		// fmt.Println("A[maxIndex]", A[maxIndex])

		// A = delete(A, maxIndex)
		// B = delete(B, maxIndex)
		//N--
		// fmt.Println(M)
		// fmt.Println("B:", B)
		// // sort.Sort(sort.Reverse(sort.IntSlice(B)))
		// // fmt.Println("sort:", B)
		// fmt.Println("BB:", BB)
		// fmt.Println("max=", maxInt(BB))

		// B = B[1:]
		// B = append(B, 0)

		// fmt.Println("B:", B)
		// BB = nil

		// fmt.Println("A:", A)
		// fmt.Println("s:", delete(A, 0))
		// fmt.Println(totalMoney)

	}
	// fmt.Println("A:", resA)
	// fmt.Println("B:", resB)
	fmt.Println(totalMoney)

	// fmt.Println("A:", A[0])
	// fmt.Println("B:", B)

	// fmt.Println("N:", N)
	// fmt.Println("M:", M)
}

func delete(s []int, i int) []int {
	x := append(s[:i], s[i+1:]...)
	return x
}

func maxInt(a []int) int {
	sort.Sort(sort.IntSlice(a))
	return a[len(a)-1]
}

func nextLine() string {
	sc.Scan()
	return sc.Text()
}
//  [ruby]
A, B = gets.split(" ").map(&:to_i)
# S = gets.chomp
# N = gets.to_i

puts [A+B, A-B, A*B].max
//  [ruby]
a, b = gets.split.map(&:to_i)

puts [a+b, a-b, a*b].max
//  [ruby]
a, b = gets.split.map(&:to_i)
answers = []
answers << a + b
answers << a - b
answers << a * b
puts answers.max
//  [ruby]
a,b = gets.split.map(&:to_i)

i=a+b
j=a-b
k=a*b

if i > j && i> k then
    puts(i)
elsif j > i && j > k then
    puts(j)
else
    puts(k)
end
//  [ruby]
a, b = gets.split.map(&:to_i)

i = a+b
j = a-b
k = a*b

if i>j && i>k
    puts i
elsif j>i && j>k
    puts j
else
    puts k
end
//  [ruby]
A = gets.to_i
B = gets.to_i

puts [A + B, A - B, A * B].max
//  [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")
    };
}

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

fn f(s: &[char]) -> bool {
    let m = s.len();
    for i in 0..m {
        if s[i] != s[m - 1 - i] {
            return false;
        }
    }
    true
}

use std::iter::Iterator;
use std::cmp;

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

    let t = cmp::max(a + b, a -b);
    let tt = cmp::max(t, a * b);

    println!("{}", tt);

}
//  [rust]
use std::io;

fn main () {
	let mut buf = String::new();
	io::stdin().read_line(&mut buf).expect("");
	let mut iter = buf.split_whitespace();
	let a:i32 = match iter.next().unwrap().parse() {
		Ok(n) => n,
		_ => panic!(""),
	};
	let b:i32 = match iter.next().unwrap().parse() {
		Ok(n) => n,
		_ => panic!(""),
	};
	let ar = [a+b, a-b, a*b];
	println!("{}", ar.iter().max().unwrap());
}
//  [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: i32,
        b: i32
    }
    println!("{}", std::cmp::max(std::cmp::max(a+b,a-b),a*b));
}
/* vim:set foldmethod=marker: */
//  [rust]
use std::cmp;

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)*}
    };
}

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)*}
    };
}

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! {
    	n:usize,
        m:usize
    }
       
    println!("{}", cmp::max(cmp::max(n+m, n-m), n*m));
}
//  [rust]
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)*}
    };
}

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)*}
    };
}

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! {
    	n:usize,
        m:usize
    }
       
    println!("{}", max(max(n+m, n-m), n*m));
}
//  [rust]
use proconio::input;

fn main() {
    input!{
        n:i32,
        m:i32,
    }
    println!("{}", vec![n+m, n*m, n-m].iter().fold(n+m, |ans, x| std::cmp::max(ans, *x)));
}
//  [swift]
func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}
 
let ab=readInts()
let a=ab[0]
let b=ab[1]

let nums=[a+b,a-b,a*b]
print(nums.max()!)
//  [swift]
func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

func main() {
    let ab = readInts()
    let a = ab[0]
    let b = ab[1]
    
    print([a + b, a - b, a * b].sorted(by: >)[0])
}

main()
//  [swift]
func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}
let ab=readInts()
let a=ab[0]
let b=ab[1]
print(max(a+b,a-b,a*b))
//  [swift]
func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}
let ab=readInts()
let a=ab[0]
let b=ab[1]
print(max(a+b,a-b.a*b))
//  [typescript]
'use strict'
function main(input: string) {
    const [a, b] = input.split(' ').map(Number);
    console.log(Math.max(a+b, a-b, a*b));
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [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(max(a+b,a-b,a*b)+0)
}
main()
//  [typescript]
import * as fs from 'fs'

const stdin = fs.readFileSync('/dev/stdin', 'utf8').trim();
const input = stdin
	.split('\n')[0]
	.split(' ')
	.map(Number);

const a = input[0];
const b = input[1];

function solve(a: number, b: number): number {
	const plus = a + b;
	const minus = a - b;
	const multiply = a * b;
	const max = Math.max(plus, minus, multiply);
	return max;
}

export default solve;

console.log(solve(a, b));
//  [typescript]
import * as fs from 'fs';

//in
//
//out
//
const main = (inp: string) => {
    const [a, b]: number = inp.split('\n').map(Number);
    // a+b
    // a-b
    // a*b
    const ans1: number = a + b;
    const ans2: number = a - b;
    const ans3: number = a * b;

    if (ans1 >= ans2 && ans1 >= ans3) {
        console.log(ans1);
    }
    if (ans2 >= ans1 && ans2 >= ans3) {
        console.log(ans2);
    }
    if (ans3 >= ans1 && ans3 >= ans2) {
        console.log(ans3);
    }

};

main(fs.readFileSync('/dev/stdin', 'utf8').trim());
//  [typescript]
import * as readline from "readline";

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

const lines = [];
rl.on("line", (line) => {
    lines.push(line);
});
rl.on("close", () => {
    main(lines);
});

function main(lines) {
    const [k, x] = lines[0].split(' ').map(n => parseInt(n));
    const nums = new Array(2 * k - 1).fill(0).map((_, i) => x - (k - 1) + i);
    console.log(nums.join(' '));
}
//  [python]
s=int(input())
L=[1,1,1]
if s<3:
  print(0)
elif s<6:
  print(1)
elif 6<=s:
  for i in range(s-5):
    L.append((L[-1]+L[-3])%(10**9+7))
  print(L[-1])
//  [python]
S = int(input())
DP = [0]*(S+1)
Mod = 10**9+7
if S>=3:
    DP[0] = 1
    DP[1] = 0
    DP[2] = 0
    for TS in range(3,S+1):
        DP[TS] = (DP[TS-1]+DP[TS-3])%Mod
    print(DP[S])
else:
    print(0)
//  [python]
def main():
    MOD = 10 ** 9 + 7

    S = int(input())
    dp = [0] * (S + 1)
    dp[0] = 1

    acc = 0
    for x in range(3, S + 1):
        dp[x] = (acc := (acc + dp[x - 3]) % MOD)

    print(dp[S])


if __name__ == '__main__':
    main()
//  [python]
S = int(input())

if S < 3:
    print(0)
    exit()

ans = [0 for _ in range(S+1)]

ans[3] = 1
ans[4] = 1
ans[5] = 1

for i in range(6, S+1):
    ans[i] = ans[i-3] + ans[i-1]

print(ans[S] % 1000000007)
//  [python]
S=int(input())
ans=[0]*(S+1)
MOD=10**9+7

if S<=2:
    print(0)
    exit(0)

ans[3]=1
for i in range(4,S+1):
    ans[i]=ans[i-1]+ans[i-3]

print(ans[i]%MOD)
//  [python]
n = int(input())
S = n//3

def combination(n, r, mod=10**9+7):
    r = min(r, n-r)
    res = 1
    for i in range(r):
        res = res * (n - i) * pow(i+1, mod-2, mod) % mod
    return res
 
ans = 0
if S>=1:
  for i in range(1,S+1):
    t = n - 3*i
    ans += combination(t+i-1,i-1)
  print(ans)
    
    
else:
  print(0)
//  [java]
import java.util.*;
import java.io.*;
import static java.lang.Math.*;

public class Main {
    public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		
		// 入力
		int s = sc.nextInt();
		int MOD = 1000000007;
		
		// 計算
		long result = 1;
		long[] list = new long[2001];
		list[3] = 1;
		list[4] = 1;
		list[5] = 1;
		long[] sum = new long[2001];
		sum[3] = 1;
		sum[4] = 2;
		sum[5] = 3;
		for(int i = 6; i <= s; i++){
		   list[i] = sum[i-3] + 1;
		   list[i] %= MOD;
		   sum[i] = sum[i-1] + list[i];
		   sum[i] %= MOD;
		}
		
		result = list[s];
		
		// 出力
		System.out.println(result);
	}
	
	public static class Scanner {
		private BufferedReader br; private StringTokenizer tok;
		public Scanner(InputStream is) throws IOException { br = new BufferedReader(new InputStreamReader(is));}
		private void getLine() throws IOException { while(!hasNext()) tok = new StringTokenizer(br.readLine());}
		private boolean hasNext() { return tok != null && tok.hasMoreTokens();}
		public String next() throws IOException { getLine(); return tok.nextToken();}
		public int nextInt() throws IOException { return Integer.parseInt(next());}
		public long nextLong() throws IOException { return Long.parseLong(next());}
		public double nextDouble() throws IOException { return Double.parseDouble(next());}
	}

}
//  [java]
import java.util.*;
import java.io.*;
public class Main {

	public static void main(String[] args) throws Exception{
		long num = 1000000007;
		long[] fact = new long[2001];
 		fact[0] = 1;
 		long ans1 = 1;
 		for(int i = 1;i<=2000;i++){
 			ans1= (ans1*i) % num;
 			fact[i] = ans1;
 		}
 		long[] inv = new long[2001];
 		inv[0] = 1;
 		for(int i = 1;i<=2000;i++){
 			inv[i] = power(fact[i], num-2, num)%num;
 		}
		// TODO Auto-generated method stub
 		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
 		PrintWriter out = new PrintWriter(System.out);
 		int s = Integer.parseInt(bf.readLine());
 		long sum = 0;
 		if (s >= 3)
 			sum = 1;
 		int count = 1;
 		for(int j = 5;j<=s;j+=2){
 			if (s-j >= count){
 				long prod = 1;
 				prod*=fact[s-j];
 				prod%=num;
 				prod*=inv[count];
 				prod%=num;
 				prod*=inv[s-j-count];
 				prod%=num;
 				sum+=prod;
 				sum%=num;
 			}
 			count++;
 		}
 		
 		
 		out.println(sum);
	 		
 		out.close();
 		
 		
 		
 	}
	public static int power(long x, long y, long mod){
		long ans = 1;
		while(y>0){
			if (y%2==1)
				ans = (ans*x)%mod;
			x = (x*x)%mod;
			y/=2;
		}
		return (int)(ans);
	}
}
 	
 
//StringJoiner sj = new StringJoiner(" "); 
//sj.add(strings)
//sj.toString() gives string of those stuff w spaces or whatever that sequence is
//  [java]
import java.util.*;
public class Main {
    public static long mod(long x, long y){
    return x%y<0?x%y+(y<0?-y:y):x%y;
    }
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		long [] in = new long [a+1]; 
        in[0]=1;
		long b = 1000000007;
      
        for(int i=3;i<=a;i++){
          for(int j=0;j<=i-3;j++){in[i]+=in[j];
                                                     in[i]=mod(in[i],b)
                                 }
                             }        
		System.out.println(in[a]);
	}
}
//  [java]
import java.util.*;

/**
 * D Main
 *
 * @date 2020.09.19
 * @author 焼き鮭 <yaki-shake@up-tri.me>
 */

public class Main {
  Scanner sc;
  int MIN = 3;
  int MOD = 1000000007;

  long[] dist = new long[2000];

  public static void main(String[] args) {
    new Main().execute();
  }

  public void execute() {
    this.sc = new Scanner(System.in);
    int s = this.sc.nextInt();
    if (s <= 2) {
      System.out.println(0);
      return;
    }
    System.out.println(distribute(s));
  }

  public long distribute(int a) {
    long sum = 1;
    if (dist[a] != 0) {
      return dist[a];
    }
    for (int c = MIN; c <= (a - MIN); c++) {
      sum = (sum + distribute(c)) % MOD;
    }
    dist[a] = sum;

    return sum;
  }
}
//  [java]
//package Test;

import java.util.*;

public class Main {

    static class Solution {

        void solve(int s){
            int mod = 1000000007;
            int[] dp = new int[s + 1];
            dp[3] = 1;
            for(int i = 4; i <= s; i++) {
                for(int j = 3; j <= i - 3; j++) {
                    dp[i] = (dp[i] + dp[j]) % mod;
                }
                dp[i] = (dp[i] + 1) % mod;
            }
            System.out.println(dp[s]);
        }
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int s = scanner.nextInt();
        Solution solution = new Solution();
        solution.solve(s);

    }
}
//  [cpp]
#include<bits/stdc++.h>
using namespace std;
#define ll              long long int
#define ull             unsigned long long int
#define mod             1000000007 
#define pb              push_back
#define mp              make_pair
#define count_1(n)      __builtin_popcountll(n) //set bits
#define fr              first
#define sc              second

bool isPrime(ll n) {

  if (n == 1) {
    return false;
  }

  for (ll i = 2; i*i <=n; i++) {
    if (n % i == 0) return false;
  }

  return true;
}

 
   
ll power(ll x, ll y, ll p)  
{  
    ll res = 1;     
    x = x % p;  
                
    if (x == 0) return 0;  
  
    while (y > 0)  
    {  
        if (y & 1)  
            res = (res*x) % p; 
        y = y>>1; 
        x = (x*x) % p;  
    }  
    return res;  
} 

int binarySearch(int arr[], int l, int r, int x) 
{ 
    if (r >= l) { 
        int mid = l + (r - l) / 2; 
  
        if (arr[mid] == x) 
            return mid; 
  
        if (arr[mid] > x) 
            return binarySearch(arr, l, mid - 1, x); 
  
        return binarySearch(arr, mid + 1, r, x); 
    } 
  
    return -1; 
} 



int main(){
    
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    ll n,sum=0;
    cin>>n;
    ll dp[n+1];
    dp[0]=1;
    dp[1]=0;
    dp[2]=0;
    for(int i=3;i<=n;i++){
        sum+=dp[i-3];
        sum%=mod;
        dp[i]=sum;
    }
    cout<<dp[n];
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
#define ll long long
ll dp[1000000+5];
ll arr[1000000+5];
/*arr[0]=1;
dp[0]=1;*/
int main()
{
    /*ll n,x=1,i;
    cin>>n;
    ll mod=1000000007;
    ll dp[n+2]
    for(i=1;i<=n-1;i++)
    {
        x=x*2;
        x=x%mod;
    }
    x=x+n-1;
    x=x%mod;
    cout<<x;*/
    /*ll n;
    cin>>n;
    ll a[n],i;
    for(i=0;i<n;i++)
    {
        cin>>n;
    }*/
    ll n,i;
    cin>>n;
    ll mod=1000000007;
    ll dp[n+10];
    dp[0]=dp[1]=dp[2]=0;
    dp[3]=dp[4]=dp[5]=1;
    for(i=6;i<=n;i++)
    {
        dp[i]=(dp[i-1]+dp[i-3])%mod;
    }
    cout<<dp[n];
}
//  [cpp]
#include<iostream>
#include<cstring>
#include<vector>
#include<sstream>
#include<cmath>
#include<algorithm>
#include<bitset>
#include<map>
#include<utility>
#include<climits>
#include<set>
using namespace std;
#define ll long long

ll mod=1000000007;

ll dp[2005];
ll ans(int n)
{
	if(n==1 or n==2)
		return 0LL;
	else if(n==0)
		return 1LL;
	else if(dp[n]!=-1)
		return dp[n];
	else if(n==3 or n==4 or n==5)
		return 1LL;
	else
	{
		ll total=0;
		for(int i=3;i<=n;i++)
		{
			if(n-i>=0)
			total+=(ans(n-i)%mod);
		}
		return dp[n]=total;
	}
}
int main(){ 
	ios_base::sync_with_stdio(false);
	    cin.tie(0);
	    cout.tie(0);
	    
	#ifndef ONLINE_JUDGE
	    freopen("input.txt","r",stdin);
	    freopen("output.txt","w",stdout);
	#endif

	    memset(dp,-1,sizeof(dp));
	    dp[0]=0;
	    int n;cin>>n;
	    cout<<ans(n);
}
//  [cpp]
#include <iostream>
#include <string>
#include <set>
#include <algorithm>
#include <map>
#include <vector>
#include <cstdio>
#include <cmath>

#define endl '\n'

using namespace std;


void solve() {
	int n;
	cin >> n;
	if (n == 0) {
		cout << "1" << endl;
	} else {
		int arr[n], mod = 1000000007;
		arr[0] = 0; arr[1] = 0; arr[2] = 1;
		for (int i = 3; i < n; i++) {
			arr[i] = (arr[i - 1] + arr[i - 3]) % mod;
		}
		cout << arr[n - 1] << endl;
	}
}

int main() {
	int T = 1;
	cin >> T;
	while (T--) {
		solve();
	}
	return 0;
}
//  [cpp]
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = 1e9 + 7;
ll S[2007];
int main()
{
    ll N;
    cin >> N;
    if(N<=2) cout << 0 << endl;
    else {
        ll ans  = 0;
        S[0] = 1;
        for(ll i=1;i<=N;i++)
        {
            S[i] = S[i-1]+S[max(0ll,i-3)];
            S[i] %= MOD;
        } cout << S[N-5] << endl;
    }
}
//  [c]
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <stdbool.h>
typedef long long LL;
typedef long double Lf;
#define in (void)scanf
#define Rep(i,a,n)for(int i=(int)(a);i<(int)(n);i++)
//#define Rep(i,a,n)for(LL i=(LL)(a);i<(LL)(n);i++)
#define rep(i,n)Rep(i,0,n)
#define Repp(i,l,r,k)for(int i=(int)(l);i<(int)(r);i+=(int)(k))
//#define Repp(i,l,r,k)for(LL i=(LL)(l);i<(LL)(r);i+=(LL)(k))
#define Ma(x,y) ((x)>(y)?(x):(y))
#define mi(x,y) ((x)<(y)?(x):(y))
#define MOD 1000000007//998244353,1000000007,1000000009,4999999999999997
int upi(const void* a, const void* b) { return*(int*)a<*(int*)b ? -1 : *(int*)a> * (int*)b ? 1 : 0; }
int downi(const void* a, const void* b) { return*(int*)a<*(int*)b ? 1 : *(int*)a> * (int*)b ? -1 : 0; }
void sortupi(int* a, int n) { qsort(a, n, sizeof(int), upi); } //1,2,3,4,...
void sortdowni(int* a, int n) { qsort(a, n, sizeof(int), downi); }
int upLL(const void* a, const void* b) { return*(LL*)a<*(LL*)b ? -1 : *(LL*)a> * (LL*)b ? 1 : 0; }
int downLL(const void* a, const void* b) { return*(LL*)a<*(LL*)b ? 1 : *(LL*)a> * (LL*)b ? -1 : 0; }
void sortupLL(LL* a, int n) { qsort(a, n, sizeof(LL), upLL); }
void sortdownLL(LL* a, int n) { qsort(a, n, sizeof(LL), downLL); }
int cmp_char(const void* a, const void* b) { return *(char*)a - *(char*)b; } // a,b,c,d
int cmp_str(const void* a, const void* b) { return strcmp(*(const char**)a, *(const char**)b); } // aaa,aab
LL gcd(LL p, LL q) { while (q) { LL t = p % q; p = q; q = t; }return p; }
LL modpow(LL a,LL n,LL m){LL x=1;for(a%=m;n;n/=2)n&1?x=x*a%m:0,a=a*a%m;return x;}
#define invmodpow(b,p)modpow(b,p-2,p)// a/b≡a*b^{-1}(mod p)...return b^{-1}(mod p)
//typedef struct fac { LL n, exp; }F;
//LL fact(LL n,F*a){LL x=n,i,j,c=0;for(i=2;i*i<=x;i++){for(j=1;x%i==0;j++)x/=i;if(j>1){a[c].n=i;a[c++].exp=j-1;}}if(x-1){a[c].n=x;a[c++].exp=1;}return c;}
LL nibtan(LL* a,LL n,LL x){LL p=0,q=n/2,r=n-1;while(r-p>1){if(x>=a[q])p=q;if(x<=a[q])r=q;q=(p+r)/2;}return a[p]==x?p:r;}
//snippet

#define N 2009

void run(void) {
	LL s, ans = 0;
	in("%lld", &s);
	if (s > 2) {
		LL factorial[N] = { 1 };
		Rep(i, 1, N)factorial[i] = factorial[i - 1] * i % MOD;
		Rep(n, 1, 1 + s / 3) {
			ans += ((factorial[s - 2 * n - 1] % MOD * invmodpow(factorial[n - 1], MOD)) % MOD) * invmodpow(factorial[s - 3 * n], MOD) % MOD;
			ans %= MOD;
		}
	}
	printf("%lld\n", ans);
}

int main(void) {
	int test = 1;
//	in("%d", &test);
	while (test--) {
		run();
		fflush(stdout);
	}
	return 0;
}
//  [c]
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k))
#define INF ((1LL<<62)-(1LL<<31))
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
#define bit(n,m)(((n)>>(m))&1)
int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;}
int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;}
void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);}
void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);}
ll pom(ll a,ll n,int m){ll x=1;for(a%=m;n;n/=2)n&1?x=x*a%m:0,a=a*a%m;return x;}
//#define MOD 998244353
#define MOD 1000000007
#define invp(a,p)pom(a,p-2,p)

ll a[2010];
ll cum[2010];
int main(){
	ll n;
	scanf("%lld",&n);
	a[0]=1;
	cum[0]=1;
	rep(i,3,n+1){
		a[i]=cum[i-3];
		cum[i]=(cum[i-1]+a[i])%MOD;
		//printf("%d %d %d\n",i,a[i],cum[i]);
	}
	printf("%lld",cum[n]);
}
//  [c]
#include <stdio.h>
int main(void) {
  int s;
  scanf("%d", &s);
  long long dp[s];
  for (int i = 0; i <= s; i++) {
    if (i < 3)
      dp[i] = 0;
    else if (i == 3)
      dp[i] = 1;
    else
      dp[i] = dp[i - 3] + dp[i - 1];
    dp[i] %= 1000000007;
  }
  printf("%lld\n", dp[s]);
  return 0;
}
//  [c]
#include<stdio.h>
#include<string.h>

#define mod 1000000007

long long int c_n = 1, c_r = 1, c_n_r = 1;
long long int g_current_answer = 0;

long long int multiple(long long int target, long long int p)
{
    long long int curretn_answer = 0;

    if (p == 0)
    {
        return 1;
    }

    if (p%2 == 0)
    {
        curretn_answer = multiple(target, (p/2))*multiple(target, (p/2));
        curretn_answer %= mod;
    } else {
        curretn_answer = multiple(target, ((p-1)/2))*multiple(target, ((p-1)/2));
        curretn_answer %= mod;
        curretn_answer *= target;
        curretn_answer %= mod;
    }

    return curretn_answer;
}

long long int cul_array_num(int array_num, int free_q)
{
    long long int current_answer = 0;

    if (array_num == 1)
    {
        return 1;
    } else if (array_num == 2){

        for (int i = 1; i<= (array_num -1 + free_q); i++)
        {
            c_n *= i;
            c_n %= mod;

            if (i<=free_q)
            {   
                c_r *= i;
                c_r %= mod;
            }

            if (i<=(array_num - 1))
            {
                c_n_r *= i;
                c_n_r %= mod;
            }
        }

        current_answer = c_n*multiple((c_r*c_n_r)%mod, (mod-2));
        current_answer %= mod;
        g_current_answer = current_answer;
    } else {

        long long int tmp = 0;

        for (int i = 1; i <= 3; i++)
        {
            g_current_answer *= (free_q + i);
            g_current_answer %= mod;
        }

        tmp = (array_num*(array_num + free_q +1))%mod;
        tmp *= (array_num+free_q);
        tmp %= mod;

        g_current_answer *= multiple(tmp, (mod-2));
        g_current_answer %= mod;

        current_answer = g_current_answer;

    }

    return current_answer;

}

int main()
{
    int s, div = 0;
    long long int answer = 0;

    scanf("%d", &s);

    div = s/3;

    for (int i = 1; i <= div; i++)
    {
        answer += cul_array_num(i, (s - i*3));
    }

    answer %= mod;

    printf("%lld", answer);

    return 0;
}
//  [c]
#include <stdio.h>
#include <stdlib.h>

int main (void) {
    int n;
    scanf("%d", &n);
    long int a[n + 1];

    if (n == 1 || n == 2) {
        printf("0\n");
    } else {
        a[0] = 1;
        a[1] = 0;
        a[2] = 0;
        for (int i = 3; i <= n; i++) {
            a[i] = a[i - 1] + a[i - 3];
            if (a[i] >= 1000000007) {
                a[i] %= 1000000007;
            }
        }
    }
    printf("%ld\n", a[n]);
    return 0;
}
//  [c]
#include <stdio.h>
#include <stdlib.h>

int main (void) {
    int n;
    scanf("%d", &n);
    long int a[n + 1];

    if (n == 0) {
        printf("1\n");
    } else if (n == 1 || n == 2) {
        printf("0\n");
    } else {
        a[0] = 1;
        a[1] = 0;
        a[2] = 0;
        for (int i = 3; i <= n; i++) {
            a[i] = a[i - 1] + a[i - 3];
            if (a[i] >= 1000000007) {
                a[i] %= 1000000007;
            }
        }
    }
    printf("%ld\n", a[n]);
    return 0;
}