/* package whatever; // don't place package name! */

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

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	public int singleNumber(int[] nums) {
    int sing = nums[0];
    for (int i = 1; i < nums.length; i++) {
      sing = sing ^ nums[i];
    }
    return sing;

  }
  
	public static void main (String[] args) throws java.lang.Exception
	{
		// your code goes here
		Ideone x = new Ideone();
		int[] arr = {4, 5, 5, 2, 2};
		System.out.println(x.singleNumber(arr));
	}
}