Option Strict On
Imports System.Collections.Generic
Imports System.Console

Module Program
    Sub Main()
        Dim n As Integer = NextInt()
        Dim t As Integer() = New Integer(n - 1) {}
        For i As Integer = 0 To n - 1
            t(i) = NextInt()
        Next

        Dim m As Integer = NextInt()
        Dim ans As String() = New String(m - 1) {}

        For i As Integer = 0 To m - 1
            Dim p As Integer = NextInt() - 1
            Dim x As Integer = NextInt()
            ans(i) = (t.Sum() - t(p) + x).ToString()
        Next

        WriteLine(String.Join(vbLf, ans))
    End Sub

    Function NextInt() As Integer
        Return CInt(NextString())
    End Function

    Function NextString() As String
        Dim result As New List(Of Char)
        Do
            Dim tmp As Integer = Read()
            If tmp < 0 Then Exit Do
            Dim nextChar As Char = Chr(tmp)

            If Not Char.IsWhiteSpace(nextChar) Then
                result.Add(nextChar)
            ElseIf nextChar <> vbCr Then
                Exit Do
            End If
        Loop
        Return New String(result.ToArray())
    End Function

End Module
