please help in finding the bug, problem link.

```
program SMPAIR;
var
t,x,N,y,temp:longint;
num:array[1..100000] of longint;
begin
read(t);
for x := 1 to t do
begin
readln(N);
num[x] := N;
end;
for x := 1 to t do
begin
for y := 1 to t-1 do
begin
if num[y] > num[y+1] then
begin
temp := num[y];
num[y] := num[y+1];
num[y+1] := temp;
end;
end;
end;
writeln(num[1]+num[2]);
end.
```