#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <unordered_map>
#include <utility>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <cstdio>
#include <math.h>
#include <stdio.h>
#include <deque>

using namespace std;

#define REP(i,n,m) for( long long int i = (n); i < (m); i++ )
#define REV(v) for (auto itr = v.rbegin(); itr != v.rend(); itr++)
#define ll long long
#define ALL(a) (a).begin(), (a).end()
#define SORT(v) sort( ALL(v) );
#define LAST(v) v[v.size()-1]
#define ZERO(a) memset(a,0,sizeof(a));
#define MINUS(a) memset(a,-1,sizeof(a));
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define pi pair<int, int>
#define MP make_pair
#define PB push_back
#define EB emplace_back
#define IIN(a) int a; cin >> a;
#define LIN(a) ll a; cin >> a;
#define SIN(a) string a; cin >> a;
#define VL(v,n) vector<ll> v(n);
#define Read_VL(v,n) vector<ll> v(n);REP(i,0,n)cin>>v[i];
#define sumV(v,n) Vl(acm,n) REP(i,0,n) acm[i] = v[i] + ( i == 0 ? 0 : acm[i - 1]);
#define EPS (1e-10)
#define INF 1000000000000LL

void YN(bool b){cout<<(b?"YES":"NO")<<"\n";}
void Yn(bool b){cout<<(b?"Yes":"No")<<"\n";}
void yn(bool b){cout<<(b?"yes":"no")<<"\n";}

template<class S>S max(vector<S>&a){return *max_element(all(a));}
template<class S>S min(vector<S>&a){return *min_element(all(a));}

template<class T>void puta(T&&t){cout<<t<<"\n";}
template<class H,class...T>void puta(H&&h,T&&...t){cout<<h<<' ';puta(t...);}

template<class T=ll>struct Graph{
	int n;
	vector<vector<tuple<ll,T>>>edge;
	Graph(int N=1):n(N){edge.resize(n);}
	void add(ll f,ll t,T c,bool d=false){
		edge[f].emplace_back(t,c);
		if(!d)edge[t].emplace_back(f,c);
	}
	void view(){
		REP(i,0,n)for(auto&e:edge[i])
			puta(i,"=>",get<0>(e),", cost :",get<1>(e));
	}
};

bool length_cmp( string &a, string &b ){
  return a.size() < b.size();
}

ll StoLL( string s )
{
	ll num=0;
  REP( i, 0, s.size() ){
    num = num * 10 + ( s[i] ^ 48 );
  }
  return num;
}

ll CtoLL( char c )
{
	if( 'a' <= c && c <= 'z'){
		return (ll)( c ^ 96 ) ;
	}
	else if( 'A' <= c && c <= 'Z'){
		return (ll)( c ^ 64 );
	}
  return 0;
}

ll MOD=1000000007;
ll dx[4] = { 1, 0, -1, 0 };
ll dy[4] = { 0, 1, 0, -1 };
//I ASCII code: '0' = 48; 'A' = 65; 'a' = 97

signed main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
    LIN(x1)LIN(y1)LIN(x2)LIN(y2)
    ll dx = x2 - x1, dy = y2 - y1;
    ll x3 = x2 - dy, y3 = y2 + dx;
    ll x4 = x1 - dy, y4 = y1 + dx;
    puta( x3,y3,x4,y4 );
    return 0;
}


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

int main()
{
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int x1,y1,x2,y2;
    cin>>x1>>y1>>x2>>y2;
    if(x2>=x1)
    cout<<x2-abs(y1-y2)<<" "<<y2+abs(x1-x2)<<" "<<x1-abs(y1-y2)<<" "<<y1+abs(x1-x2)<<"\n";
    else
    {
        cout<<x2-abs(y1-y2)<<" "<<y2-abs(x1-x2)<<" "<<x1-abs(y1-y2)<<" "<<y1-abs(x1-x2)<<"\n";
    }

}


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

int main()
{
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int x1,y1,x2,y2;
    cin>>x1>>y1>>x2>>y2;
    cout<<x2-abs(y1-y2)<<" "<<y2+abs(x1-x2)<<" "<<x1-abs(y1-y2)<<" "<<y1+abs(x1-x2)<<"\n";
}


#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <cmath>
#include <bitset>
#include <iomanip>
#include <stack>
#include <list>
#include <map>
#include <unordered_map>
#include <chrono>
#include <numeric>
using namespace std;
using ll = long long;
const ll INF = (ll)1e18+1;
const ll DIV = 1000000007;
//#define TEST
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
#ifdef TEST
    chrono::system_clock::time_point start, end;
    start = chrono::system_clock::now();
#endif
    long x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    ll x = (x2-x1);
    ll y = (y2-y1);
    ll x3,y3, x4, y4;
    if(abs(x) > abs(y))
    {
        if(x > 0)
        {
            cerr << "1" << endl;
            x3 = x2 - y;
            y3 = y2 + x;
            x4 = x3 - x;
            y4 = y3 - y;
        }
        else
        {
            cerr << "2" << endl;
            x3 = x2 - y;
            y3 = y2 + x;
            x4 = x3 - x;
            y4 = y3 - y;
        }
    }
    else
    {
        if(y > 0)
        {
            cerr << "3" << endl;
            x3 = x2 - y;
            y3 = y2 + x;
            x4 = x3 - x;
            y4 = y3 - y;
        }
        else
        {
            cerr << "4" << endl;
            x3 = x2 - y;
            y3 = y2 + x;
            x4 = x3 + x;
            y4 = y3 - y;
        }
    }
    cout << x3 << " " << y3 << " " << x4 << " " << y4 << endl;
#ifdef TEST
    end = chrono::system_clock::now();
    cerr << static_cast<double>(chrono::duration_cast<chrono::microseconds>(end - start).count() / 1000.0) << "[ms]" << endl;
#endif
    return 0;
}


#include <stdio.h>

int main(){
  int x1,y1,x2,y2;
  scanf("%d%d%d%d",&x1,&y1,&x2,&y2);
  int x3,y3,x4,y4;
  x3 = x2-y2+y1;
  x4 = x1-y2+y1;
  y3 = y2+x2-x1;
  y4 = y1+x2-x1;
  printf("%d %d %d %d\n",x3,y3,x4,y4);

  return 0;
}


#include<stdio.h>
int main(){
  int x1,x2,x3,x4,y1,y2,y3,y4;
  scanf("%d%d%d%d",&x1,&y1,&x2,&y2);
  x3=x2+y1-y2;
  y3=y2+x2-x1;
  x4=x1+y1-y2;
  y4=y1+x2-x1;
  printf("%d %d %d %d\n",x3,y3,x4,y4);
  return 0;
}


#include<stdio.h>

int main(void){
	int x1,x2,x3,x4,y1,y2,y3,y4,henx,heny;

	scanf("%d %d %d %d",&x1,&y1,&x2,&y2);

	henx = x2 - x1;
	heny = y2 - y1;
	y3 = y2 + henx;
	x3 = x2 - heny;
	y4 = y3 - heny;
	x4 = x3 - henx;

	printf("%d %d %d %d\n",x3,y3,x4,y4);

	return 0;
}


#include <stdio.h>
#include <stdlib.h>
int main(void){
    int x1, y1, x2, y2;
    scanf("%d %d %d %d", &x1, &y1, &x2, &y2);

         if(x1<=x2 && y1<=y2)printf("%d %d %d %d\n", x2-abs(y2-y1), y2+abs(x2-x1), x1-abs(y2-y1), y1+abs(x2-x1));
    else if(x1>=x2 && y1<=y2)printf("%d %d %d %d\n", x2-abs(y2-y1), y2-abs(x2-x1), x1-abs(y2-y1), y1-abs(x2-x1));
    else if(x1<=x2 && y1>=y2)printf("%d %d %d %d\n", x2+abs(y2-y1), y2+abs(x2-x1), x1+abs(y2-y1), y1+abs(x2-x1));
    else if(x1>=x2 && y1>=y2)printf("%d %d %d %d\n", x2-abs(y2-y1), y2-abs(x2-x1), x1-abs(y2-y1), y1-abs(x2-x1));
    return 0;
}


#include<stdio.h>
#include<bits/stdc++.h>
using namespace std ;
int main()
{
    int a , b , c , d ;
    cin>>a>>b>>c>>d;
    int x = c-a , y = d-b ;
    cout<<c-y<<" "<<d+x<<" "<<a-y<<" "<<b+x;
}


#include<stdio.h>
int main()
{
int x1,x2,y1,y2;
  scanf("%d %d %d %d",&x1,&x2,&y1,&y2);
  printf("%d %d %d %d",x2+(y1-y2),y2+(x2-x1),x1+(y1-y2),y1+(x2-x1));
return 0;}


