/*

Santa Claus is the first who came to the Christmas Olympiad, and he is going to be the first to take his place at a desk! In the classroom there are n lanes of m desks each, and there are two working places at each of the desks. The lanes are numbered from 1 to n from the left to the right, the desks in a lane are numbered from 1 to m starting from the blackboard. Note that the lanes go perpendicularly to the blackboard, not along it (see picture).

The organizers numbered all the working places from 1 to 2nm. The places are numbered by lanes (i. e. all the places of the first lane go first, then all the places of the second lane, and so on), in a lane the places are numbered starting from the nearest to the blackboard (i. e. from the first desk in the lane), at each desk, the place on the left is numbered before the place on the right.

The picture illustrates the first and the second samples.

Santa Clause knows that his place has number k. Help him to determine at which lane at which desk he should sit, and whether his place is on the left or on the right!

Input

The only line contains three integers n, m and k (1 ≤ n, m ≤ 10 000, 1 ≤ k ≤ 2nm) — the number of lanes, the number of desks in each lane and the number of Santa Claus' place.

Output

Print two integers: the number of lane r, the number of desk d, and a character s, which stands for the side of the desk Santa Claus. The character s should be "L", if Santa Clause should sit on the left, and "R" if his place is on the right.

Example

Input
4 3 9
Output
2 2 L
Input
4 3 24
Output
4 3 R
Input
2 4 4
Output
1 2 R

Note

The first and the second samples are shown on the picture. The green place corresponds to Santa Claus' place in the first example, the blue place corresponds to Santa Claus' place in the second example.

In the third sample there are two lanes with four desks in each, and Santa Claus has the fourth place. Thus, his place is in the first lane at the second desk on the right.

*/

#include <iostream>

using namespace std;

int main() {
    int n, m, k;
    cin>>n>>m>>k; int h, l;
    int t;
    t = (k+) / ;
    //cout<<t<<endl;
    l = t / m;
    h = t % m;
    if(h !=)
        l++;
    else if(h == )
    {
        h=m;
    }
    cout<<l<<" "<<h<<" ";
    if(k % == )
        cout<<"R"<<endl;
    else cout<<"L"<<endl;
    return ;
}

Santa Claus and a Place in a Class的更多相关文章

  1. codeforces 748E Santa Claus and Tangerines

    E. Santa Claus and Tangerines time limit per test 2 seconds memory limit per test 256 megabytes inpu ...

  2. Codeforces Round #389 (Div. 2, Rated, Based on Technocup 2017 - Elimination Round 3) D. Santa Claus and a Palindrome STL

    D. Santa Claus and a Palindrome time limit per test 2 seconds memory limit per test 256 megabytes in ...

  3. Codeforces Round #389 (Div. 2, Rated, Based on Technocup 2017 - Elimination Round 3) E. Santa Claus and Tangerines

    E. Santa Claus and Tangerines time limit per test 2 seconds memory limit per test 256 megabytes inpu ...

  4. Codeforces Round #389 Div.2 E. Santa Claus and Tangerines

    time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standa ...

  5. Codeforces Round #389 Div.2 D. Santa Claus and a Palindrome

    time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standa ...

  6. Codeforces Round #389 Div.2 C. Santa Claus and Robot

    time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standa ...

  7. Codeforces Round #389 Div.2 B. Santa Claus and Keyboard Check

    time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standa ...

  8. Codeforces Round #389 Div.2 A. Santa Claus and a Place in a Class

    time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standa ...

  9. Santa Claus and a Palindrome

    Santa Claus and a Palindrome 题目链接:http://codeforces.com/contest/752/problem/D 贪心 很自然地,可以想到,若subS不是回文 ...

  10. Santa Claus and Tangerines

    Santa Claus and Tangerines 题目链接:http://codeforces.com/contest/752/problem/E 二分 显然直接求答案并不是很容易,于是我们将其转 ...

随机推荐

  1. 小朋友学Python(2)

    本节学习python的第一个程序:输出“Hello World!”.咱们用两种方法实现 方法(一) 进入python环境,直接使用print方法   hello world.png 方法(二) 先编程 ...

  2. Fork-Join分治编程介绍(一)

    一.Fork-Join 框架介绍 1. 什么是 Fork-Join 分治编程框架   Fork/Join框架是Java7提供了的一个用于并行执行任务的框架,是一个把大任务分割成若干个小任务,最终汇总每 ...

  3. hibernate vs ibatis

    主要通过 灵活性,性能,开发速度 三个角度来看 1.ibatis非常简单易学,hibernate相对较复杂,门槛较高.  2.二者都是比较优秀的开源产品  3.当系统属于二次开发,无法对数据库结构做到 ...

  4. python入门-异常

    1 报错的例子 print(5/0) 2跳过报错的例子 try: print(5/0) except ZeroDivisionError: print("You can't divide b ...

  5. 深入浅出理解依赖注入这种由外部负责其依赖需求的行为,我们可以称其为 “控制反转(IoC)”

    原文地址: http://www.insp.top/learn-laravel-container ,转载务必保留来源,谢谢了! 这个组件现在可以很简单的获取到它所需要的服务,服务采用延迟加载的方式, ...

  6. Pycharm远程连接服务器(windows下远程修改服务器代码)

    1.写在前面     之前一致用putty,ssh,修改代码,或者本地修改,上传到服务器,各种不爽,现在改用xshell,但是有时候还是不方便感觉,于是自己配置了远程连接pycharm,这样不用总是到 ...

  7. datasnap 如何监控客户端的连接情况

    如果客户端是TCP/IP是短连接的情况就没有必要了. type pClientConns = ^TClientConns; // 客户连接 TClientConns = record clientid ...

  8. delphi RAD XE 安装路径 重装备份

    重装的时候,不要删除c盘C:\ProgramData下的guid目录.以便完整卸载旧版本. 控件安装的生成的目标文件路径 C:\Users\Public\Documents\Embarcadero\S ...

  9. mysql 修改用户密码

    修改mysql用户密码   目录 mysqladmin命令 UPDATE user 语句 SET PASSWORD 语句 root密码丢失的情况(待验证) mysqladmin命令(回目录) 格式如下 ...

  10. 使用SimpleXML 解析xml

    最近搞解析XML搞的我是水深火热的,所以打算对PHP5解析XML做个学习小结.今天介绍下与PHP5捆绑在一起的SimpleXML扩展,这个用于可读写XML的新的API,让解析XML不再繁琐和困难,用起 ...