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 = "import copy\r\nn=int(input())\r\na=[int(x) for x in input().split()]\r\nb=[int(x) for x in input().split()]\r\nc=[]\r\nd=[]\r\nlcs=[]\r\ndef lcsfn(a,c,corda,cordb):\r\n\tfor i in range(n+1):\r\n\t\td.append([0]*(n+1))\r\n\t\tlcs.append([0]*(n+1))\r\n\tfor i in range(1,n+1):\r\n\t\tfor j in range(1,n+1):\r\n\t\t\tif a[i-1]==c[j-1]:\r\n\t\t\t\tlcs[i][j]=lcs[i-1][j-1]+1\r\n\t\t\t\td[i][j]='d'\r\n\t\t\telif lcs[i-1][j]>lcs[i][j-1]:\r\n\t\t\t\tlcs[i][j]=lcs[i-1][j]\r\n\t\t\t\td[i][j]='u'\r\n\t\t\telse:\r\n\t\t\t\tlcs[i][j]=lcs[i][j-1]\r\n\t\t\t\td[i][j]='l'\r\n\ti=n\r\n\tj=n\r\n\tcost=0\r\n\twhile i>=1 and j>=1:\r\n\t\tif d[i][j]=='d':\r\n\t\t\tcorda.append(a[i-1])\r\n\t\t\tcordb.append(b[j-1])\r\n\t\t\ti-=1\r\n\t\t\tj-=1\r\n\t\t\tcost+=1\r\n\t\telif d[i][j]=='l':\r\n\t\t\tj-=1\r\n\t\telif d[i][j]=='u':\r\n\t\t\ti-=1\r\n\treturn cost\r\n\r\n\r\nma=-10**9\r\np1=[]\r\np2=[]\r\nfor i in range(-1000,1001):\r\n\tc=[]\r\n\tcorda=[]\r\n\tcordb=[]\r\n\tfor j in range(n):\r\n\t\tc.append(b[j]+i)\r\n\tp=lcsfn(a,c,corda,cordb)\r\n\tif ma<p:\r\n\t\tma=p\r\n\t\tp1=copy.deepcopy(corda)\r\n\t\tp1=p1[::-1]\r\n\t\tp2=copy.deepcopy(cordb)\r\n\t\tp2=p2[::-1]\r\nprint(ma)\r\nprint(*p1)\r\nprint(*p2)\r\n\r\n"
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 4286891