function Main(input){
    const position=input.split(' ');
    const x1=Number(position[0]);
    const y1=Number(position[1]);
    const x2=Number(position[2]);
    const y2=Number(position[3]);
    const x4=x1+y1-y2;
    const y4=y1-x1+x2;
    const x3=x4+y4-y1;
    const y3=y4+x1-x4;
    console.log(x3 + ' ' + y3 + ' '+x4 +' '+y4);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


'use strict'

function main(input) {
  input = input
    .trim()
    .split(' ')
    .map(Number)

  const x1 = input[0]
  const y1 = input[1]
  const x2 = input[2]
  const y2 = input[3]

  const x3 = x2 - (y2 - y1)
  const y3 = y2 + (x2 - x1)
  const x4 = x1 + (y1 - y2)
  const y4 = y1 - (x1 - x2)

  console.log([x3, y3, x4, y4].join(' '))
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'))


inp = require('fs').readFileSync('/dev/stdin', 'utf8').split('\n')
l = inp.shift().split(' ')
x1 = l.shift() * 1
y1 = l.shift() * 1
x2 = l.shift() * 1
y2 = l.shift() * 1
xd = x1 - x2
yd = y1 - y2
x3 = x2 + yd
y3 = y2 - xd
x4 = x1 + yd
y4 = y1 - xd
console.log('%d %d %d %d', x3, y3, x4, y4)


inp = ["31 -41 -59 26"]
l = inp.shift().split(' ')
x1 = l.shift() * 1
y1 = l.shift() * 1
x2 = l.shift() * 1
y2 = l.shift() * 1
xd = x1 - x2
yd = y1 - y2
x3 = x2 + yd
y3 = y2 - xd
x4 = x1 + yd
y4 = y1 - xd
console.log('%d %d %d %d', x3, y3, x4, y4)


function main(input) {
  input=input.trim();
  const x1 = parseInt(input.split(" ")[0], 10);
  const y1 = parseInt(input.split(" ")[1], 10);
  const x2 = parseInt(input.split(" ")[2], 10);
  const y2 = parseInt(input.split(" ")[3], 10);
  var arr=[x2+y1-y2, y2+x2-x1, x1+y1-y2, y1+x2-x1]
  console.log(arr);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


function main(input) {
  input=input.trim();
  const x1 = parseInt(input.split(" ")[0], 10);
  const y1 = parseInt(input.split(" ")[1], 10);
  const x2 = parseInt(input.split(" ")[2], 10);
  const y2 = parseInt(input.split(" ")[3], 10);
  console.log([x2+y1-y2, y2+x2-x1, x1+y1-y2, y1+x2-x1]);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


package main

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

const mod = 1000000007

// 1MB
const ioBufferSize = 1 * 1024 * 1024

var sc = func() *bufio.Scanner {
	sc := bufio.NewScanner(os.Stdin)
	sc.Buffer(make([]byte, ioBufferSize), ioBufferSize)
	sc.Split(bufio.ScanWords)
	return sc
}()

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

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

func main() {
	x1, y1, x2, y2 := nextInt(), nextInt(), nextInt(), nextInt()

	fmt.Println(x2+y1-y2, -x1+x2+y2, x1+y1-y2, -x1+x2+y1)
}


package main

import (
        "fmt"
)

func solution(a, b, c, d int) (x3, y3, x4, y4 int) {
        x := c - a
        y := d - b
        return c - y, d + x, a - y, b + x
}

func main() {
        var x1, y1, x2, y2 int
        fmt.Scan(&x1, &y1, &x2, &y2)
        fmt.Println(solution(x1, y1, x2, y2))
}


/*
URL:
https://atcoder.jp/contests/abc108/tasks/abc108_b
*/

package main

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

/********** FAU standard libraries **********/

//fmt.Sprintf("%b\n", 255) 	// binary expression

/********** I/O usage **********/

//str := ReadString()
//i := ReadInt()
//X := ReadIntSlice(n)
//S := ReadRuneSlice()
//a := ReadFloat64()
//A := ReadFloat64Slice(n)

//str := ZeroPaddingRuneSlice(num, 32)
//str := PrintIntsLine(X...)

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

const (
	// General purpose
	MOD          = 1000000000 + 7
	ALPHABET_NUM = 26
	INF_INT64    = math.MaxInt64
	INF_BIT60    = 1 << 60
	INF_INT32    = math.MaxInt32
	INF_BIT30    = 1 << 30
	NIL          = -1

	// for dijkstra, prim, and so on
	WHITE = 0
	GRAY  = 1
	BLACK = 2
)

func init() {
	// bufio.ScanWords <---> bufio.ScanLines
	ReadString = newReadString(os.Stdin, bufio.ScanWords)
	stdout = bufio.NewWriter(os.Stdout)
}

var (
	x1, y1, x2, y2 int
)

func main() {
	x1, y1, x2, y2 = ReadInt4()

	dx, dy := x2-x1, y2-y1

	// x3, y3
	dx, dy = -dy, dx
	x3, y3 := x2+dx, y2+dy
	// x4, y4
	dx, dy = -dy, dx
	x4, y4 := x3+dx, y3+dy

	fmt.Println(x3, y3, x4, y4)
}

// ↓以下でもACできる
// func main() {
// 	x1, y1, x2, y2 = ReadInt4()

// 	x2 -= x1
// 	y2 -= y1

// 	x4, y4 := -y2, x2

// 	x3, y3 := x4+x1+x2, y4+y1+y2
// 	x4 += x1
// 	y4 += y1

// 	fmt.Println(x3, y3, x4, y4)
// }

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

/*********** I/O ***********/

var (
	// ReadString returns a WORD string.
	ReadString func() string
	stdout     *bufio.Writer
)

func newReadString(ior io.Reader, sf bufio.SplitFunc) func() string {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces
	r.Split(sf)

	return func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
}

// ReadInt returns an integer.
func ReadInt() int {
	return int(readInt64())
}
func ReadInt2() (int, int) {
	return int(readInt64()), int(readInt64())
}
func ReadInt3() (int, int, int) {
	return int(readInt64()), int(readInt64()), int(readInt64())
}
func ReadInt4() (int, int, int, int) {
	return int(readInt64()), int(readInt64()), int(readInt64()), int(readInt64())
}

// ReadInt64 returns as integer as int64.
func ReadInt64() int64 {
	return readInt64()
}
func ReadInt64_2() (int64, int64) {
	return readInt64(), readInt64()
}
func ReadInt64_3() (int64, int64, int64) {
	return readInt64(), readInt64(), readInt64()
}
func ReadInt64_4() (int64, int64, int64, int64) {
	return readInt64(), readInt64(), readInt64(), readInt64()
}

func readInt64() int64 {
	i, err := strconv.ParseInt(ReadString(), 0, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

// ReadIntSlice returns an integer slice that has n integers.
func ReadIntSlice(n int) []int {
	b := make([]int, n)
	for i := 0; i < n; i++ {
		b[i] = ReadInt()
	}
	return b
}

// ReadInt64Slice returns as int64 slice that has n integers.
func ReadInt64Slice(n int) []int64 {
	b := make([]int64, n)
	for i := 0; i < n; i++ {
		b[i] = ReadInt64()
	}
	return b
}

// ReadFloat64 returns an float64.
func ReadFloat64() float64 {
	return float64(readFloat64())
}

func readFloat64() float64 {
	f, err := strconv.ParseFloat(ReadString(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

// ReadFloatSlice returns an float64 slice that has n float64.
func ReadFloat64Slice(n int) []float64 {
	b := make([]float64, n)
	for i := 0; i < n; i++ {
		b[i] = ReadFloat64()
	}
	return b
}

// ReadRuneSlice returns a rune slice.
func ReadRuneSlice() []rune {
	return []rune(ReadString())
}

/*********** Debugging ***********/

// ZeroPaddingRuneSlice returns binary expressions of integer n with zero padding.
// For debugging use.
func ZeroPaddingRuneSlice(n, digitsNum int) []rune {
	sn := fmt.Sprintf("%b", n)

	residualLength := digitsNum - len(sn)
	if residualLength <= 0 {
		return []rune(sn)
	}

	zeros := make([]rune, residualLength)
	for i := 0; i < len(zeros); i++ {
		zeros[i] = '0'
	}

	res := []rune{}
	res = append(res, zeros...)
	res = append(res, []rune(sn)...)

	return res
}

// Strtoi is a wrapper of strconv.Atoi().
// If strconv.Atoi() returns an error, Strtoi calls panic.
func Strtoi(s string) int {
	if i, err := strconv.Atoi(s); err != nil {
		panic(errors.New("[argument error]: Strtoi only accepts integer string"))
	} else {
		return i
	}
}

// PrintIntsLine returns integers string delimited by a space.
func PrintIntsLine(A ...int) string {
	res := []rune{}

	for i := 0; i < len(A); i++ {
		str := strconv.Itoa(A[i])
		res = append(res, []rune(str)...)

		if i != len(A)-1 {
			res = append(res, ' ')
		}
	}

	return string(res)
}

// PrintIntsLine returns integers string delimited by a space.
func PrintInts64Line(A ...int64) string {
	res := []rune{}

	for i := 0; i < len(A); i++ {
		str := strconv.FormatInt(A[i], 10) // 64bit int version
		res = append(res, []rune(str)...)

		if i != len(A)-1 {
			res = append(res, ' ')
		}
	}

	return string(res)
}

// PrintfDebug is wrapper of fmt.Fprintf(os.Stderr, format, a...)
func PrintfDebug(format string, a ...interface{}) {
	fmt.Fprintf(os.Stderr, format, a...)
}

// PrintfBufStdout is function for output strings to buffered os.Stdout.
// You may have to call stdout.Flush() finally.
func PrintfBufStdout(format string, a ...interface{}) {
	fmt.Fprintf(stdout, format, a...)
}


#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <functional>
#include <bitset>

using namespace std;
#define int long long int
const int INF = 1001001001001001LL;
const int MOD = 1000000007;

int di[] = {-1, 0, 1, 0, -1, 1, 1, -1};
int dj[] = {0, 1, 0, -1, 1, 1, -1, -1};

signed main(){

    int x1, y1, x2, y2; cin >> x1 >> y1 >> x2 >> y2;
    int a = x2 - x1;
    int b = y2 - y1;
    cout <<
    return 0;
}


package main

import "fmt"

func main() {
	var x1, y1, x2, y2 int
	fmt.Scan(&x1, &y1, &x2, &y2)
	v := 0
	if x1 != x2 {
		v = x1 - x2
	} else {
		v = y1 - y2
	}
	if v < 0 {
		v = -v
	}
	if x1 == x2 {
		if y1 > y2 {
			fmt.Printf("%d %d %d %d\n", x1+v, y2, x1+v, y1)
		} else {
			fmt.Printf("%d %d %d %d\n", x1-v, y2, x1-v, y1)
		}
	} else {
		if x1 < x2 {
			fmt.Printf("%d %d %d %d\n", x1, y1+v, x2, y1+v)
		} else {
			fmt.Printf("%d %d %d %d\n", x2, y1-v, x1, y1-v)
		}
	}
}


// Package main provides
//
// File:  b.go
// Author: ymiyamoto
//
// Created on Wed Dec  5 21:48:31 2018
//
package main

import "fmt"

var x1, x2, y1, y2 int

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

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

func main() {
	fmt.Scan(&x1, &y1, &x2, &y2)

	if x1 < x2 {
		fmt.Println(max(x1, x2), min(y1, y2), min(x1, x2), max(y1, y2))
	} else {
		fmt.Println(min(x1, x2), max(y1, y2), max(x1, x2), min(y1, y2))
	}
}


x1,y1,x2,y2 = gets.split.map(&:to_i)
a = Math.sqrt((x1-x2)**2+(y1-y2)**2)
if x1 == x2 then
    if y1 > y2 then
        x3 = x1+a
        x4 = x3
        y3 = y2
        y4 = y1
    else
        x3 = x1-a
        x4 = x3
        y3 = y2
        y4 = y1
    end
elsif y1 == y2 then
    if x1 < x2 then
        x3 = x2
        x4 = x1
        y3 = y2 + a
        y4 = y3
    else
        x3 = x2
        x4 = x1
        y3 = y2 - a
        y4 = y3
    end
elsif x1 < x2 then
    x3 = x2 - (y2-y1)
    x4 = x1 - (y2-y1)
    y3 = y2 + (x2-x1)
    y4 = y1 + (x2-x1)
else
    x3 = x2 + (y1-y2)
    x4 = x1 + (y1-y2)
    y3 = y2 + (x2-x1)
    y4 = y1 + (x2-x1)
end
puts "#{x3.to_i} #{y3.to_i} #{x4.to_i} #{y4.to_i}"


x1, y1, x2, y2 = gets.chomp.split.map(&:to_i)

a = x2-x1
b = y2-y1

puts "#{x2-b} #{y2+a} #{x1-b} #{y1+a}"


x1, y1, x2, y2 = gets.split.map &:to_i
puts "#{x2-y2+y1} #{y2+x2-x1} #{x1-y2+y1} #{y1+x2-x1}"


a,b,c,d=gets.split.map(&:to_i)
x=c − a
y=d − b
puts [c − y , d + x , a − y , b + x].join(' ')


x1,y1,x2,y2 = gets.strip.split.map(&:to_i)
if x1 != x2
  a = x2
  b = y2+x2-x1
  c = x1
  d = b
else
  a = x1+y1-y2
  b = y2
  c = a
  d = y1
end
puts [a,b,c,d].join(" ")


x_1, y_1, x_2, y_2 = gets.split(" ").map(&:to_i)

x_mount = x_2 - x_1
y_mount = y_2 - y_1

if x_mount > 0 && y_mount > 0
  x_3, y_3 = x_2 - y_mount.abs, y_2 + x_mount.abs
  x_4, y_4 = x_1 - y_mount.abs, y_1 + x_mount.abs

elsif x_mount < 0 && y_mount < 0
  x_3, y_3 = x_2 + y_mount.abs, y_2 - x_mount.abs
  x_4, y_4 = x_1 + y_mount.abs, y_1 - x_mount.abs

elsif x_mount < 0 && y_mount > 0
  x_3, y_3 = x_2 - y_mount.abs, y_2 - x_mount.abs
  x_4, y_4 = x_1 - y_mount.abs, y_1 - x_mount.abs

elsif  x_mount > 0 && y_mount < 0
  x_3, y_3 = x_2 + y_mount.abs, y_2 + x_mount.abs
  x_4, y_4 = x_1 + y_mount.abs, y_1 + x_mount.abs

elsif y_mount == 0 && x_1 < x_2
  x_3, y_3 = x_2, y_2 + x_mount.abs
  x_4, y_4 = x_1, y_1 + x_mount.abs

elsif y_mount == 0 && x_1 > x_2
  x_3, y_3 = x_2, y_2 - x_mount.abs
  x_4, y_4 = x_1, y_1 - x_mount.abs

elsif x_mount == 0 && y_1 < y_2
  x_3, y_3 = x_2 + y_mount.abs, y_2
  x_4, y_4 = x_1 + y_mount.abs, y_1

elsif x_mount == 0 && y_1 > y_2
  x_3, y_3 = x_2 - y_mount.abs, y_2
  x_4, y_4 = x_1 - y_mount.abs, y_1
end

puts "#{x_3} #{y_3} #{x_4} #{y_4}"


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

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

fn main() {
    let x1: i64 = read();
    let y1: i64 = read();
    let x2: i64 = read();
    let y2: i64 = read();

    let xd = x2 - x1;
    let yd = y2 - y1;

    let x3 = x2 - yd;
    let y3 = y2 + xd;

    let x4 = x3 - xd;
    let y4 = y1 + xd;

    println!("{} {} {} {}", x3, y3, x4, y4);
}


#[allow(unused_macros, dead_code)]
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, dead_code)]
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)*}
    };

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

#[allow(unused_macros, dead_code)]
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, bytes) => {
        read_value!($next, String).into_bytes()
    };

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

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

#[allow(dead_code)]
struct UnionFind {
    parent: Vec<usize>,
    rank: Vec<usize>,
    size: Vec<usize>,
}

#[allow(dead_code)]
impl UnionFind {
    fn new(n: usize) -> UnionFind {
        let mut p = vec![0; n];
        for i in 0..n {
            p[i] = i;
        }
        return UnionFind {
            parent: p,
            rank: vec![0; n],
            size: vec![1; n],
        };
    }

    fn find(&mut self, x: usize) -> usize {
        if x == self.parent[x] {
            x
        } else {
            let p = self.parent[x];
            let pr = self.find(p);
            self.parent[x] = pr;
            pr
        }
    }

    fn same(&mut self, a: usize, b: usize) -> bool {
        self.find(a) == self.find(b)
    }

    fn unite(&mut self, a: usize, b: usize) {
        let a_root = self.find(a);
        let b_root = self.find(b);
        if a_root == b_root {
            return;
        }
        if self.rank[a_root] > self.rank[b_root] {
            self.parent[b_root] = a_root;
            self.size[a_root] += self.size[b_root];
        } else {
            self.parent[a_root] = b_root;
            self.size[b_root] += self.size[a_root];
            if self.rank[a_root] == self.rank[b_root] {
                self.rank[b_root] += 1;
            }
        }
    }

    fn get_size(&mut self, x: usize) -> usize {
        let root = self.find(x);
        self.size[root]
    }
}

const MOD_P: usize = 1000000007;

#[allow(dead_code)]
// fact(n) = n! mod p
fn fact(n: usize) -> usize {
    let mut acc = 1;
    for i in 1..n + 1 {
        acc = acc * i % MOD_P;
    }
    acc
}

#[allow(dead_code)]
fn mod_pow(b: usize, mut e: usize) -> usize {
    let mut base = b;
    let mut acc = 1;

    while e > 1 {
        if e % 2 == 1 {
            acc = acc * base % MOD_P;
        }
        e /= 2;
        base = base * base % MOD_P;
    }

    if e == 1 {
        acc = acc * base % MOD_P;
    }

    acc
}

#[allow(dead_code)]
fn comb(n: usize, r: usize) -> usize {
    // nCr = n! / (r! (n-r)!) = n! (r!)^(p-2) ((n-r)!)^(p-2)
    let x = ((n - r + 1)..(n + 1)).fold(1, |p, x| p * x % MOD_P);
    let y = mod_pow(fact(r), MOD_P - 2);
    x * y % MOD_P
}

#[allow(dead_code)]
fn gcd(a: usize, b: usize) -> usize {
    if b > a {
        gcd(b, a)
    } else if a % b == 0 {
        b
    } else {
        gcd(b, a % b)
    }
}

#[allow(dead_code)]
fn getline() -> String {
    let mut __ret = String::new();
    std::io::stdin().read_line(&mut __ret).ok();
    return __ret;
}

use std::cmp::{max, min};

fn main() {
    input! {
        x1: isize,
        y1: isize,
        x2: isize,
        y2: isize,
    }

    println!(
        "{} {} {} {}",
        x2 - (y2 - y1),
        y2 + (x2 - x1),
        x1 - (y2 - y1),
        y1 + (x2 - x1)
    );
}


// input! macro is published in the following URLs.
// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
// https://github.com/tanakh/competitive-rs.git
#[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)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $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, [ $t:tt ]) => {
        {
            let len = read_value!($next, usize);
            (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
        }
    };

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

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

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

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

fn main() {
    input! {
        x1: i64,
        y1: i64,
        x2: i64,
        y2: i64,
    }
    let vx12 = x2 - x1;
    let vy12 = y2 - y1;
    let vx23 = -vy12;
    let vy23 = vx12;
    let vx34 = -vy23;
    let vy34 = vx23;
    let x3 = x2 + vx23;
    let y3 = y2 + vy23;
    let x4 = x3 + vx34;
    let y4 = y3 + vy34;
    println!("{} {} {} {}", x3, y3, x4, y4);
}


x1, y1, x2, y2 = map(int, input().split())

if x1 >= x2 and y1 >= y2:
    x3 = x2 - (y1 - y2)
    y3 = y2 + (x1 - x2)
    x4 = x3 - (x1 - x2)
    y4 = y3 - (y1 - y2)
elif x1 >= x2 and y1 < y2:
    x3 = x2 - (y2 - y1)
    y3 = y2 - (x1 - x2)
    x4 = x3 + (x1 - x2)
    y4 = y3 - (y2 - y1)
elif x1 < x2 and y1 >= y2:
    x3 = x2 + (y1 - y2)
    y3 = y2 + (x2 - x1)
    x4 = x3 - (x2 - x1)
    y4 = y3 + (y1 - y2)
else:
    x3 = x2 - (y2 - y1)
    y3 = y2 + (x2 - x1)
    x4 = x3 - (x2 - x1)
    y4 = y3 - (y2 - y1)

print("{} {} {} {}".format(x3, y3, x4, y4))


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! {
        x1: i64,
        y1: i64,
        x2: i64,
        y2: i64,
    }
    let dx = x1 - x2;
    let dy = y1 - y2;
    let (x3, y3) = (x2 - dy, y2 - dx);
    let (x4, y4) = (x3 - dx, y3 - dy);
    println!("{} {} {} {}", x3, y3, x4, y4);
}


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 abc(x_1:i32, y_1:i32, x_2:i32, y_2:i32) {
    let diff_x = x_2 - x_1;
    let diff_y = y_2 - y_1;

    let x_3 = x_2 - diff_y;
    let y_3 = x_2 + diff_x;
    let x_4 = x_1 - diff_y;
    let y_4 = x_1 + diff_x;

    println!("{} {} {} {}", x_3, y_3, x_4, y_4)
}

fn main() {

    input!{
        x_1: i32,
        y_1: i32,
        x_2: i32,
        y_2: i32,
    }
    abc(x_1, y_1, x_2, y_2)
}


import Foundation

#if swift(>=4.0)
extension String {
    func split(by separator: String) -> [String] {
        return self.components(separatedBy: separator)
    }
    func toArray() -> [String] {
        return self.map{String($0)}
    }
}
#else
extension String {
    func split(by separator: String) -> [String] {
        return self.componentsSeparatedByString(separator)
    }
    func count() -> Int {
        return self.characters.count
    }
    func toArray() -> [String] {
        return self.characters.map{String($0)}
    }
}
extension Array where Element: Comparable {
    func max() -> Element! {
        return self.maxElement()
    }
    func min() -> Element! {
        return self.minElement()
    }
    func sorted() -> Array {
        return self.sort()
    }
    func reversed() -> Array {
        return self.reverse()
    }
    mutating func sort() {
        self.sortInPlace()
    }
}
extension Array {
    init(repeating: Element, count: Int) {
        self.init(count: count, repeatedValue: repeating)
    }
}
func stride<T: Strideable>(from start: T, to end: T, by stride: T.Stride) -> StrideTo<T> {
    return start.stride(to: end, by: stride)
}
#endif
func readInt() -> Int? {
    return Int(readLine()!)
}
func readStringSplit(by separator: String) -> [String] {
    return readLine()!.split(by: separator)
}
func readIntSplit(by separator: String) -> [Int] {
    return readLine()!.split(by: separator).map{Int($0)!}
}
func pow(_ lhs: Int, _ rhs: Int) -> Int {
    return (0..<rhs).reduce(1){(i,_) in i * lhs}
}

/*************** テストスペース ***************/

/*************** メインプログラム ***************/

let input = readIntSplit(by: " ")
let (x1, y1, x2, y2) = (input[0], input[1], input[2], input[3])
let (dx, dy) = (x1-x2, y1-y2)
let (x3, y3) = (x2+dy, y2-dx)
let (x4, y4) = (x3+dx, y3+dy)
print("\(x3) \(y3) \(x4) \(y4)")


import Foundation

#if swift(>=4.0)
extension String {
    func split(by separator: String) -> [String] {
        return self.components(separatedBy: separator)
    }
    func toArray() -> [String] {
        return self.map{String($0)}
    }
}
#else
extension String {
    func split(by separator: String) -> [String] {
        return self.componentsSeparatedByString(separator)
    }
    func count() -> Int {
        return self.characters.count
    }
    func toArray() -> [String] {
        return self.characters.map{String($0)}
    }
}
extension Array where Element: Comparable {
    func max() -> Element! {
        return self.maxElement()
    }
    func min() -> Element! {
        return self.minElement()
    }
    func sorted() -> Array {
        return self.sort()
    }
    func reversed() -> Array {
        return self.reverse()
    }
    mutating func sort() {
        self.sortInPlace()
    }
}
extension Array {
    init(repeating: Element, count: Int) {
        self.init(count: count, repeatedValue: repeating)
    }
}
func stride<T: Strideable>(from start: T, to end: T, by stride: T.Stride) -> StrideTo<T> {
    return start.stride(to: end, by: stride)
}
#endif
func readInt() -> Int? {
    return Int(readLine()!)
}
func readStringSplit(by separator: String) -> [String] {
    return readLine()!.split(by: separator)
}
func readIntSplit(by separator: String) -> [Int] {
    return readLine()!.split(by: separator).map{Int($0)!}
}
func pow(_ lhs: Int, _ rhs: Int) -> Int {
    return (0..<rhs).reduce(1){(i,_) in i * lhs}
}

/*************** テストスペース ***************/

/*************** メインプログラム ***************/

let input = readIntSplit(by: " ")
let (x1, y1, x2, y2) = (input[0], input[1], input[2], input[3])
let (dx, dy) = (x1-x2, y1-y2)
let (x3, y3) = (x2-dy, y2+dx)
let (x4, y4) = (x3-dx, y3-dy)
print("\(x3) \(y3) \(x4) \(y4)")


const input=require('fs').readFileSync('/dev/stdin','utf8').split(/[\s]/);const tn=():number=>{const a=input[0];input.shift();return Number(a)};const tnn=(n:number):number[]=>{const a=[];for(let i=0;i<n;i++){a.push(tn())}return a};const ts=():string=>{const a=input[0];input.shift();return String(a)};const tss=(n:number):string[]=>{const a=[];for(let i=0;i<n;i++){a.push(ts())}return a};const tc=():string=>{let a=input[0].split('');const b=a[0];a.shift();if(a.length>0){input[0]=a.join('')}else{input.shift()}return String(b)};const tcc=(n:number):string[]=>{const a=[];for(let i=0;i<n;i++){a.push(tc())}return a};const to=(...arg)=>{console.log(...arg)};const abs=(a)=>{return Math.abs(a)};const min=(...a)=>{return Math.min(...a)};const max=(...a)=>{return Math.max(...a)};const floor=(a)=>{return Math.floor(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 sw=(a,arr:any[],op:'=='|'>='|'>'|'<='|'<'='==')=>{for(let i=0;i<arr.length-1;i+=2){if(eval(a+op+arr[i])){return arr[i+1];}}return arr[arr.length-1]};const near=(n:number,arr:number[]):number=>{let ne=arr[0],ni=0;for(let i=1;i<arr.length;i++){if(Math.abs(n-ne)>Math.abs(n-arr[i])){ne=arr[i];ni=i}}return ni};const objvs =(a)=>{const b=[];for(const v in a){b.push(a[v])}return b};
const main=()=>{
  let [a,b,c,d]=tnn(4)
  let x=c-a
  let y=d-b
  to((c-y)+' '+(d+x)+' '+(a-y)+' '+(b+x))

}
main()


function main(input) {
  input = input.trim();
  const [x1, y1, x2, y2] = input.split(" ").map(a => Number(a));
  const x3 = x2 - y2 + y1;
  const y3 = y2 + x2 - x1;
  const x4 = x3 - x2 + x1;
  const y4 = y3 - y2 + y1;
  console.log([x3, y3, x4, y4].join(" "));
}
main(require("fs").readFileSync("/dev/stdin", "utf8"));


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

const [x1, y1, x2, y2] = stdin
  .split('\n')[0]
  .split(' ')
  .map(Number)

const x3 = x2 - (y2 - y1)
const y3 = y2 + (x2 - x1)

const x4 = x1 - (y2 - y1)
const y4 = y1 + (x2 - x1)

console.log(x3, y3, x4, y4)


function main(input) {
const x1 = input.split(/\s|\n/g)[0],
	  y1 = input.split(/\s|\n/g)[1],
	  x2 = input.split(/\s|\n/g)[2],
	  y2 = input.split(/\s|\n/g)[3],
      x3 = x2-(y2-y1),
      y3 = y2+(x2-x1);
console.log(`${x3} ${y3} ${x3-(y3-y2)} ${y3+(x3-x2)}`)

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


a, b = map(int, input().split())
t = 0
for i in range(b-a):
    t += i+1
print(t-b)


a,b = map(int, input().split())
c = b-a
cnt = 0
for i in range(c):
    cnt += i
print(cnt-a)


x,y=map(int,input().split())
tmp = (y-x)
print(((tmp+1)*tmp)//2 - y)


lst = input().split()
a = int(lst[0])
b = int(lst[1])

def height(n):
   return sum(range(1, n + 1))

poles = []
for i in range(1, 1000):
   poles.append(height(i))

for i in range(1, 499500):
   for j in range(997):
      if ((a + i) == poles[j]) and ((b + i) == poles[j + 1]):
         print(i)
         exit()


[a,b] = list(map(int,input().split()))

tou = []
dam=0
for i in range(1,1000):
    dam +=i
    tou.append(dam)
# print(tou[-1])

for ans in range(1,5000000):
    west, east = a+ans, b+ans
    for j in range(998):
        if west==tou[j] and east==tou[j+1]:
            # print("west,wast,j,ans", west,east,j,ans)
            out=ans
            break
print(out)


[a,b] = list(map(int,input().split()))

tou = []
dam=0
for i in range(1,1000):
    dam +=i
    tou.append(dam)

for ans in range(1,10000):
    west, east = a+ans, b+ans
    for j in range(998):
        if west==tou[j] and east==tou[j+1]:
            # print("west,wast,j,ans", west,east,j,ans)
            out=ans
            break
print(out)


import java.io.*;
import java.util.*;
import java.math.*;
import java.awt.Point;

public class Main {
	//static final long MOD = 998244353L;
	//static final long INF = -1000000000000000007L;
	static final long MOD = 1000000007L;
	//static final int INF = 1000000007;

	static long[] factorial;
	public static void main(String[] args) {
		FastScanner sc = new FastScanner();
		PrintWriter pw = new PrintWriter(System.out);
		int A = sc.ni();
		int B = sc.ni();
		int D = B-A;
		int T = D*(D-1)/2;
		pw.println(T-A);
		pw.close();
	}

	public static long dist(long[] p1, long[] p2) {
		return (Math.abs(p2[0]-p1[0])+Math.abs(p2[1]-p1[1]));
	}

	//Find the GCD of two numbers
	public static long gcd(long a, long b) {
		if (a < b) return gcd(b,a);
		if (b == 0)
			return a;
		else
			return gcd(b,a%b);
	}

	//Fast exponentiation (x^y mod m)
	public static long power(long x, long y, long m) {
		if (y < 0) return 0L;
		long ans = 1;
		x %= m;
		while (y > 0) {
			if(y % 2 == 1)
				ans = (ans * x) % m;
			y /= 2;
			x = (x * x) % m;
		}
		return ans;
	}

	public static int[][] shuffle(int[][] array) {
		Random rgen = new Random();
		for (int i = 0; i < array.length; i++) {
		    int randomPosition = rgen.nextInt(array.length);
		    int[] temp = array[i];
		    array[i] = array[randomPosition];
		    array[randomPosition] = temp;
		}
		return array;
	}

    public static int[][] sort(int[][] array) {
    	//Sort an array (immune to quicksort TLE)

		Arrays.sort(array, new Comparator<int[]>() {
			  @Override
        	  public int compare(int[] arr1, int[] arr2) {
				  return arr1[0]-arr2[0]; //ascending order
	          }
		});
		return array;
	}

    public static long[][] sort(long[][] array) {
    	//Sort an array (immune to quicksort TLE)
		Random rgen = new Random();
		for (int i = 0; i < array.length; i++) {
		    int randomPosition = rgen.nextInt(array.length);
		    long[] temp = array[i];
		    array[i] = array[randomPosition];
		    array[randomPosition] = temp;
		}
		Arrays.sort(array, new Comparator<long[]>() {
			  @Override
        	  public int compare(long[] arr1, long[] arr2) {
				  //return 0;
				  if (arr1[0] < arr2[0]) {
					  return -1;
				  } else if (arr1[0] > arr2[0]) {
					  return 1;
				  } else {
					  return 0;
				  }
	          }
		});
		return array;
	}

    static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

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

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

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

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

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

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


import java.io.IOException;
import java.io.InputStream;
import java.util.NoSuchElementException;

public class Main {
	public static void main(String[] args) {
		FastScanner sc = new FastScanner();
		int a = sc.nextInt();
		int b = sc.nextInt();
		int[] t = new int[1000];
		for (int i = 1; i < t.length; i++) {
			t[i] = t[i-1] + i;
		}
		int ans = t[b-a] - b;
		out(ans);
	}

	static class Combination {
		final int mod;
		final int max;

		final long[] fact;
		final long[] inv;
		final long[] invfact;

		public Combination(int n) {
			this(n, 1_000_000_007);
		}

		public Combination(int n, int mod) {
			this.mod = mod;
			max = n + 1;
			fact = new long[max];
			invfact = new long[max];
			inv = new long[max];

			inv[1] = 1;
			for (int i = 2; i < inv.length; i++) {
				inv[i] = inv[mod % i] * (mod - mod / i) % mod;
			}

			fact[0] = 1;
			invfact[0] = 1;
			for (int i = 1; i < inv.length; i++) {
				fact[i] = i * fact[i - 1] % mod;
				invfact[i] = inv[i] * invfact[i - 1] % mod;
			}
		}

		public long get(int n, int r) {
			return fact[n] * invfact[n - r] % mod * invfact[r] % mod;
		}
	}

	public static long gcd(long a, long b) {
		long remainder = a % b;
		if (remainder == 0) {
			return b;
		} else {
			return gcd(b, remainder);
		}
	}

	static void out(String a) {
		System.out.println(a);
	}

	static void out(int a) {
		System.out.println(a);
	}

	static void out(long a) {
		System.out.println(a);
	}

	static void out(double a) {
		System.out.println(a);
	}

	static void out(char a) {
		System.out.println(a);
	}
}

class FastScanner {
    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() {
        if (hasNextByte())
            return buffer[ptr++];
        else
            return -1;
    }

    private static boolean isPrintableChar(int c) {
        return 33 <= c && c <= 126;
    }

    public boolean hasNext() {
        while (hasNextByte() && !isPrintableChar(buffer[ptr]))
            ptr++;
        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 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();
        }
    }

    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)
            throw new NumberFormatException();
        return (int) nl;
    }

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


import java.io.*;
import java.util.*;
class Main{
	static final long MOD = 1_000_000_007; // 10^9+7
    static final int MAX = 2_147_483_646; // intMax
    static final int INF = 1_000_000_000; // 10^9
    public static void main(String[] args) throws Exception {
		hayami saori = new hayami();
		int a = saori.saori_hayami();
		int b = saori.saori_hayami();
		int n = b - a;
		int num = 0;
		for(int i = 1;i < n;i++){
			num += i;
		}
		System.out.println(num-a);
		saori.close();
    }
}

class hayami implements Closeable {
	private final InputStream in = System.in;
	private final byte[] hayami = new byte[1024];
	private int Hayami = 0;
	private int saori = 0;
	private boolean HayamiSaori() {
		if (Hayami < saori) {
			return true;
		}else{
			Hayami = 0;
			try {
				saori = in.read(hayami);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (saori <= 0) {
				return false;
			}
		}
		return true;
	}
	private int SaoriHayami() {
		if (HayamiSaori()) {
            return hayami[Hayami++];
         }else{
             return -1;
         }
	}
	private static boolean hayami_saori(int hayami) {
		return 33 <= hayami && hayami <= 126;
	}
	public boolean hayamisaori() {
		while(HayamiSaori() && !hayami_saori(hayami[Hayami])) Hayami++; return HayamiSaori();
	}
	public String nextHayami() {
		if (!hayamisaori()) throw new NoSuchElementException();
		StringBuilder hayamin = new StringBuilder();
		int saori = SaoriHayami();
		while(hayami_saori(saori)) {
			hayamin.appendCodePoint(saori);
			saori = SaoriHayami();
		}
		return hayamin.toString();
	}
	public long saorihayami() {//nextLong
		if (!hayamisaori()) throw new NoSuchElementException();
		long hayami = 0;
		boolean misao = false;
		int saori = SaoriHayami();
		if (saori == '-') {
			misao = true;
			saori = SaoriHayami();
		}
		if (saori < '0' || '9' < saori) {
			throw new NumberFormatException();
		}
		while(true){
			if ('0' <= saori && saori <= '9') {
				hayami *= 10;
				hayami += saori - '0';
			}else if(saori == -1 || !hayami_saori(saori)){
				return misao ? -hayami : hayami;
			}else{
				throw new NumberFormatException();
			}
			saori = SaoriHayami();
		}
	}
	public int saori_hayami() {//nextInt
		long hayami = saorihayami();
		if (hayami < Integer.MIN_VALUE || hayami > Integer.MAX_VALUE) throw new NumberFormatException();
		return (int) hayami;
	}
	public double Hayamin() { //nextDouble
		return Double.parseDouble(nextHayami());
	}
	public void close() {
		try {
			in.close();
		} catch (IOException e) {
		}
    }

}


import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int sum = 0;
        int aa = 0;
        for (int i = 1; ; i++) {
            sum += i;
            if(sum >= a) {
                aa = sum - a;
                break;
            }
        }
        sum = 0;
        int bb = 0;
        for (int i = 1; ; i++) {
            sum += i;
            if(sum >= b) {
                bb = sum - b;
                break;
            }
        }
        if(aa == bb) {
            System.out.println(aa);
        } else {
            System.out.println(bb);
        }
    }
}


import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        //System.out.println((b - a) * (b - a + 1) / 2 - b);
        long sum = 0;
        for (long i = 1; ; i++) {
            sum += i;
            if(sum >= a) {
                break;
            }
        }
        System.out.println(sum -a);
    }
}


import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        //System.out.println((b - a) * (b - a + 1) / 2 - b);
        long sum = 0;
        for (long i = 1; ; i++) {
            sum += i;
            if(sum > a) {
                break;
            }
        }
        System.out.println(sum -a);
    }
}


