Language: C++

#include<bits/stdc++.h>
#define fo(i, x, y) for(int i = x, B = y; i <= B; i ++)
#define ff(i, x, y) for(int i = x, B = y; i <  B; i ++)
#define fd(i, x, y) for(int i = x, B = y; i >= B; i --)
#define ll long long
#define pp printf
#define hh pp("\n")
using namespace std;

const int N = 1005;

int n;

struct P {
	ll x, y;
	P(ll _x = 0, ll _y = 0) {
		x = _x, y = _y;
	}
} a[N];

int pd(P a) {
	return abs(a.x + a.y) % 2;
}
P operator + (P a, P b) {
	return P(a.x + b.x, a.y + b.y);
}

P operator * (P a, ll b) {
	return P(a.x * b, a.y * b);
}

ll d[45], d0;

P move[4] = {
	P(-1, 0), P(1, 0), P(0, -1), P(0, 1)
};

ll dis(P a) {
	return abs(a.x) + abs(a.y);
}

char cho[4] = {
	'L', 'R', 'D', 'U'
};

char ans[45];

int main() {
	scanf("%d", &n);
	fo(i, 1, n) scanf("%lld %lld", &a[i].x, &a[i].y);
	int jo = pd(a[1]);
	fo(i, 2, n) {
		if(pd(a[i]) != jo) {
			pp("-1\n"); return 0;
		}
	}
	if(!jo) d[++ d0] = 1;
	fo(i, 0, 31) d[++ d0] = 1ll << i;
	pp("%lld\n", d0);
	fo(i, 1, d0) pp("%lld ", d[i]); hh;
	fo(i, 1, n) {
		P t = a[i];
		fd(j, d0, 1) {
			int k = 0; ll s = dis(t + move[0] * d[j]);
			fo(u, 1, 3) {
				ll s2 = dis(t + move[u] * d[j]);
				if(s2 < s) k = u, s = s2;
			}
			t = t + move[k] * d[j];
			ans[j] = cho[k];
		}
		fo(j, 1, d0) putchar(ans[j]);
		putchar('\n');
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:64:51: error: reference to 'move' is ambiguous
   64 |                         int k = 0; ll s = dis(t + move[0] * d[j]);
      |                                                   ^~~~
In file included from /usr/include/c++/14/algorithm:86,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:353:1: note: candidates are: 'template<class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2> std::move(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2)'
  353 | move(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __d_first);
      | ^~~~
In file included from /usr/include/c++/14/algorithm:60:
/usr/include/c++/14/bits/stl_algobase.h:675:5: note:                 'template<class _II, class _OI> _OI std::move(_II, _II, _OI)'
  675 |     move(_II __first, _II __last, _OI __result)
      |     ^~~~
In file included from /usr/include/c++/14/bits/stl_pair.h:61,
                 from /usr/include/c++/14/bits/stl_algobase.h:64:
/usr/include/c++/14/bits/move.h:137:5: note:                 'template<class _Tp> constexpr typename std::remove_reference<_Tp>::type&& std::move(_Tp&&)'
  137 |     move(_Tp&& __t) noexcept
      |     ^~~~
a.cc:34:3: note:                 'P move [4]'
   34 | P move[4] = {
      |   ^~~~
a.cc:66:49: error: reference to 'move' is ambiguous
   66 |                                 ll s2 = dis(t + move[u] * d[j]);
      |                                                 ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:353:1: note: candidates are: 'template<class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2> std::move(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2)'
  353 | move(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __d_first);
      | ^~~~
/usr/include/c++/14/bits/stl_algobase.h:675:5: note:                 'template<class _II, class _OI> _OI std::move(_II, _II, _OI)'
  675 |     move(_II __first, _II __last, _OI __result)
      |     ^~~~
/usr/include/c++/14/bits/move.h:137:5: note:                 'template<class _Tp> constexpr typename std::remove_reference<_Tp>::type&& std::move(_Tp&&)'
  137 |     move(_Tp&& __t) noexcept
      |     ^~~~
a.cc:34:3: note:                 'P move [4]'
   34 | P move[4] = {
      |   ^~~~
a.cc:69:33: error: reference to 'move' is ambiguous
   69 |                         t = t + move[k] * d[j];
      |                                 ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:353:1: note: candidates are: 'template<class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2> std::move(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2)'
  353 | move(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __d_first);
      | ^~~~
/usr/include/c++/14/bits/stl_algobase.h:675:5: note:                 'template<class _II, class _OI> _OI std::move(_II, _II, _OI)'
  675 |     move(_II __first, _II __last, _OI __result)
      |     ^~~~
/usr/include/c++/14/bits/move.h:137:5: note:                 'template<class _Tp> constexpr typename std::remove_reference<_Tp>::type&& std::move(_Tp&&)'
  137 |     move(_Tp&& __t) noexcept
      |     ^~~~
a.cc:34:3: note:                 'P move [4]'
   34 | P move[4] = {
      |   ^~~~