- Flight
- mcq-cs-c
- Little Sci Lab
- Structure and Union
- comp c1
- Understanding PHP data Types
- S7 1200 Getting Started en-US en-US
- Report Best REKHA
- JAVA Programming (for Ejist Students Only)
- A STUDY ON SUICIDE PROBLEM USING COMBINED OVERLAP BLOCK NEUTROSOPHIC COGNITIVE MAPS
- Pointers
- Ch1 Introduction to C programming language
- Software Development Program
- Intel Code Table
- Tutorial 1 Day1
- SystemManual_rev0
- seniorn mini instructionalproject
- Tutorial 3 Matlab Sept07
- 3468
- 2018 ma1 wk 17 18 revision test week
- Programming in C and Data Structure
- Automatic Control and Robotics Syllabi
- Arrays s
- Chapter3_DataTypesVariablesArrays (1)
- ctutor
- Assignment 4 v4.0 Document.pdf
- IF5011!02!2013-Representasi Informasi - Integer Dan String
- cscape I.M.
- VII CSE _SY_090713121850
- Introduction to Matlab 1
- Sapiens: A Brief History of Humankind
- Yes Please
- The Unwinding: An Inner History of the New America
- The Innovators: How a Group of Hackers, Geniuses, and Geeks Created the Digital Revolution
- Elon Musk: Tesla, SpaceX, and the Quest for a Fantastic Future
- Dispatches from Pluto: Lost and Found in the Mississippi Delta
- John Adams
- Devil in the Grove: Thurgood Marshall, the Groveland Boys, and the Dawn of a New America
- The Prize: The Epic Quest for Oil, Money & Power
- This Changes Everything: Capitalism vs. The Climate
- Grand Pursuit: The Story of Economic Genius
- A Heartbreaking Work Of Staggering Genius: A Memoir Based on a True Story
- The Emperor of All Maladies: A Biography of Cancer
- Team of Rivals: The Political Genius of Abraham Lincoln
- The New Confessions of an Economic Hit Man
- Rise of ISIS: A Threat We Can't Ignore
- The Hard Thing About Hard Things: Building a Business When There Are No Easy Answers
- Smart People Should Build Things: How to Restore Our Culture of Achievement, Build a Path for Entrepreneurs, and Create New Jobs in America
- The World Is Flat 3.0: A Brief History of the Twenty-first Century
- Bad Feminist: Essays
- How To Win Friends and Influence People
- Steve Jobs
- Angela's Ashes: A Memoir
- The Silver Linings Playbook: A Novel
- Leaving Berlin: A Novel
- Extremely Loud and Incredibly Close: A Novel
- The Sympathizer: A Novel (Pulitzer Prize for Fiction)
- The Light Between Oceans: A Novel
- The Incarnations: A Novel
- You Too Can Have a Body Like Mine: A Novel
- Life of Pi
- The Love Affairs of Nathaniel P.: A Novel
- The Blazing World: A Novel
- The Rosie Project: A Novel
- The First Bad Man: A Novel
- We Are Not Ourselves: A Novel
- The Flamethrowers: A Novel
- Brooklyn: A Novel
- A Man Called Ove: A Novel
- The Master
- Bel Canto
- Interpreter of Maladies
- The Kitchen House: A Novel
- Beautiful Ruins: A Novel
- The Art of Racing in the Rain: A Novel
- Wolf Hall: A Novel
- The Wallcreeper
- A Prayer for Owen Meany: A Novel
- The Cider House Rules
- Lovers at the Chameleon Club, Paris 1932: A Novel
- The Bonfire of the Vanities: A Novel
- The Perks of Being a Wallflower
- The Constant Gardener: A Novel

**Then he will perform a
**

lot of jumps in such a sequence: 1-jump, 2-jump, 3-jump, 1-jump, 2-jump, 3-jump, 1-jump, and so on.

1-jump means that if Chef is at the point x, he will jump to the point x+1.

2-jump means that if Chef is at the point x, he will jump to the point x+2.

3-jump means that if Chef is at the point x, he will jump to the point x+3.

Before the start Chef asks you: will he arrive at the point a after some number of jumps?

Input

The first line contains a single integer a denoting the point Chef asks about.

Output

Output "yes" without a quotes if Chef can arrive at point a or "no" without a quotes otherwise.

Constraints

0 ≤ a ≤ 10

18

Example

Input:

0

Output:

yes

Input:

1

Output:

yes

Input:

2

Output:

no

Input:

3

Output:

yes

Input:

6

Output:

yes

Input:

7

Output:

yes

Input:

10

Output:

no

Lira is now very keen on compiler development. :)

She knows that one of the most important components of a compiler, is its parser.

A parser is, in simple terms, a software component that processes text, and checks it's semantic correctness, or, if

you prefer, if the text is properly built.

As an example, in declaring and initializing an integer, in C/C++, you can't do something like:

int = x ;4

as the semantics of such statement is incorrect, as we all know that the datatype must precede an identifier and only

afterwards should come the equal sign and the initialization value, so, the corrected statement should be:

int x = 4;

Today, Lira is concerned with an abstract instruction which is composed of the characters "<" and ">" , which she will

use on the design of her language, L++ :D.

She is using it as an abstraction for generating XML code Tags in an easier fashion and she understood that, for an

expression to be valid, a "<" symbol must always have a corresponding ">" character somewhere (not necessary

immediately) after it. Moreover, each ">" symbol should correspond to exactly one "<" symbol.