#include <cstdio>

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

  int d=b-a;
  printf("%d\n", d*(d-1)/2-a);
}


// need
#include <iostream>
#include <algorithm>

// data structure
#include <bitset>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <complex>
//#include <deque>
#include <valarray>
#include <array>

// stream
//#include <istream>
//#include <sstream>
//#include <ostream>
#include <fstream>

// etc
#include <cassert>
#include <cmath>
#include <functional>
#include <iomanip>
#include <chrono>
#include <random>
#include <numeric>

// input
#define INIT std::ios::sync_with_stdio(false);std::cin.tie(0);
#define VAR(type, ...)type __VA_ARGS__;MACRO_VAR_Scan(__VA_ARGS__);
template<typename T> void MACRO_VAR_Scan(T& t) { std::cin >> t; }
template<typename First, typename...Rest>void MACRO_VAR_Scan(First& first, Rest&...rest) { std::cin >> first; MACRO_VAR_Scan(rest...); }
#define VEC_ROW(type, n, ...)std::vector<type> __VA_ARGS__;MACRO_VEC_ROW_Init(n, __VA_ARGS__); for(int i=0; i<n; ++i){MACRO_VEC_ROW_Scan(i, __VA_ARGS__);}
template<typename T> void MACRO_VEC_ROW_Init(int n, T& t) { t.resize(n); }
template<typename First, typename...Rest>void MACRO_VEC_ROW_Init(int n, First& first, Rest&...rest) { first.resize(n); MACRO_VEC_ROW_Init(n, rest...); }
template<typename T> void MACRO_VEC_ROW_Scan(int p, T& t) { std::cin >> t[p]; }
template<typename First, typename...Rest>void MACRO_VEC_ROW_Scan(int p, First& first, Rest&...rest) { std::cin >> first[p]; MACRO_VEC_ROW_Scan(p, rest...); }
#define VEC(type, c, n) std::vector<type> c(n);for(auto& i:c)std::cin>>i;
#define MAT(type, c, m, n) std::vector<std::vector<type>> c(m, std::vector<type>(n));for(auto& r:c)for(auto& i:r)std::cin>>i;

