ahhhhhhhhh. I was expecting people to participate in the last challenge posted by @Phlegethon5778. Well, since no one did, I will be posting my solution.

```
local line = "aa6?9";
local notFound = true;
local n1, n2;
while (notFound) do
local first, second = line:find("?+");
if (not first or not second) then break; end
if ((second - first) == 2) then
local newLine = line;
n1 = newLine:match("%d");
newLine = newLine:gsub("%d", "", 1);
n2 = newLine:match("%d");
newLine = newLine:gsub("%d", "", 1);
if ((n1 + n2) == 10) then
notFound = false;
end
end
line = line:sub(line:match("%d") + 1);
end
print(not notFound);
```

Now, here is the next challenge!

*Chair Stacking*

**Problem Type:** *Greedy Algorithms*

Junya has just finished her trigonometry test. Her teacher asks her kindly to move the chairs into one stack at some location in the 10^9 Γ 10^9 metre classroom. However, her teacher only wants her to move the chairs either along the π₯ axis or the π¦ axis of the classroom. That is, she is not allowed to move the chair diagonally.

Additionally, because she is not that strong, she can only move one chair at a time. For each metre she pushes the chair, it takes her one second.

Being the lazy person she is (but also wanting to be on her teacher's good side), she wants to know the minimum amount of time moving and stacking the chairs will take her.

Help her find the minimum amount of time it will take her to stack all the chairs!

**Input Specification**

The first line will contain the integer π (2 β€ π β€ 10^9) the number of chairs.

The next π lines will each contain two space-separated integers, π₯1, π¦1 (1 β€ π₯1, π¦1 β€ 10^9), the position of the πth chair. Note that there may be multiple chairs at any one location, in which they are to be treated as independent objects.

**Output Specification**

Print the minimum amount of time in seconds it will take her to move and stack all the chairs at one location.

**Sample Input 1**

```
4
1 1
1 3
1 2
1 10
```

**Sample Output1**

```
10
```

**Sample Explanation 1**

The best location to stack the chairs would be at (1, 2).

It would take the first chair 1 second to move to position (1, 2).

It would take the second chair 1 second to move to position (1, 2).

It would take the third chair 0 seconds to move to position (1, 2).

It would take the last chair 8 seconds to move to position (1, 2).

**Sample Input 2**

```
1 1
2 2
3 3
999999998 999999998
999999999 999999999
1000000000 1000000000
```

**Sample Output 2**

```
5999999982
```

Best of Luck!!!