So, for instance, the instructions:

<<>>

<>

<><>

are all valid. While:

>>

><><

are not.

Given some expressions which represent some instructions to be analyzed by Lira's compiler, you should tell the

length of the longest prefix of each of these expressions that is valid, or 0 if there's no such a prefix.

Input

Input will consist of an integer T denoting the number of test cases to follow.

Then, T strings follow, each on a single line, representing a possible expression in L++.

Output

For each expression you should output the length of the longest prefix that is valid or 0 if there's no such a prefix.

Constraints

1 ≤ T ≤ 500

1 ≤ The length of a single expression ≤ 10

6

The total size all the input expressions is no more than 5*10

6

Example

Input:

3

<<>>

><

<>>>

Output:

4

0

2

Roman has no idea, why this problem is called Stone. He also has no idea on how to solve the followong problem:

given array of N integers A and a number K. During a turn the maximal value over allAi is chosen, let's call it MAX.

Then Ai =

MAX - Ai is done for every 1 <= i <= N. Help Roman to find out how will the array look like after K turns.

Input

The numbers N and K are given in the first line of an input. Then N integers are given in the second line which

denote the array A.

Output

Output N numbers on a single line. It should be the array A after K turns.

Constraints

1 <= N <= 10

5

0 <= K <= 10

9

Ai does not exceed 2 * 10

9

by it's absolute value.

Example

Input:

4 1

5 -1 7 0

Output:

2 8 0 7

Spring is interesting season of year. Chef is thinking about different things, but last time he thinks about interesting

game - "Strange Matrix".

Chef has a matrix that consists of n rows, each contains m elements. Initially, the element aij of matrix equals j. (1 ≤ i

≤ n, 1 ≤ j ≤ m).

Then p times some element aij is increased by 1.

Then Chef needs to calculate the following:

For each row he tries to move from the last element (with number m) to the first one (with the number 1).

While staying in aij Chef can only move to aij - 1 only if aij - 1 ≤ aij.

The cost of such a movement is aij - aij - 1.

Otherwise Chef can't move and lose (in this row).

If Chef can move from the last element of the row to the first one, then the answer is the total cost of all the

movements.

If Chef can't move from the last element of the row to the first one, then the answer is -1.

Help Chef to find answers for all the rows after P commands of increasing.

Input

The first line contains three integers n, m and p denoting the number of rows, the number of elements a single row

and the number of increasing commands.

Each of next p lines contains two integers i and j denoting that the element aij is increased by one.

Output

For each row in a single line print the answer after the P increasing commands.

Constraints

1 ≤ n, m, p ≤ 10 ^ 5

1 ≤ i ≤ n

1 ≤ j ≤ m

Example

Input:

4 4 6

2 2

3 2

3 2

4 3

4 4

4 3

Output:

3

3

-1

4

Explanation

Here is the whole matrix after P commands:

1 2 3 4

1 3 3 4

1 4 3 4

1 2 5 5

Explanations to the answer:

The first line is without changes: 4-3=1, 3-2=1, 2-1=1. answer = 3.

The second line: 4-3=1, 3-3=0, 3-1=2. The answer is 3.

The third line: 4-3=1, 3-4=-1, Chef can't move to the first number here. Therefore, the answer is -1.

The fourth line: 5-5=0, 5-2=3, 2-1=1. The answer is 4.

- FlightUploaded byMihailescu Cristina
- mcq-cs-cUploaded byAtul Galande
- Little Sci LabUploaded byallanj29b
- Structure and UnionUploaded byBalakirupa Sivaraman
- comp c1Uploaded byAditya Chadha
- Understanding PHP data TypesUploaded byroma
- S7 1200 Getting Started en-US en-USUploaded byShiwam Isrie
- Report Best REKHAUploaded bysatyakalyanforu
- JAVA Programming (for Ejist Students Only)Uploaded byLeo Mark Corayag
- A STUDY ON SUICIDE PROBLEM USING COMBINED OVERLAP BLOCK NEUTROSOPHIC COGNITIVE MAPSUploaded byscience2010
- PointersUploaded byZaphodTesla42
- Ch1 Introduction to C programming languageUploaded byakirank1
- Software Development ProgramUploaded byMasood Rehman
- Intel Code TableUploaded byAndrutzza Andra
- Tutorial 1 Day1Uploaded byGaurav Gaur
- SystemManual_rev0Uploaded bylocalon
- seniorn mini instructionalprojectUploaded byapi-278608301
- Tutorial 3 Matlab Sept07Uploaded byalexcojocaru72
- 3468Uploaded bySohail Ahmad
- 2018 ma1 wk 17 18 revision test weekUploaded byapi-314131718
- Programming in C and Data StructureUploaded byDustin Russell
- Automatic Control and Robotics SyllabiUploaded bytetraprimig
- Arrays sUploaded byAnjali Naidu
- Chapter3_DataTypesVariablesArrays (1)Uploaded byGhuru
- ctutorUploaded byraanaar
- Assignment 4 v4.0 Document.pdfUploaded byAnonymous zeDoFzmI
- IF5011!02!2013-Representasi Informasi - Integer Dan StringUploaded byainihanifa
- cscape I.M.Uploaded byEdgar
- VII CSE _SY_090713121850Uploaded byAnkit Agrawal
- Introduction to Matlab 1Uploaded byNiketGhelani