// output
#define OUT(d) std::cout<<(d);
#define FOUT(n, d) std::cout<<std::fixed<<std::setprecision(n)<<(d);
#define SOUT(n, c, d) std::cout<<std::setw(n)<<std::setfill(c)<<(d);
#define SP std::cout<<" ";
#define TAB std::cout<<"\t";
#define BR std::cout<<"\n";
#define SPBR(i, n) std::cout<<(i + 1 == n ? '\n' : ' ');
#define ENDL std::cout<<std::endl;
#define FLUSH std::cout<<std::flush;
#define SHOW(d) {std::cerr << #d << "\t:" << (d) << "\n";}
#define SHOWVECTOR(v) {std::cerr << #v << "\t:";for(const auto& xxx : v){std::cerr << xxx << " ";}std::cerr << "\n";}
#define SHOWVECTOR2(v) {std::cerr << #v << "\t:\n";for(const auto& xxx : v){for(const auto& yyy : xxx){std::cerr << yyy << " ";}std::cerr << "\n";}}
#define SHOWQUEUE(a) {auto tmp(a);std::cerr << #a << "\t:";while(!tmp.empty()){std::cerr << tmp.front() << " ";tmp.pop();}std::cerr << "\n";}

// utility
#define ALL(a) (a).begin(),(a).end()
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define RFOR(i, a, b) for(int i=(b)-1;i>=(a);--i)
#define REP(i, n) for(int i=0;i<int(n);++i)
#define RREP(i, n) for(int i=int(n)-1;i>=0;--i)
#define FORLL(i, a, b) for(ll i=ll(a);i<ll(b);++i)
#define RFORLL(i, a, b) for(ll i=ll(b)-1;i>=ll(a);--i)
#define REPLL(i, n) for(ll i=0;i<ll(n);++i)
#define RREPLL(i, n) for(ll i=ll(n)-1;i>=0;--i)
#define IN(a, x, b) (a<=x && x<b)
template<typename T> inline T CHMAX(T& a, const T b) { return a = (a < b) ? b : a; }
template<typename T> inline T CHMIN(T& a, const T b) { return a = (a > b) ? b : a; }
#define EXCEPTION(msg) throw std::string("Exception : " msg " [ in ") + __func__ + " : " + std::to_string(__LINE__) + " lines ]"
#define TRY(cond, msg) try {if (cond) EXCEPTION(msg);}catch (std::string s) {std::cerr << s << std::endl;}
void CHECKTIME(std::function<void()> f) { auto start = std::chrono::system_clock::now(); f(); auto end = std::chrono::system_clock::now(); auto res = std::chrono::duration_cast<std::chrono::nanoseconds>((end - start)).count(); std::cerr << "[Time:" << res << "ns  (" << res / (1.0e9) << "s)]\n"; }

