#include <bits/stdc++.h>
using namespace std;
#define pause system("pause")
#define cls system("cls")
#define rd 1
const int maxn=1e3+10;
//i think there will be never more than 1000 players.
int x=1,n;
void add(){x=(x+1)%3;if(x==0)x=3;return;}
struct players{
vector<int> card;
//1~6 is cards,card[i]==0 means no card.
//i use -1 to refer to 1+.
int blood,maxblood,used/*quantity of card used this round*/;
}player[maxn];
void init(){for(int i=1;i<=n;i++){player[i].blood=player[i].maxblood=4;player[i].card.clear();}}
void del(int t,int pos){if(player[t].card.size()<=pos)return;player[t].card[pos]=player[t].card[player[t].card.size()-1];player[t].card.pop_back();}
void work(int now){
//draw card
int cardsize=player[now].card.size();
if(player[now].card.size()<=2) for(int i=1;i<=4;i++)player[now].card.push_back(rd);
else for(int i=1;i<=6-cardsize;i++)player[now].card.push_back(rd);
//use card
while(1){
L:;
cout<<"blood:"<<player[now].blood<<"/"<<player[now].maxblood<<endl;
cout<<"the cards you have:\n";
for(int i=0;i<player[now].card.size();i++)cout<<abs(player[now].card[i])<<(player[now].card[i]>0?"":"+")<<' ';
cout<<"\nwhat do you want to use?please input the position of it.\n";
cout<<"if you dont want to use,input 0.\n";
int op;
cin>>op;char ch;
if(op<0||op>12){
cout<<"invalid input.\n";pause;cls;goto L;
}
if(op==0){
cout<<"do you want to end the round?Y/N.\n";
cin>>ch;L1:;
if(ch=='Y'||ch=='y'){
cls;return;
}
else if(ch=='N'||ch=='n'){
cls;goto L;
}
else goto L1;
}
cout<<"do you want to use a ";
cout<<abs(player[now].card[op-1])<<(player[now].card[op-1]>0?"":"+")<<"?Y/N."<<endl;
cin>>ch;
if(ch=='Y'||ch=='y'){
int c=player[now].card[op-1];
if(c==1){
if(x!=1){cout<<"you cant use this because x="<<x<<endl;pause;goto L;}
del(now,op-1);
cls;add();
cout<<"choose a card to levelup(0 means to levelup nothing):\n";
for(int i=0;i<player[now].card.size();i++)cout<<abs(player[now].card[i])<<(player[now].card[i]>0?"":"+")<<' ';
cout<<endl;
int cd;ch='n';
while(ch=='n'||ch=='N'){
cin>>cd;if(cd==0)goto E;cout<<"do you want to levelup a "<<abs(player[now].card[cd-1])<<(player[now].card[cd-1]>0?"":"+")<<"?Y/N.\n";cin>>ch;
if((player[now].card[cd-1])<0)cout<<"this has been leveluped yet.\n",ch='n';
}
cout<<"OK.\n";
player[now].card[cd-1]=-player[now].card[cd-1];pause;cls;goto E;
}
if(c==-1){
int c=player[now].card[op-1];
if(x!=1){cout<<"you cant use this because x="<<x<<endl;pause;goto L;}
del(now,op-1);
cls;
add();
cout<<"choose 2 cards to levelup(0 means to levelup nothing):\n";
for(int i=0;i<player[now].card.size();i++)cout<<abs(player[now].card[i])<<(player[now].card[i]>0?"":"+")<<' ';
cout<<endl;
int cd;ch='n';
while(ch=='n'||ch=='N'){
cin>>cd;if(cd==0)goto E;cout<<"do you want to levelup a "<<abs(player[now].card[cd-1])<<(player[now].card[cd-1]>0?"":"+")<<"?Y/N.\n";cin>>ch;
if((player[now].card[cd-1])<0)cout<<"this has been leveluped yet.\n",ch='n';
}
cout<<"OK.\n";
player[now].card[cd-1]=-player[now].card[cd-1];pause;cls;
cout<<"choose a card to levelup(0 means to levelup nothing):\n";
for(int i=0;i<player[now].card.size();i++)cout<<abs(player[now].card[i])<<(player[now].card[i]>0?"":"+")<<' ';
cout<<endl;
ch='n';
while(ch=='n'||ch=='N'){
cin>>cd;if(cd==0)goto E;cout<<"do you want to levelup a "<<abs(player[now].card[cd-1])<<(player[now].card[cd-1]>0?"":"+")<<"?Y/N.\n";cin>>ch;
if((player[now].card[cd-1])<0)cout<<"this has been leveluped yet.\n",ch='n';
}
cout<<"OK.\n";
player[now].card[cd-1]=-player[now].card[cd-1];pause;cls;
goto E;
}
}
else if(ch=='N'||ch=='n'){
cls;goto L;
}
E:;
pause;cls;
}
}
int main(){
srand(time(NULL));
cin>>n;init();
for(int i=1;;){
if(player[i].blood>0)work(i);
i++;if(i==n+1)i=1;
}
}
/*
1:if x==1:x=2,levelup 1(2) card
2:if x==2:x=3,draw 1(2) card
3:if x==3:x=1,fold 1(2) card
4:fold(get) a card from an other player with seeing
5:recover 1 blood every 4(3) card used this round
6:levelup 1(all) card(s) in hand
7:lost 1 blood(7+ dont need to lost),and fold 1 card
8:draw card to 4(6)
9:lost 1 blood(9+ dont need to lost),and choose a number from 1,2,3 to give x
10:recover 1 blood every 5(3) card in hand now[including this]
11:lost 2(1) blood,and maxblood+1
12:everyone(every others) lose 1 blood
*/