PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#BF0000031. Những điều kiện của nhà vua (King)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Những điều kiện của nhà vua (King)

King

Source: UVa

Version: Phuoc Hung OJ Extended

Problem Statement

A sequence of nn integers must obey mm statements. s len gt k says the sum from index ss through s+lens+len is strictly greater than $k; s len lt ksays it is strictly less. Printlamentable kingdomwhen feasible, otherwisesuccessful conspiracy`.

All sums are over integers, and comparisons are strict.

Input

First line n,mn,m, followed by mm lines s,len,op,ks,len,op,k, with op equal to gt or lt.

Output

Print exactly lamentable kingdom or successful conspiracy.

Subtasks

  • Subtask 1 (20 points): $1\le n\le12; 1\le m\le30; 1\le s\le n; 0\le len\le n-s; -10^6\le k\le10^6$.
  • Subtask 2 (30 points): $1\le n\le60; 1\le m\le60; 1\le s\le n; 0\le len\le n-s; -10^6\le k\le10^6$.
  • Subtask 3 (50 points): $1\le n\le100; 1\le m\le100; 1\le s\le n; 0\le len\le n-s; -10^6\le k\le10^6$.

Examples

Input

1 2
1 0 gt 0
1 0 lt 1

Output

successful conspiracy

Explanation

The only sequence element must simultaneously be greater than 00 and less than 11. No integer has this property, so the output is successful conspiracy.