// test
template<class T> std::vector<std::vector<T>> VV(int n, int m, T init = T()) {
	return std::vector<std::vector<T>>(n, std::vector<T>(m, init));
}
template<typename S, typename T>
std::ostream& operator<<(std::ostream& os, std::pair<S, T> p) {
	os << "(" << p.first << ", " << p.second << ")"; return os;
}

// type/const
#define int ll
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using PAIR = std::pair<int, int>;
using PAIRLL = std::pair<ll, ll>;
constexpr int INFINT = 1 << 30;                          // 1.07x10^ 9
constexpr int INFINT_LIM = (1LL << 31) - 1;              // 2.15x10^ 9
constexpr ll INFLL = 1LL << 60;                          // 1.15x10^18
constexpr ll INFLL_LIM = (1LL << 62) - 1 + (1LL << 62);  // 9.22x10^18
constexpr double EPS = 1e-9;
constexpr int MOD = 1000000007;
constexpr double PI = 3.141592653589793238462643383279;

template<class T, size_t N> void FILL(T(&a)[N], const T& val) { for (auto& x : a) x = val; }
template<class ARY, size_t N, size_t M, class T> void FILL(ARY(&a)[N][M], const T& val) { for (auto& b : a) FILL(b, val); }
template<class T> void FILL(std::vector<T>& a, const T& val) { for (auto& x : a) x = val; }
template<class ARY, class T> void FILL(std::vector<std::vector<ARY>>& a, const T& val) { for (auto& b : a) FILL(b, val); }

// ------------>8------------------------------------->8------------

signed main() {
	INIT;

	VAR(int, a, b);
	int t = b - a;
	int tt = t * (t + 1) / 2;
	OUT(tt - b)BR;

	return 0;
}


#include <iostream>

using namespace std;

int main() {
    int a, b;
    cin >> a >> b;
    cout << ((b - a) * (b - a - 1) / 2 - a) << endl;
    return 0;
}


#include<bits/stdc++.h>
#define int long long
using namespace std;
signed main(){
	int a,b;
	cin>>a>>b;
	int cover=1;
	int start= sqrt(a);
	int end=sqrt(b)+2;
	for(int i=start-1; i<end; i++ ){
		if(((i)*(i+1)/2)>=a and (i)*(i+1)/2 <=b)cover++;
	}
	cout<<cover;

}


#include<iostream>
using namespace std;
int main (void)
{
  long long int a[2000000],b[2000000],k,sum1=0,sum2=0;
  int n,m,i,j,ans=0;

  cin>>n>>m>>k;
  for(i=0;i<n;i++){cin>>a[i];}
  for(i=0;i<m;i++){cin>>b[i];sum2+=b[i];}
  j=m-1;

  for(i=0;i<n;i++)
  {
    sum1+=a[i];
    while(sum1+sum2>k)
    {
      sum2=sum2-b[j];
      j--;
    }
    if(i+j+2>ans){ans=i+j+2;}
  }
  cout<<ans<<endl;
  return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define IO ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ll long long int
#define ull unsigned long long int

const int INF = 1e9 + 7;
const int N = 1e5+5;

int main() {

	IO;

	int n, m;
	cin >> n >> m;

	int sum = 1, i = 2;

	while (n > sum) {
		sum += i;
		++i;
	}

	cout << sum - n;
}


#include <stdio.h>

int main(void){
	int a,b;
	scanf("%d",&a);
	scanf("%d",&b);
	int x = b-a;
	int ans=0;
	int i;
	for(i=1;i<=x;i++){
		ans+=i;
	}
	ans -= b;
	printf("%d",ans);

	return 0;}


main(a,b){scanf("%d%d",&a,&b);printf("%d",((b-a)*(b-a)-b-a)/2);}


#include <stdio.h>
int main(){
	int a,b,x,tall=0;
	scanf("%d %d",&a,&b);
	x = b-a;
	for(int i=0;i<x;i++){
		tall += i+1;
	}
	printf("%d",tall-b);
	return 0;
}


# include < cstdio >
typedef long long ll ;
int A , B ;
int main ()
{
scanf ("% d % d " ,&A ,& B );
printf ("% d \ n " ,(B - A )*( B - A +1)/2 - B );


#include <stdio.h>
int main(void){
    int ans = 0;
    long long a;
    long long b;

    scanf("%lld %lld", &a, &b);
    ans = ans * (ans + 1) / 2 - b;

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


function StoneMonument(input) {
    input = input.split("\n");
    tmp = input[0].split(" ");
    var a = parseInt(tmp[0], 10);
    var b = parseInt(tmp[1], 10);
    console.log((b-a)*(b-a+1)/2-b);
}
StoneMonument(require("fs").readFileSync("/dev/stdin", "utf8"));


var input = require("fs").readFileSync("/dev/stdin", "utf8").trim().split("\n");
var obj = {
  "list" : input,
  "index" : 0,
  "max" : input.length,
  "next" : function(){
    if(!this.hasNext()){throw "NoSuchElementException:次に要素は無いよ";}
    var returnObj = this.list[this.index];
    this.index++;
    return returnObj;
  },
  "hasNext" : function(){return (this.index < this.max);}
}
Main();
function next(){return obj.next();}
function nextInt(){return myconv(next(),1);}
function nextStrArray(){return myconv(next(),2);}//半角スペース分割
function nextIntArray(){return myconv(next(),4);}//半角スペース + 数値化
function nextCharArray(){return myconv(next(),6);}//1文字分割
function hasNext(){return obj.hasNext();}
function myout(t){console.log(t);}//標準出力
function myerr(t){console.error(t);}//標準エラー出力
//[no]要素の扱い。数値型
//不明値、異常時:引数そのまま返す　1:数値へ変換
//2:半角SPで分割 4:半角SPで分割し、数値配列へ
//6:1文字で分割  7:1文字で分割し、数値配列へ
//8:半角SPで結合 9:改行で結合 0:文字なしで結合
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(" ");case 4:return i.split(" ").map((a)=>Number(a));case 6:return i.split("");case 7:return i.split("").map((a)=>Number(a));case 8:return i.join(" ");case 9:return i.join("\n");case 0:return i.join("");default:return i;}}catch(e){return i;}}
function Main(){
  var one = nextIntArray();
  var a = one[0];
  var b = one[1];
  //b - aを行うことで、aの塔の雪なしでの高さがわかる
  var tmp = b - a - 1;
  var A = (tmp * (tmp + 1)) / 2;
  myout(A - a);
}


function Main(input) {
  input = input.split(" ");
  var a = parseInt(input[0]);
  var b = parseInt(input[1]);

  var num = b - a;
  var result = 0;
  function treeHeight(number) {
    for (var i = 1; i <= number; i++) {
      result += i;
    }
    return result;
  }

  var treeB = treeHeight(num);
  console.log(treeB - b);
}

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


