#include <bits/stdc++.h>
#define rep(i,a,b) for(ll i=ll(a);i<ll(b);i++)
#define irep(i,a,b) for(ll i=ll(a);i>=ll(b);i--)
#define pb push_back
#define mp make_pair
#define pll pair<ll,ll>
#define endl "\n"
using ll=long long;
using ld=long double;
using namespace std;
ll mod= 1e9+7;
ll GCD(ll a, ll b) { return b ? GCD(b, a%b) : a; }

vector<pair<ld,ld>> x;
int main(){
  ll n,ans=0;
  cin>>n;
  rep(i,0,n){
  ld t,l,r;
  cin>>t>>l>>r;
  if((ll)t%2==0)r-=0.5;
  if(t>2)l+=0.5;
  x.pb(mp(l,r));
  }
  rep(i,0,n-1){
      rep(j,i+1,n){
          if(x[i].second>=x[j].first && x[j].second>=x[i].first)ans++;
      }
  }
  cout<<ans<<endl;

}
#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define all(v) v.begin(), v.end()
#define rep(i, begin, end) for(auto i = begin; i < (end); i++)
#define contains(v, x) (find(all(v), x) != v.end())
template<class T> bool chmin(T& a, T b){ if (a > b){ a = b; return true; } return false; }
template<class T> bool chmax(T& a, T b){ if (a < b){ a = b; return true; } return false; }
template<class T> T roundup(T a, T b){ return (a + b - 1) / b; }
const vector<int> dy = {0, 1, 0, -1, 1, 1, -1, -1, 0};
const vector<int> dx = {1, 0, -1, 0, 1, -1, 1, -1, 0};
using ll = long long;
const ll INF = 1e9;
const double EPS = 1e-10;
/* #include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>
namespace mp = boost::multiprecision;
using Bint = mp::cpp_int;
using d32 = mp::number<mp::cpp_dec_float<32>>; */
const ll MOD = 1e9 + 7;
/* #include <atcoder/all>
using namespace atcoder;
using mint = modint1000000007; */
using P = pair<int, int>;
struct Edge{ int to; ll cost; Edge(int to, ll cost) : to(to), cost(cost) {} };
using Graph = vector<vector<int>>;


void solve(){
    int sy, sx, ty, tx;
    cin >> sy >> sx >> ty >> tx;
    rep(_, 0, ty - sy) cout << "D";
    rep(_, 0, sy - ty) cout << "U";
    rep(_, 0, tx - sx) cout << "R";
    rep(_, 0, sx - tx) cout << "L";
    cout << endl;
    cout.flush();
}

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    
    rep(_, 0, 1000){
        solve();
        int k;
        cin >> k;
    }
}
