Problem:
Score : 100 points

Problem Statement

You are given three integers, A, B and C.

Among them, two are the same, but the remaining one is different from the rest.

For example, when A=5,B=7,C=5, A and C are the same, but B is different.

Find the one that is different from the rest among the given three integers.

Constraints

-100 \leq A,B,C \leq 100

A, B and C are integers.

The input satisfies the condition in the statement.

Input

Input is given from Standard Input in the following format:

A B C

Output

Among A, B and C, print the integer that is different from the rest.

Sample Input 1

5 7 5

Sample Output 1

7

This is the same case as the one in the statement.

Sample Input 2

1 1 7

Sample Output 2

7

In this case, C is the one we seek.

Sample Input 3

-100 100 100

Sample Output 3

-100

Solution in Rust (1.42.0) (judge verdict: Runtime Error)

use std::io;

fn main() {
	// reading H W 
	let mut line = String::new();
	io::stdin().read_line(&mut line).unwrap();
	let vec : Vec<&str> = line.split_whitespace().collect();

	let h : usize = vec[0].parse().unwrap();
	let w : usize = vec[1].parse().unwrap();

	// prepareing h x w grid
	let mut grid = vec![vec!['.'; w]; h];

	// reading strings which stand for empty squares and bomb squares
	for hi in 0..h {
		let mut line = String::new();
		io::stdin().read_line(&mut line).unwrap();
		
		let mut wi = 0;
		for c in line.trim_end().chars() {
			if c == '#' {
				grid[hi][wi] = '#';
			}
			wi += 1;
		}
	}
	
	// preparing arrays for neigher search
	let dw: [i64; 8] = [-1, 0, 1, -1, 1, -1, 0, 1];
	let dh: [i64; 8] = [-1, -1, -1, 0, 0, 1, 1, 1];

	// counting '#' adjacent to each '.' square in grid
	for hi in 0..h {
		let mut out_row = String::from("");
		for wi in 0..w {
			if grid[wi][hi] == '#' {
				out_row.push(grid[wi][hi]);
				continue;
			}

			let mut cnt = 0;
			for d in 0..8 {
				let nwi = wi as i64 + dw[d];
				let nhi = hi as i64 + dh[d];

				if nwi < 0 || nwi >= w as i64 {
					continue;
				}
				if nhi < 0 || nhi >= h as i64 {
					continue;
				}

				if grid[nwi as usize][nhi as usize] == '#' {
					cnt += 1;
				}
			}
			grid[wi][hi] = cnt.to_string().chars().next().unwrap();
			out_row.push(grid[wi][hi]);
		}
		println!("{}", out_row);
	}

	// output
	// for hi in 0..h {
	// 	let mut out_row = String::from("");
	// 	for wi in 0..w {
	// 		out_row.push(grid[wi][hi]);
	// 	}
	// 	println!("{}", out_row);
	// }
}