J. Refactoring
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

You are given the source code of a program in several popular programming languages. This program reads two integers $$$a$$$ and $$$n$$$ and then outputs one integer — the answer.

With large input numbers, this program can take a long time to run. Your task is to write an alternative program that will produce exactly the same answers, but will run for no more than one second for any input $$$a$$$ and $$$n$$$ in the range from $$$0$$$ to $$$10^{18}$$$.

Text in C++:

#include <iostream>

int main() {
long long a, n;
std::cin >> a >> n;
long long b = 0;
for (long long i = 0; i < n; i++) {
b = (b - a) & a;
}
std::cout << b << std::endl;
}
Text in Python:
a = int(input())
n = int(input())
b = 0
for _ in range(n):
b = (b - a) & a
print(b)

Text in Java:

import java.util.Scanner;

public class Solution {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
long a = in.nextLong();
long n = in.nextLong();
long b = 0;
for (long i = 0; i < n; i++) {
b = (b - a) & a;
}
System.out.println(b);
}
}

Text in C#:

using System;

public class Solution {
static void Main() {
long a = long.Parse(Console.ReadLine());
long n = long.Parse(Console.ReadLine());
long b = 0;
for (long i = 0; i < n; i++) {
b = (b - a) & a;
}
Console.WriteLine(b);
}
}

Text in Pascal:

var
a, b, n, i: int64;
begin
read(a, n);
b := 0;
i := 0;
while i < n do begin
b := (b - a) and a;
inc(i);
end;
writeln(b);
end.
Input

The first line of input contains an integer $$$a$$$, the second line contains an integer $$$n$$$ ($$$0 \le a, n \le 10^{18}$$$).

Output

Output one integer — the answer.

Examples
Input
3
2
Output
2
Input
5
6
Output
4
Note

It is assumed that negative integers in memory are represented in two's complement as in most popular processor architectures (including x86-64 architecture). In two's complement, the negative number $$$-x$$$ is stored in memory as the complement to $$$2^{64}$$$ of $$$x$$$.

Note that in Python, integers are not limited by a fixed number of bits. But this does not affect the answer, so you can assume that the statement above is true for Python as well.