#include <bits/stdc++.h>
using namespace std;
//#define ONLINE_JUDGE
#define iloop(n) for(int i=0;i<n;i++)
#define jloop(n) for(int j=0;j<n;j++)
#define all(x) x.begin(),x.end()
typedef long long ll;
typedef std::vector<int> vi;
typedef std::pair<int, int> pii;
typedef std::pair<long, long> pll;
typedef std::vector<std::vector<int>> vvi;
typedef std::vector<pii> vpii;
typedef std::vector<vector<pair<int, int>>> vvpii;
typedef std::vector<vector<ll>> vvll;
typedef std::vector<ll> vll;
typedef std::vector<vector<char>> vvc;
typedef std::vector<char> vc;
ll mod = (1e9)+7;
template<class T>
void get(vector<T>& a){int n=a.size(); iloop(n) {cin>>a[i];}}
template<class T>void out(vector<T>& a){for(T e:a) cout<<e<<' ';cout<<'\n';}
bool check(pii& p1, pii& p2)
{
return abs(p1.first)+abs(p1.second) < abs(p2.first)+abs(p2.second);
}
void get_dialogue(int mode, int x)
{
if(x==0) return;
//horizontal
if(mode==1)
{
if(x<0)
{
cout<<"1 "<<-x<<" L"<<'\n';
}
else
{
cout<<"1 "<<x<<" R"<<'\n';
}
}
else
{
if(x<0)
{
cout<<"1 "<<-x<<" D"<<'\n';
}
else
{
cout<<"1 "<<x<<" U"<<'\n';
}
}
}
int main()
{
// #ifndef ONLINE_JUDGE
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
// #endif
ios_base::sync_with_stdio(false); cin.tie(NULL);
int n; cin>>n;
vpii a(n);
for(int i=0;i<n;i++)
{
int x, y; cin>>x>>y;
a[i].first=x;
a[i].second=y;
}
sort(all(a), check);
int cnt=0;
for(auto p:a)
{
if(p.first!=0) cnt+=2;
if(p.second!=0) cnt+=2;
cnt+=2;
}
cout<<cnt<<'\n';
for(auto p:a)
{
// cout<<"point: "<<p.first<<' '<<p.second<<'\n';
get_dialogue(1, p.first);
get_dialogue(2, p.second);
cout<<"2\n";
get_dialogue(2, -p.second);
get_dialogue(1, -p.first);
cout<<"3\n";
}
return 0;
}
322. Coin Change | 307. Range Sum Query - Mutable |
287. Find the Duplicate Number | 279. Perfect Squares |
275. H-Index II | 274. H-Index |
260. Single Number III | 240. Search a 2D Matrix II |
238. Product of Array Except Self | 229. Majority Element II |
222. Count Complete Tree Nodes | 215. Kth Largest Element in an Array |
198. House Robber | 153. Find Minimum in Rotated Sorted Array |
150. Evaluate Reverse Polish Notation | 144. Binary Tree Preorder Traversal |
137. Single Number II | 130. Surrounded Regions |
129. Sum Root to Leaf Numbers | 120. Triangle |
102. Binary Tree Level Order Traversal | 96. Unique Binary Search Trees |
75. Sort Colors | 74. Search a 2D Matrix |
71. Simplify Path | 62. Unique Paths |
50. Pow(x, n) | 43. Multiply Strings |
34. Find First and Last Position of Element in Sorted Array | 33. Search in Rotated Sorted Array |