"use strict";
const Main = (input) =>{
   let xs = input.trim().split(' ').map(v=>parseInt(v,10));
　 let a = 0;
   let b = 0;

   for(let i=1; i<xs[0]; i++){
      if(a<=xs[0]){
      a += i;
      }else{
      break;
      }
   }
   for(let i=1; i<xs[1]; i++){
      if(b<=xs[1]){
      b += i;
      }else{
      break;
      }
   }
   let ans = a+b;
   let ans1 = xs[0]+xs[1]
   console.log((ans-ans1)/2);
}
Main(require('fs').readFileSync('/dev/stdin','utf8'));


"use strict";
const Main = (input) =>{
   let xs = input.trim().split(' ').map(v=>parseInt(v,10));
　 let a = 0;
   let b = 0;

   for(let i=1; i<xs[0]; i++){
      if(a<xs[0]){
      a += i;
      }else{
      break;
      }
   }
   for(let i=1; i<xs[1]; i++){
      if(b<xs[1]){
      b += i;
      }else{
      break;
      }
   }
   let ans = a+b;
   let ans1 = xs[0]+xs[1]
   console.log((ans-ans1)/2);
}
Main(require('fs').readFileSync('/dev/stdin','utf8'));


"use strict";
const Main = (input) =>{
   let xs = input.trim().split(' ').map(v=>parseInt(v,10));
　 let a = 0;
   let b = 0;

   for(let i=1; i<xs[0]; i++){
      if(a<xs[0]){
      a += i;
      }else{
      break;
      }
   }
   for(let i=1; i<xs[1]; i++){
      if(b<xs[1]){
      b += i;
      }else{
      break;
      }
   }
   let ans = b+a;
   let ans1 = xs[0]+xs[1]
   console.log((ans-ans1)/2);
}
Main(require('fs').readFileSync('/dev/stdin','utf8'));


package main

import "fmt"

func main() {
	var a, b int
	fmt.Scan(&a, &b)
	tmp := b - a
	west := 0
	for i := 1; i < tmp; i++ {
		west += i
	}
	fmt.Println(west - a)
}


package main

import "fmt"

func main() {
	var a, b int
	fmt.Scan(&a, &b)
	diff := b - a
	west := 0
	// 結局これは等差数列の和
	for i := 1; i < diff; i++ {
		west += i
	}
	fmt.Println(west - a)
}


package main

import (
	"fmt"
)

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

	diff := b - a
	east := 0
	for i := 1; i < diff; i++ {
		east += i
	}
	fmt.Println(east - a)
}


package main

import "fmt"

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

	curNum := 1
	numMap := map[int]bool{curNum: true}
	for i := 2; i <= 999; i++ {
		curNum += i
		numMap[curNum] = true
	}

	for i := 1; i < 10000000000; i++ {
		if numMap[a+i] && numMap[b+i] {
			fmt.Println(i)
			return
		}
	}
}


package main

import "fmt"

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

	curNum := 1
	numMap := map[int]bool{curNum: true}
	for i := 2; i <= 999; i++ {
		curNum += i
		numMap[curNum] = true
	}

	for i := 1; i < 1000000000; i++ {
		if numMap[a+i] && numMap[b+i] {
			fmt.Println(i)
			return
		}
	}
}


package main

import "fmt"

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

	curNum := 1
	numMap := map[int]bool{curNum: true}
	for i := 2; i < 999; i++ {
		curNum += i
		numMap[curNum] = true
	}

	for i := 1; i < 1000000000; i++ {
		if numMap[a+i] && numMap[b+i] {
			fmt.Println(i)
			return
		}
	}
}


a, b = gets.chomp.split.map(&:to_i)
puts (b - a) *  (b - a + 1) / 2 - b


# abc099 B
a, b = gets.split.map(&:to_i)

tou = [1]

(2).upto(999) do |i|
  tou[i-1] = tou[i-2] + i
end
tou.each_cons(2) do |x,y|
  if y-x == b-a
    p x - a
    exit
  end
end


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

# 元の柱の長さを出す
n = b - a

west = 0
n.times do |i|
  west += i
end

# こたえ
puts west - a


ab = gets.chomp.split
a = ab[0].to_i
b = ab[1].to_i

diff = b - a
puts diff - (b % diff)


ab = gets.chomp.split
a = ab[0].to_i
b = ab[1].to_i

diff = b - a
puts diff - (a % diff)


ab = gets.chomp.split
a = ab[0].to_i
b = ab[1].to_i

if (a - b).abs == 1
    puts 1
else
    i = 2
    loop do
        break if a % i == b % i
        i += 1
    end
    puts i - (a % i)
end


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

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

fn main() {
    let a: usize = read();
    let b: usize = read();
    let mut x: Vec<i64> = vec![];
    let mut tmp: i64 = 0;

    for i in 0..1000 {
        tmp += i;
        x.push(tmp);
    }
    // println!("{:?}", x);

    println!("{}", x[b - a] - b as i64);
}


#![allow(unused)]

//入力マクロここから
//https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
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" ) } ; }
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 ) * } } ; }
//入力マクロここまで

//input
//use std::io::Read;

//collections
//use std::collections::BTreeMap;
//use std::collections::BTreeSet;
//use std::collections::HashMap;
//use std::collections::HashSet;

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

    let mut ans = 0;

    for i in 1..b - a  {
        ans += i;
    }

    ans -= a;

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


#[macro_use]
pub mod basic_stdin {
use std::str::FromStr;

pub fn read<T: FromStr>() -> T {
    use std::io::stdin;
    use std::io::Read;

    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed reading char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed parsing")
}

}

#[macro_export]
macro_rules! test_function {
    (func = $func:expr, $($input:expr => $output:expr),* $(,)*) => {
        $(
            assert_eq!($func(std::io::Cursor::new($input)) , $output);
        )*
    };
}

