Indraneel's student has given him data from two sets of experiments that the student has performed. Indraneel wants to establish a correlation between the two sets of data. Each data set is a sequence of $N$ numbers. The two data sets do not match number for number, but Indraneel believes that this is because data has been shifted due to inexact tuning of the equipment.
For example, consider the following two sequences:
$ $
3  8   4  23  9  11  28
2  3  22  26  8  16  12

$ $
Indraneel observes that if we consider the subsequences $3,4,23,9$ and $2,3,22,8$ and examine their successive differences we get $1,19,-14$. He considers these two subsequences to be "identical". He would like to find the longest such pair of subsequences so that the successive differences are identical. Your task is to help him do this.

-----Input:-----
The first line of the input will contain a single integer $N$ indicating the number of data points in each of Indraneel's student's data sets. This is followed by two lines, each containing $N$ integers.

-----Output:-----
The output consists of three lines. The first line of output contains a single integer indicating the length of the longest pair of subsequences (one from each sequence) that has identical successive differences. This is followed by two lines each containing the corresponding subsequences. If there is more than one answer, it suffices to print one.

-----Constraints:-----
- $1 \leq N \leq 150$.
- $0 \leq$ Each data point $\leq 1000$

-----Sample Input-----
7
3 8 4 23 9 11 28  
2 3 22 26 8 16 12 

-----Sample Output-----
4
3 4 23 9
2 3 22 8

```python

USER_FILENAME = "<user_code>"
import sys, json, builtins
import math, heapq, bisect, itertools, functools, collections, statistics, fractions, decimal, operator, array, random, re, string, os, pathlib
try:
    import resource as _res
except Exception:
    _res = None
from collections import Counter, defaultdict, deque, OrderedDict
from functools import lru_cache, reduce
from itertools import accumulate, permutations, combinations, product
from math import gcd, ceil, floor, sqrt
from decimal import Decimal
try:
    from typing import *
except Exception:
    pass
try:
    sys.setrecursionlimit(1_000_000)
except Exception:
    pass
try:
    import site as _site
    try:
        _sys_sites = _site.getsitepackages() if hasattr(_site, "getsitepackages") else []
        for _p in _sys_sites:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
    try:
        _usp = _site.getusersitepackages()
        if isinstance(_usp, str):
            _usp = [_usp]
        for _p in _usp:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
except Exception:
    pass

ns = {"__name__": "__main__"}
for _k, _v in list(globals().items()):
    if not _k.startswith("_"):
        ns[_k] = _v
_CODE = 'n = int(input())\r\na = list(map(int, input().split()))\r\nb = list(map(int, input().split()))\r\nbb = b[:]\r\nfor i in range(n):\r\n    b[i] -= 1000\r\nans = []\r\ndp = []\r\nfor i in range(n+1):\r\n    dp.append([0] * (n+1))\r\nfor offset in range(2001):\r\n    for i in range(n+1):\r\n        dp[i][0] = 0\r\n        dp[i][0] = 0\r\n    for i in range(1, n+1):\r\n        for j in range(1, n+1):\r\n            if(a[i-1] == b[j-1]):\r\n                dp[i][j] = 1 + dp[i-1][j-1]\r\n            else:\r\n                dp[i][j] = max(dp[i][j-1], dp[i-1][j])\r\n    if(dp[n][n] > len(ans)):\r\n        ans = []\r\n        j = n\r\n        i = n\r\n        while(i > 0 and j > 0):\r\n            if(dp[i][j] > dp[i][j-1] and dp[i][j] > dp[i-1][j]):\r\n                ans.append([i-1, j-1])\r\n                i -= 1\r\n                j -= 1\r\n            elif(dp[i][j] > dp[i][j-1]):\r\n                i -= 1\r\n            else:\r\n                j -= 1\r\n    for i in range(n):\r\n        b[i] += 1\r\nprint(len(ans))\r\nprintable = [[], []]\r\nfor i, j in ans[::-1]:\r\n    printable[0].append(a[i])\r\n    printable[1].append(bb[j])\r\nprint(*printable[0])\r\nprint(*printable[1])'
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 14281