    Module Module1

        Sub Main()
            Dim a, b, x As Integer
            a = Console.ReadLine
            b = Console.ReadLine
            x = Console.ReadLine
            Console.WriteLine((x - a) Mod b)
            Console.ReadLine()

        End Sub

    End Module