#include <stdio.h>

void main()
{
    int arr[10];
    int i, n, t, diff;

    printf("Enter the size of array:\n");
    scanf("%d", &n);

    printf("Enter the sorted array:\n");
    for (i = 0; i < n; i++)
    {
        scanf("%d", &a[i]);
    }

    printf("Enter target number:\n");
    scanf("%d", &t);

    

    for (i = 0; i < n; i++)
    {
        diff[i] = t - a[i];
    }

    for (i = 0; i < n; i++)
    {
        for (j = 0; j < n; j++)
        {
            if (diff[j] > diff[j+1])
            {
                temp = diff[j];
                diff[j] = diff[j+1];
                diff[j+1] = temp;
            }
        }
	if((diff[i]+a[i])==t)
		print("%d",a[i]);
    }