Infinity Gauntlet

You took a peek on Thanos wearing Infinity Gauntlet. In the Gauntlet there is a place for six Infinity Gems:

the Power Gem of purple color,
the Time Gem of green color,
the Space Gem of blue color,
the Soul Gem of orange color,
the Reality Gem of red color,
the Mind Gem of yellow color.

Using colors of Gems you saw in the Gauntlet determine the names of absent Gems.InputIn the first line of input there is one integer nn (0≤n≤60≤n≤6) — the number of Gems in Infinity Gauntlet.
In next nn lines there are colors of Gems you saw. Words used for colors are: purple, green, blue, orange, red, yellow. It is guaranteed that all the colors are distinct. All colors are given in lowercase English letters.OutputIn the first line output one integer mm (0≤m≤60≤m≤6) — the number of absent Gems.
Then in mm lines print the names of absent Gems, each on its own line. Words used for names are: Power, Time, Space, Soul, Reality, Mind. Names can be printed in any order. Keep the first letter uppercase, others lowercase.Examples

Input

4
red
purple
yellow
orange

Output

2
Space
Time

Input

0

Output

6
Time
Mind
Soul
Power
Reality
Space

NoteIn the first sample Thanos already has Reality, Power, Mind and Soul Gems, so he needs two more: Time and Space.
In the second sample Thanos doesn’t have any Gems, so he needs all six.

#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <set>
#include <map>
using namespace std;
map<string, string> p;
set<string> q;
string s;
string name[6]={"Power","Time","Space","Soul","Reality","Mind"};
int n;
int b[6];
int main(){
    scanf("%d", &n);
    for(int i = 1;i <= n;i ++){
        cin >> s;
        if(s == "purple"){
            b[0] = 1;
        }
        if(s == "green"){
            b[1] = 1;
        }
        if(s=="blue"){
            b[2] = 1;
        }
        if(s =="orange"){
            b[3]=1;
        }
        if(s =="red"){
            b[4]=1;
        }
        if(s =="yellow"){
            b[5]=1;
        }
    }
        cout << 6 - n << endl;
    for(int i = 0;i < 6;i ++){
        if(!b[i]){
            cout << name[i] << endl;
        }
    }
    return 0;
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值