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 = '# cook your dish here\nans = []\nmxlen = 0\n\ndef lcs(a,b,d,mxlen):\n    L = [0]*(n+1)\n    for i in range(n+1):\n        L[i] = [0]*(n+1)\n    #print("#",L,a,b)\n    for i in range(1,n+1):\n        for j in range(1,n+1):\n            if a[i-1] == b[j-1]:\n                L[i][j] = L[i-1][j-1] + 1\n            else:\n                L[i][j] = max(L[i-1][j],L[i][j-1])\n    #print(L)\n    if L[n][n] > mxlen:\n        mxlen = L[n][n]\n        i,j = n,n\n        t = []\n        while i>0 and j>0:\n            if a[i-1] == b[j-1]:\n                t.insert(0,a[i-1])\n                i -= 1\n                j -= 1\n            elif L[i-1][j] > L[i][j-1]:\n                i -= 1\n            else:\n                j -= 1\n        #print(t)\n        ans.append({d:t})\n\ntry:\n    n = int(input())\n    a = [int(w) for w in input().split()]\n    b = [int(w) for w in input().split()]\n    minb = min(b)\n    b = [(i-minb-1) for i in b]\n    for i in range(-1000,1001):\n        bb = b.copy()\n        bb = [(j+i) for j in bb]\n        lcs(a,bb,i,mxlen)\n    ans = sorted(ans, key=lambda i: len(list(i.values())[0]),reverse = True)\n    t = ans[0]\n    d = list(t.keys())[0]\n    t = t[d]\n    print(len(t))\n    print(*t)\n    t = [(i-d+minb+1) for i in t]\n    print(*t)\nexcept:\n    pass'
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 22186