#[macro_export]
macro_rules! input_macro {
    (string = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    (reader = $s:expr, $($r:tt)*) => {
        let reader = std::io::BufReader::new($s);
        let mut bytes = std::io::Read::bytes(reader);
        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_export]
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)*}
    };
    ($iter:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

#[macro_export]
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() {
    let stdin = std::io::stdin();
    let ret = solve(stdin.lock());

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

fn solve<T: std::io::Read>(reader: T) -> u64 {
    input_macro! {
        reader = reader,
        a: u64,
        b: u64,
    }

    let n = b - a - 1;

    n * (n + 1) / 2 - a
}

#[cfg(test)]
mod tests {

    #[test]
    fn test_solve_function() {
        atcorder::test_function! {
            func = super::solve,
            "8 13" => 2,
            "1 6" => 9,
            "54 65" => 1,
        }
    }
}


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

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

fn main() {
    let a: usize = read();
    let b: usize = read();
    let mut x: Vec<i64> = vec![];
    let mut tmp: i64 = 0;

    for i in 0..999 {
        tmp += i;
        x.push(tmp);
    }
    // println!("{:?}", x);

    println!("{}", x[b - a] - b as i64);
}


#[macro_use]
pub mod basic_stdin {
use std::str::FromStr;

pub fn read<T: FromStr>() -> T {
    use std::io::stdin;
    use std::io::Read;

    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed reading char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed parsing")
}

}

#[macro_export]
macro_rules! test_function {
    (func = $func:expr, $($input:expr => $output:expr),* $(,)*) => {
        $(
            assert_eq!($func(std::io::Cursor::new($input)) , $output);
        )*
    };
}

#[macro_export]
macro_rules! input_macro {
    (string = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    (reader = $s:expr, $($r:tt)*) => {
        let reader = std::io::BufReader::new($s);
        let mut bytes = std::io::Read::bytes(reader);
        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_export]
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)*}
    };
    ($iter:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

#[macro_export]
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() {
    let stdin = std::io::stdin();
    let ret = solve(stdin.lock());

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

fn solve<T: std::io::Read>(reader: T) -> u64 {
    input_macro! {
        reader = reader,
        a: u64,
        b: u64,
    }

    let n = b - a - 1;
    dbg!(n);

    n * (n + 1) / 2 - a + 1
}

#[cfg(test)]
mod tests {

    #[test]
    fn test_solve_function() {
        atcorder::test_function! {
            func = super::solve,
            "8 13" => 2,
            "1 6" => 9,
            "54 65" => 1,
        }
    }
}


#[macro_use]
pub mod basic_stdin {
use std::str::FromStr;

pub fn read<T: FromStr>() -> T {
    use std::io::stdin;
    use std::io::Read;

    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed reading char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed parsing")
}

}

#[macro_export]
macro_rules! test_function {
    (func = $func:expr, $($input:expr => $output:expr),* $(,)*) => {
        $(
            assert_eq!($func(std::io::Cursor::new($input)) , $output);
        )*
    };
}

#[macro_export]
macro_rules! input_macro {
    (string = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    (reader = $s:expr, $($r:tt)*) => {
        let reader = std::io::BufReader::new($s);
        let mut bytes = std::io::Read::bytes(reader);
        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_export]
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)*}
    };
    ($iter:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

#[macro_export]
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() {
    let stdin = std::io::stdin();
    let ret = solve(stdin.lock());

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

fn solve<T: std::io::Read>(reader: T) -> u64 {
    input_macro! {
        reader = reader,
        _a: u64,
        b: u64,
    }

    let mut sum: u64 = 0;
    for i in 1..100 {
        sum += i;
        if sum >= b {
            return sum - b;
        }
    }

    assert!(false);

    0
}

#[cfg(test)]
mod tests {

    #[test]
    fn test_solve_function() {
        atcorder::test_function! {
            func = super::solve,
            "8 13" => 2,
            "54 65" => 1,
        }
    }
}


let i=readLine()!.characters.split(" ").map{Int(String($0))!};print((1..<i[1]-i[0]).reduce(0){$0+$1}-i[0])


let i=readLine()!.characters.split(" ").map{Int(String($0))!};print((1..<i[1]-i[0]).reduce(-i[0]){$0+$1})


import Foundation
func toTuple<T>(_ args: [T]) -> (T, T) { (args[0], args[1]) }
func readInts() -> [Int] { readLine()!.split(separator: " ").map { Int($0)! } }

let (a, b) = toTuple(readInts())
let n = b - a - 1
print(n * (n + 1) / 2 - a)


let i=readLine()!.characters.split(" ").map{Int(String($0))!},a=i[0],b=[1];print((1..<b-a).reduce(0){$0+$1}-a)


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

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

const diff = b - a

let tower = 0
let towers = []
for (let i = 1; i <= 999; i++) {
  tower += i

  towers.push(tower)
}

let res = 0
towers.forEach((e, i) => {
  if(i > 0){
    if(e - towers[i-1] === diff){
      res = e - b
    }
  }
})

console.log(res)


const input=require('fs').readFileSync('/dev/stdin','utf8').split(/[\s]/);const tn=():number=>{const a=input[0];input.shift();return Number(a)};const tnn=(n:number):number[]=>{const a=[];for(let i=0;i<n;i++){a.push(tn())}return a};const ts=():string=>{const a=input[0];input.shift();return String(a)};const tss=(n:number):string[]=>{const a=[];for(let i=0;i<n;i++){a.push(ts())}return a};const tc=():string=>{let a=input[0].split('');const b=a[0];a.shift();if(a.length>0){input[0]=a.join('')}else{input.shift()}return String(b)};const tcc=(n:number):string[]=>{const a=[];for(let i=0;i<n;i++){a.push(tc())}return a};const to=(...arg)=>{console.log(...arg)};const abs=(a)=>{return Math.abs(a)};const min=(...a)=>{return Math.min(...a)};const max=(...a)=>{return Math.max(...a)};const floor=(a)=>{return Math.floor(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 sw=(a,arr:any[],op:'=='|'>='|'>'|'<='|'<'='==')=>{for(let i=0;i<arr.length;i+=2){if(eval(a+op+arr[i]))return arr[i+1];}return arr[arr.length-1]};const near=(n:number,arr:number[]):number=>{let ne=arr[0],ni=0;for(let i=1;i<arr.length;i++){if(Math.abs(n-ne)>Math.abs(n-arr[i])){ne=arr[i];ni=i}}return ni};
const main=()=>{
  let [a,b]=tnn(2)
  let n=b-a
  to(n*(n+1)/2-b)
}
main()


const Main = (input: string): void => {
	const [a, b] = input.split(" ")
	const numA = parseInt(a)
	const numB = parseInt(b)
	const diff = numB - numA
	let sum = 0;
	for (let i = 1; i <= diff; i++) {
		sum += i
	}
	console.log(sum - numB)
}

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


import * as fs from 'fs';

namespace AtCoder.abc099 {

    export class Program {

        constructor(private readonly args: string[][]) {
        }

        /**
         * in
         *
         * out
         *
         */
        main(this: Program): void {
            const a: number = parseInt(this.args[0][0], 10);
            const b: number = parseInt(this.args[0][1], 10);

            let working: boolean = true;
            let ans: number = 0;

            while (working) {
                let sum: number = 0;
                ans++;
                for (let i: number = 1; i < a; i++) {
                    sum += i;
                    if (a + ans === sum && b + ans === sum + i + 1) {
                        working = false;
                        break;
                    }

                    if (sum>a) {
                        break;
                    }
                }
            }

            console.log(ans);
        }
    }
}

const args: string[][] = fs.readFileSync('/dev/stdin', 'utf8').trim().split('\n').map(r => r.split(' '));
const prg: AtCoder.abc099.Program = new AtCoder.abc099.Program(args);
prg.main();


import * as fs from 'fs';

namespace AtCoder.abc099 {

    export class Program {

        constructor(private readonly args: string[][]) {
        }

        /**
         * in
         *
         * out
         *
         */
        main(this: Program): void {
            const a: number = parseInt(this.args[0][0], 10);
            const b: number = parseInt(this.args[0][1], 10);

            let working: boolean = true;
            let ans: number = 0;

            while (working) {
                let sum: number = 0;
                ans++;
                for (let i: number = 1; i < a; i++) {
                    sum += i;
                    if (a + ans === sum && b + ans === sum + i + 1) {
                        working = false;
                        break;
                    }
                }
            }

            console.log(ans);
        }
    }
}

const args: string[][] = fs.readFileSync('/dev/stdin', 'utf8').trim().split('\n').map(r => r.split(' '));
const prg: AtCoder.abc099.Program = new AtCoder.abc099.Program(args);
prg.main();


import * as fs from 'fs';

const input = (fs.readFileSync('/dev/stdin', 'utf8') as string).split('\n');

const [a, b] = input[0].split(' ').map((x) => +x);

let sum = 0;
for (let i = 1; i < 1000; i++) {
  sum += i;
  if (a <= sum) {
    for (let j = 1; j < b - a; j++) {
      if (sum === a + j) {
        console.log(j);
        break;
      }
    }
    break;
  }
}


# -*- coding: utf-8 -*-

N = int(input())

ans = int(N ** 0.5) ** 2
print(ans)


N = int(input())
c = 1
for i in reversed(range(int(N**(1/2))+1)):
    if i**2 <= N:
        c = i**2
        break
    break

print(c)


X = int(input())
print(int((X**.5))**2)


import math
x=int(input())
y= math.sqrt(x)
z= y//1
print(int(z))


import math
x=int(input())
y= math.sqrt(x)
z= y//1
print(int(z)


x=input()
float(y)= sqrt(x)
z= y//1
print(z)


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

public class Main {
    BufferedReader br;
    PrintWriter out;
    StringTokenizer stok;

    String nextToken() throws IOException {
        while (stok == null || !stok.hasMoreTokens()) {
            String s = br.readLine();
            if (s == null) {
                return null;
            }
            stok = new StringTokenizer(s);
        }
        return stok.nextToken();
    }

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

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

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

    char nextChar() throws IOException {
        return (char) (br.read());
    }

    String nextLine() throws IOException {
        return br.readLine();
    }

    void solve() throws IOException {
        long n = nextInt();
        long x = 1;
        while (x * x <= n) {
            x++;
        }
        x--;
        out.println(x * x);
    }

    void run() throws IOException {
        // br = new BufferedReader(new FileReader("dragons.in"));
        //out = new PrintWriter("dragons.out");
        // br = new BufferedReader(new FileReader("input.txt"));
        // out = new PrintWriter("output.txt");
        br = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        solve();
        br.close();
        out.close();
    }

    public static void main(String[] args) throws IOException {
        // Locale.setDefault(Locale.US);
        new Main().run();
    }
}


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

public class Main {

	/**
	 * @param args
	 * @throws IOException
	 */
	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str1 = br.readLine();
		int n = Integer.parseInt(str1);

		System.out.println((int)Math.pow((int)Math.sqrt(n), 2));
	}

}


import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.NoSuchElementException;
import java.util.PriorityQueue;

public class Main {

	void solve() {
		n  = in.nextInt();
		a = 1;
		b = a;
		while(true){
			b++;
			if(b*b>n){
				break;
			}
			a=b;
		}
		out.println(a*a);
	}

	// only call
	public static void main(String[] args) {
		new Main().solve();
		out.flush();
	}

	// predefined
	FastScanner in = new FastScanner(System.in);
	static PrintWriter out = new PrintWriter(System.out);

	int n, m, a, b, c, d, e, f;
	int ret;
	ArrayList<Integer> list = new ArrayList<>();
	ArrayDeque<Integer> q = new ArrayDeque<>();

	// 2D-map
	int H, W;
	final int[] dw = new int[] { 0, 1, 0, -1, 1, 1, -1, -1 };
	final int[] dh = new int[] { 1, 0, -1, 0, 1, -1, 1, -1 };

	boolean inField(int nw, int nh) {
		if (nw < 0 || nw >= W || nh < 0 || nh >= H) {
			return false;
		}
		return true;
	}

	// Yes/No
	static String yesno(boolean f) {
		return yesno(f, "YES", "NO");
	}

	static String yesno(boolean f, String yes, String no) {
		return (f ? yes : no);
	}

	// search
	PriorityQueue<Node> pq = new PriorityQueue<>();

	class Node implements Comparable<Node> {

		double score;

		@Override
		public int compareTo(Node o) {
			return Double.compare(this.score, o.score);
		}
	}

	// library
	class FastScanner {
		private final InputStream in;
		private final byte[] buffer = new byte[1024];
		private int ptr = 0;
		private int buflen = 0;

		FastScanner(InputStream in) {
			this.in = in;
		}

		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() {
			if (hasNextByte())
				return buffer[ptr++];
			else
				return -1;
		}

		private boolean isPrintableChar(int c) {
			return 33 <= c && c <= 126;
		}

		public boolean hasNext() {
			while (hasNextByte() && !isPrintableChar(buffer[ptr]))
				ptr++;
			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 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();
			}
		}

		public int nextInt() {
			long nl = nextLong();
			if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)
				throw new NumberFormatException();
			return (int) nl;
		}

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


import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String a = sc.next();
		String b = new StringBuffer(sc.next()).reverse().toString();

		System.out.println(a.equals(b) ? "YES" : "NO");

		sc.close();

	}

}


import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		long ans = 0;

		for(int i=0; Math.pow(i,2)<n; i++){
		    ans = (long)Math.pow(i,2);
		}

      	System.out.println(ans);
    }
}


import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
      	//数値の入力
		long n = sc.nextLong();
      	long count = 0;

        for(int i = 1; i < n; i++){
        	if(i*i<=n){
              count++;
            }
        }
              System.out.println(count*count);
     }
}


#include<stdio.h>
#pragma warning (disable:4996)
int main()
{
	int a,i,b;
	while (scanf("%d",&a)!= EOF)
	{
		for (i = 1;; i++)
		{
			if (i*i > a) {
				b = i - 1; break;
			}
		}
		printf("%d", b*b);
	}
}


#include <bits/stdc++.h>
using namespace std;
int main(){

    long long n, i = 0; cin >> n;

    while( i*i <= n ){
        i++;
    }
    i--;
    cout << i*i << '\n';

}


#include<bits/stdc++.h>
#include<vector>

#define pb push_back
#define rep(i, a, n) for(int (i)=a; (i)<(n); (i)++)
#define FOR(i, n) rep(i, 0, n)
#define F(n) FOR(i, n)
#define FF(n) FOR(j, n)
#define repi(i, a, n) for(int (i)=a; (i)<=(n); (i)++)
#define FORI(i, n) repi(i, 1, n)
#define FI(n) FORI(i, n)
#define FFI(n) FORI(j, n)
#define IN(x) int x; cin>>(x);
#define SIN(x) string x; cin>>x;
#define INN(x, y) int x, y; cin>>(x)>>(y);
#define INFO(a) cout<<"info "<<a<<endl
#define vi vector<int>
#define vll vector<ll>
#define pii pair<int, int>
#define vpii vector<pair<int, int> >
#define sortv(x) sort((x).begin(), (x).end())
#define sortvd(x) sort((x).begin(), (x).end(), greater<int>())
#define lboundv(x,v) lower_bound((x).begin(),(x).end(),(v))-(x).begin();
#define uboundv(x,v) upper_bound((x).begin(),(x).end(),(v))-(x).begin();
#define ite iterator
#define fi first
#define se second
#define mems(a, v) memset((a), (v), sizeof((a)))
#define lmid(l, r) ((l)+(r)-1)/2
#define rmid(l, r) ((l)+(r))/2+1
#define mp make_pair

typedef long long ll;
typedef long double LD;

using namespace std;

int main() {
	ios::sync_with_stdio(0);
	IN(n);
	cout<<(int) pow(((int) sqrt(n)), 2)<<endl;
	return 0;
}


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

int main(){
  int n;
  cin >> n;
  int i = 1;
  while(i*i < n){
    ++i;
  }
  --i;
  cout << i*i;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int i,n,a;
    cin>>n;
    for(i=n;i>=1;i--)
    {
        a=sqrt(i);
        if(i%a==0)
        {
            cout<<i<<endl;
            return 0;
        }
    }
}


#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
using ll = long long;

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

  ll ans = 0;
  while (ans * ans <= N) ans++;
  cout << pow(ans - 1, 2) << endl;
  return 0;
}


//set many funcs template
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<stdbool.h>
#define inf 1072114514
#define llinf 4154118101919364364
#define mod 1000000007
#define pi 3.1415926535897932384

int max(int a,int b){if(a>b){return a;}return b;}
int min(int a,int b){if(a<b){return a;}return b;}
int zt(int a,int b){return max(a,b)-min(a,b);}
int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
int ceil(int a,int b){if(a%b==0){return a/b;}return (a/b)+1;}
int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;}
int lcm(int a,int b){int c=gcd(a,b);a/=c;return a*b;}
int nCr(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
int fact(int a){int i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}
int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}
long long llmax(long long a,long long b){if(a>b){return a;}return b;}
long long llmin(long long a,long long b){if(a<b){return a;}return b;}
long long llzt(long long a,long long b){return llmax(a,b)-llmin(a,b);}
long long llround(long long a,long long b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
long long llceil(long long a,long long b){if(a%b==0){return a/b;}return (a/b)+1;}
long long llgcd(long long a,long long b){long long c;while(b!=0){c=a%b;a=b;b=c;}return a;}
long long lllcm(long long a,long long b){long long c=llgcd(a,b);a/=c;return a*b;}
long long llnCr(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
long long llfact(long long a){long long i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}
long long llpow(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}
double dbmax(double a,double b){if(a>b){return a;}return b;}
double dbmin(double a,double b){if(a<b){return a;}return b;}
double dbzt(double a,double b){return dbmax(a,b)-dbmin(a,b);}
int sortfncsj(const void *a,const void *b){if(*(int *)a>*(int *)b){return 1;}if(*(int *)a==*(int *)b){return 0;}return -1;}
int sortfnckj(const void *a,const void *b){if(*(int *)a<*(int *)b){return 1;}if(*(int *)a==*(int *)b){return 0;}return -1;}
int llsortfncsj(const void *a,const void *b){if(*(long long *)a>*(long long *)b){return 1;}if(*(long long *)a==*(long long *)b){return 0;}return -1;}
int llsortfnckj(const void *a,const void *b){if(*(long long *)a<*(long long *)b){return 1;}if(*(long long *)a==*(long long *)b){return 0;}return -1;}
int dbsortfncsj(const void *a,const void *b){if(*(double *)a>*(double *)b){return 1;}if(*(double *)a==*(double *)b){return 0;}return -1;}
int dbsortfnckj(const void *a,const void *b){if(*(double *)a<*(double *)b){return 1;}if(*(double *)a==*(double *)b){return 0;}return -1;}

int main(void){
    int n,l=1,h=40000,t,bt=inf;
    scanf("%d",&n);
    while(l!=h){
        t=(l+h)/2;
        if(t==bt){t++;}
        if((t*t)<=n){l=t;}else{h=t-1;}
        bt=t;
    }
    printf("%d\n",l*l);
    return 0;
}


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

int main() {

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

    int temp = (int) sqrt(n);

    printf("%d", temp * temp);

    return 0;

}


#include <stdio.h>
int main(){
  int N;
  scanf("%d", &N);
  long long i = 1;
  long long ans = 0;
  while(i * i <= N){
    ans = i * i;
    i++;
  }
  printf("%lld\n", ans);
}


#include<stdio.h>
Int main(){
long int n;
Scanf("%ld",&n);
for(int i=0;i<=n;i++){
if(i*i>=n){
If(i*i==n){
Printf("%ld",i*i);
}
else{
Printf("%ld",(i-1)*(i-1));
}
break
}
}
return 0;
}


#include <stdio.h>
int main(void){
    long long N, i, j;
    int cnt = 1;

    scanf("%lld", &N);

    for(i = N; i > 0; i--){
        for(j = 0; j < N; j++){
            if(i == j * j){
                printf("%lld\n", i);
                cnt = 0;
                break;
            }
        }
        if(cnt == 0){
            break;
        }
    }

}


#include <stdio.h>
int main(){
  int N;
  scanf("%d", &N);
  long long i = 1;
  long long ans = 0;
  while(i * i <= N){
    ans = i * i;
    i++
  }
  printf("%lld\n", ans);
}


function myin(){return require("fs").readFileSync("/dev/stdin", "utf8").trim();}
function myout(t){console.log(t);}//standard output
//[no]param
//0:何もしない  1:数値へ変換  2:半角SPで分割  3:改行で分割  4:半角SPで分割し、数値配列へ
//5:改行で分割し、数値配列へ  6:1文字に分割  7:1文字に分割し、数値配列へ
function myconv(i,no){switch(no){case 0:return i;case 1:return parseInt(i);case 2:return i.split(" ");case 3:return i.split("\n");case 4:return i.split(" ").map((a)=>Number(a));case 5:return i.split("\n").map((a)=>Number(a));case 6:return i.split("");case 7:return i.split("").map((a)=>Number(a));}}

function Main(input) {
  input = myconv(input,1);
  myout(Math.pow(Math.floor(Math.sqrt(input)),2));
}

Main(myin());


"use strict";
const Main = (input) =>{
   let xs = input.trim().split(' ').map(v=>parseInt(v,10));
   let num = Math.sqrt(xs[0]);
   let ans = Math.floor(num);
   console.log(Math.pow(ans,2));
}
Main(require('fs').readFileSync('/dev/stdin','utf8'));


function Main(input)
{
  input = input.split("\n");

  var a = parseInt(input[0], 10);
  // for(let i = 1; i <= a; i++)
  // {
  //   if (Math.pow(a, 0.5) % 1 != 0) {
  //     a -= 1;
  //   }else{
  //     console.log(a);
  //     break;
  //   }
  // }
  console.log(Math.pow(parseInt(Math.pow(a, 0.5), 10), 2));

  // console.log('%d', a);
}

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


function main(input) {
  input=input.trim();
  var a = parseInt(input.split("\n")[0], 10);
  var i=0
  while(Number.isInteger(Math.pow(a,1/2))==false){
    i++
  }
  console.log(a-i);

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


function main(input) {
  input=input.trim();
  var a = parseInt(input.split("\n")[0], 10);
  var i=0
  while(Number.isInteger(Math.pow(N,1/2))==false){
    i++
  }
  console.log(a-i);

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


"use strict";

const main = arg => {
    const N = parseInt(arg.split("\n")[0]);

    if(N === 1) {
        console.log(1);
        return;
    }

    for(let i=0; i<N; i++) {
        if(Math.pow(i, 2) > N) {
            console.log(Math.pow(i-1, 2));
            return;
        }
    }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


package main

import (
  "fmt"
  "math"
)

func main() {
  var n float64
  fmt.Scan(&n)
  fmt.Println(int(math.Pow(math.Floor(math.Sqrt(n)), 2)))
}


package main

import (
	"bufio"
	"container/heap"
	"fmt"
	"math"
	"os"
	"strconv"
)

const (
	initialBufSize = 10000
	maxBufSize     = 1000000
	mod            = 1e9 + 7
)

var (
	sc *bufio.Scanner = func() *bufio.Scanner {
		sc := bufio.NewScanner(os.Stdin)
		buf := make([]byte, initialBufSize)
		sc.Buffer(buf, maxBufSize)
		sc.Split(bufio.ScanWords)
		return sc
	}()
)

func main() {
	N := getInt()

	result := 0
	for i := 1; i <= int(math.Sqrt(float64(N))); i++ {
		if result < i * i {
			result = i * i
		}
	}
	fmt.Println(result)
}

type Graph struct {
	n     int
	edges [][]int
}

func NewGraph(n int) *Graph {
	g := &Graph{
		n:     n,
		edges: make([][]int, n),
	}
	return g
}

func (g *Graph) AddEdge(u, v int) {
	g.edges[v] = append(g.edges[v], u)
	g.edges[u] = append(g.edges[u], v)
}

func dfs(c int, edges [][]int, visited map[int]struct{}) {
	visited[c] = struct{}{}

	for _, v := range edges[c] {
		_, flag := visited[v]
		if flag {
			continue
		}
		dfs(v, edges, visited)
	}
}

func bfs(c int, graph *Graph) {
	next := make([]int, 0)
	next = append(next, c)
	visited := make(map[int]struct{})

	for ; len(next) != 0; {
		u := next[0]
		next = next[1:]
		visited[u] = struct{}{}

		for _, v := range graph.edges[u] {
			_, flag := visited[v]
			if flag {
				continue
			}

			// なにか処理

			next = append(next, v)
		}
	}
}

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

func getIntArray(n int) []int {
	array := make([]int, n)
	for i := 0; i < n; i++ {
		array[i] = getInt()
	}
	return array
}

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

func getStringArray(n int) []string {
	array := make([]string, n)
	for i := 0; i < n; i++ {
		array[i] = getString()
	}
	return array
}

func abs(a int) int {
	return int(math.Abs(float64(a)))
}

func pow(p, q int) int {
	return int(math.Pow(float64(p), float64(q)))
}

func powMod(n, p int) int {
	if p == 0 {
		return 1
	} else if p%2 == 0 {
		t := powMod(n, p/2)
		return calcMod(t * t)
	} else {
		return calcMod(n * powMod(n, p-1))
	}
}

func min(nums ...int) int {
	if len(nums) == 0 {
		panic("funciton min() requires at least one argument.")
	}
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		res = int(math.Min(float64(res), float64(nums[i])))
	}
	return res
}

func max(nums ...int) int {
	if len(nums) == 0 {
		panic("funciton max() requires at least one argument.")
	}
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		res = int(math.Max(float64(res), float64(nums[i])))
	}
	return res
}

func strSearch(a []string, b string) bool {
	for i := 0; i < len(a); i++ {
		if a[i] == b {
			return true
		}
	}
	return false
}

func printIntArray(array []int) {
	strArray := fmt.Sprint(array)
	fmt.Println(strArray[1 : len(strArray)-1])
}

func calcMod(x int) int {
	return x % mod
}

func reverse(s string) string {
	runes := []rune(s)
	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 isPrime(n int) bool {
	if n < 2 {
		return false
	} else if n == 2 {
		return true
	} else if n % 2 == 0 {
		return false
	}

	sqrtN := int(math.Sqrt(float64(n)))
	for i := 3; i <= sqrtN; i += 2 {
		if n % i == 0 {
			return false
		}
	}

	return true
}

func contains(s []int, e int) bool {
	for _, v := range s {
		if e == v {
			return true
		}
	}
	return false
}

func makeRange(min, max int) []int {
	a := make([]int, max-min+1)
	for i := range a {
		a[i] = min + i
	}
	return a
}

func powerset2(nums []int) [][]int {
	length := int(math.Pow(2, float64(len(nums))))
	result := make([][]int, length)

	index := 0
	result[index] = []int{}
	index++

	for _, n := range nums {
		max := index
		for i := 0; i < max; i++ {
			result[index] = copyAndAppend(result[i], n)
			index++
		}
	}

	return result
}

func copyAndAppend(nums []int, n int) []int {
	dst := make([]int, len(nums)+1)
	copy(dst, nums)
	dst[len(nums)] = n
	return dst
}

func calcGcd(x, y int) int {
	if y == 0 {
		return x
	} else if x >= y {
		return calcGcd(y, x % y)
	} else {
		return calcGcd(x, y % x)
	}
}

func getDivisor(n int) []int {
	var divisor []int
	divisor = append(divisor, 1)
	if n != 1 {
		divisor = append(divisor, n)
	}

	sqrt := int(math.Sqrt(float64(n)))
	for i := 2; i <= sqrt; i++ {
		if n % i == 0 {
			divisor = append(divisor, i)
			divisor = append(divisor, n/i)
		}
	}
	return divisor
}

type intHeap []int

func (h intHeap) Len() int {
	return len(h)
}

func (h intHeap) Less(i, j int) bool {
	return h[i] > h[j]
}

func (h intHeap) Swap(i, j int) {
	h[i], h[j] = h[j], h[i]
}

func (h *intHeap) Push(x interface{}) {
	*h = append(*h, x.(int))
}

func (h *intHeap) Pop() interface{} {
	old := *h
	n := len(old)
	x := old[n-1]
	*h = old[0 : n-1]
	return x
}

func initHeap() *intHeap {
	ih := &intHeap{}
	heap.Init(ih)
	return ih
}

func (h *intHeap) pushHeap(n int) {
	heap.Push(h, n)
}

func (h *intHeap) popHeap() int {
	return heap.Pop(h).(int)
}

func factMod(n int) int {
	value := 1
	for ; n > 1; n-- {
		value = calcMod(value * n)
	}
	return value
}

func combinationMod(n, k int) int {
	factN := factMod(n)
	factK := factMod(k)
	factNK := factMod(n - k)
	factKR := powMod(factK, mod - 2)
	factNKR := powMod(factNK, mod - 2)
	return calcMod(factN * calcMod(factKR * factNKR))
}


package main

import (
	"fmt"
	"math"
)

func isInt(n float64) bool {
	return math.Floor(n) == n
}

func main() {
	var n float64
	fmt.Scan(&n)

	for i := n; 0 < i; i-- {
		n := math.Sqrt(i)
		if isInt(n) {
			fmt.Println(int(i))
			break
		}
	}
}