jiahuimbzuai/CoQuIR huggingface dataset:
//  [java]
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str = br.readLine();

		switch (str) {
		case "SUN":
			System.out.println(7);
			break;
		case "MON":
			System.out.println(6);
			break;
		case "TUE":
			System.out.println(5);
			break;
		case "WED":
			System.out.println(4);
			break;
		case "THU":
			System.out.println(3);
			break;
		case "FRI":
			System.out.println(2);
			break;
		case "SAT":
			System.out.println(1);
			break;
		}
	}
}
//  [java]
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str = br.readLine();

		switch (str) {
		case "SUN":
			System.out.println("7");
			break;
		case "MON":
			System.out.println("6");
			break;
		case "TUE":
			System.out.println("5");
			break;
		case "WED":
			System.out.println("4");
			break;
		case "THU":
			System.out.println("3");
			break;
		case "FRI":
			System.out.println("2");
			break;
		case "SAT":
			System.out.println("1");
			break;
		}
	}
}
//  [java]
import java.util.*;

class solution{
	public static void main(String args[]){
    	Scanner sc = new Scanner(System.in);
      	String str = sc.nextLine();
      
      	if(str.equals("SUN"))
          System.out.println(7);
      	else if(str.equals("MON"))
          System.out.println(6);
      	else if(str.equals("TUE"))
          System.out.println(5);
      	else if(str.equals("WED"))
          System.out.println(4);
      	else if(str.equals("THU"))
          System.out.println(3);
      	else if(str.equals("FRI"))
          System.out.println(2);
      	else if(str.equals("SAT"))
          System.out.println(1);
    }
}
//  [java]
class solution{
	public static void main(String args[]){
    	Scanner sc = new Scanner(System.in);
      	String str = sc.nextLine();
      
      	if(str.equals("SUN"))
          System.out.println(7);
      	else if(str.equals("MON"))
          System.out.println(6);
      	else if(str.equals("TUE"))
          System.out.println(5);
      	else if(str.equals("WED"))
          System.out.println(4);
      	else if(str.equals("THU"))
          System.out.println(3);
      	else if(str.equals("FRI"))
          System.out.println(2);
      	else if(str.equals("SAT"))
          System.out.println(1);
    }
}
//  [java]
class solution{
	public static void main(String args[]){
    	Scanner sc = new Scanner(System.in);
      	String str = sc.nextLine();
      
      	if(str.equals("SUN"))
          System.out.println(7);
      	elseif(str.equals("MON"))
          System.out.println(6);
      	else if(str.equals("TUE"))
          System.out.println(5);
      	else if(str.equals("WED"))
          System.out.println(4);
      	else if(str.equals("THU"))
          System.out.println(3);
      	else if(str.equals("FRI"))
          System.out.println(2);
      	else if(str.equals("SAT"))
          System.out.println(1);
    }
}
//  [cpp]
#include <stdio.h>
#include <string.h>

int main()
{
	char str[10];
	scanf("%s",str);
	if(strcmp(str,"SUN")==0)
	{
		printf("7");
	}
	if(strcmp(str,"MON")==0)
	{
		printf("6");
	}
	if(strcmp(str,"TUE")==0)
	{
		printf("5");
	}
	if(strcmp(str,"WED")==0)
	{
		printf("4");
	}
	if(strcmp(str,"THU")==0)
	{
		printf("3");
	}
	if(strcmp(str,"FRI")==0)
	{
		printf("2");
	}
	if(strcmp(str,"SAT")==0)
	{
		printf("1");
	}
}
//  [cpp]
#include<cstdio>

using namespace std;

int main(){
    char s[4];
    scanf("%s", s);
    if (s[0] == 'S' && s[1] == 'U') puts("7");
    else if (s[0] == 'M' && s[1] == 'O') puts("6");
    else if (s[0] == 'T' && s[1] == 'U') puts("5");
    else if (s[0] == 'W' && s[1] == 'E') puts("4");
    else if (s[0] == 'T' && s[1] == 'H') puts("3");
    else if (s[0] == 'F' && s[1] == 'R') puts("2");
    else if (s[0] == 'S' && s[1] == 'A') puts("1");
}
//  [cpp]
#include <stdio.h>

int main(){
  
  char uno,dos,tres;

  scanf("%c%c%c",&uno,&dos,&tres);

  if(uno=='S' && dos=='U' && tres=='N')
    printf("7");
  
  if(uno=='M' && dos=='O' && tres=='N')
    printf("6");

  if(uno=='T' && dos=='U' && tres=='E')
    printf("5");

  if(uno=='W' && dos=='E' && tres=='D')
    printf("4");

  if(uno=='T' && dos=='H' && tres=='U')
    printf("3");

  if(uno=='F' && dos=='R' && tres=='I')
    printf("2");

  if(uno=='S' && dos=='A' && tres=='T')
    printf("1");

}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
int N,M;


vector<int> solve(){
	cin>>N>>M;
	char s[N+2];
	vector<int> prev(N+1,-1);
	cin>>s;
	vector<int> nn;
	vector<int> n1;
	nn.push_back(-1);
	if(s[0]=='1') return nn;
	if(N==1) return n1;
	if(s[N]=='1') return nn;
	prev[0] = 0;
	int a = 0;
	for(int j = 1; j<=N;j++){
		if(s[j]=='1') continue;
		int st = j-a;
		if(st>M){
			int found = 0;
			for(int q = j-M;q<j;q++){
				if(s[q]=='0'){
					a = q;
					found = 1;
					break;
				}
			}
			if(!found){
				return nn;
			}
		}
	    prev[j] = a;
	}
	vector<int> numbers;
	int sta = N;
	while(sta!=0){
		numbers.push_back(sta-prev[sta]);
		sta = prev[sta];
	}

	return numbers;

}
int main(){
   vector<int> x = solve();
   for(int j = x.size()-1;j>=0;j--){
   	 cout<<x[j]<<" ";
   }
	
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;

const int INF = 100100100;
const int MOD = (int)1e9 + 7;
typedef long long ll;
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) for (int i = 0; i < (n); ++i)

int main() {
  string a,b;
  cin >> a;
  int ans = 7;
  vector<string> vec = {"MON","TUE","WED","THU","FRI","SAT"};
  REP(i,6)if(vec[i] == a) ans = 6-i;
  cout << ans << endl;
}
//  [cpp]
#include <iostream>
using namespace std;
 
int main(){
    //入力を受け取る
    int S;
    cin >> S;

  if (S == "SUN") {
    cout << 7 << endl;
  }
  else if (S == "MON") {
    cout << 6 << endl;
  }
  else if (S == "TUE") {
    cout << 5 << endl;
  }
  else if (S == "WED") {
    cout << 4 << endl;
  }
  else if (S == "THU") {
    cout << 3 << endl;
  }
  else if (S == "FRI") {
    cout << 2 << endl;
  }
  else if (S == "SAT") {
    cout << 1 << endl;
  }
}
//  [c]
#include <stdio.h>
#include <string.h>

int main(){
  char A[9][4]={"A","SAT","FRI","THU","WED","TUE","MON","SUN"};
  char S[4];
  scanf("%s",S);
  int ans=1;
  while(strcmp(S,A[ans])!=0) ans++;
  
  printf("%d\n",ans);
  return 0;
}
//  [c]
#include <stdio.h>
int main(void){
	char a[4];
	scanf("%s",a);
	if(a[0]=='S'){
		if(a[1]=='A'){
			printf("1\n");
		}else{
			printf("7\n");
		}
	}else if(a[0]=='T'){
		if(a[1]=='U'){
			printf("5\n");
		}else{
			printf("3\n");
		}
	}else if(a[0]=='M'){
		printf("6\n");
	}else if(a[0]=='W'){
		printf("4\n");
	}else{
		printf("2\n");
	}	
	return 0;
}
//  [c]
#include <stdio.h>
int main(void)
{
    char S[3];
    int n = 0;
    scanf("%s", &S);
    if (S[0] == 'M')
        n = 6;
    else if (S[0] == 'W')
        n = 4;
    else if (S[0] == 'F')
        n = 2;
    else if (S[0] == 'S')
    {
        if (S[1] == 'U')
            n = 7;
        else
            n = 1;
    }
    else
    {
        if (S[1] == 'U')
            n = 5;
        else
            n = 3;
    }
    printf("%d", n);
    return 0;
}
//  [c]
#include <stdio.h>
 
int main(void)
{
  /* 変数の定義 */
  char dayotWeek[8];
  int day_count_util_sudday;
 
  /* 文字列の入力 */
  scanf("%s", &dayotWeek);
  if("SUN" == dayotWeek){
    day_count_util_sudday = 0;
  }else if("MON" == dayotWeek){
    day_count_util_sudday = 6;
  }else if("TUE" == dayotWeek){
    day_count_util_sudday = 5;
  }else if("WED" == dayotWeek){
    day_count_util_sudday = 4;
  }else if("THU" == dayotWeek){
    day_count_util_sudday = 3;
  }else if("FRI" == dayotWeek){
    day_count_util_sudday = 2;
  }else if("SAT" == dayotWeek){
    day_count_util_sudday = 1;
  }else{
    printf("入力された文字は無効です");
    return 0;
  }
  /* 文字列の出力 */
  printf("%d\n", day_count_util_sudday);
  return 0;
}
//  [c]
#include <stdio.h>
 
int main(void)
{
  /* 変数の定義 */
  char dayotWeek[8];
  int day_count_util_sudday;
 
  /* 文字列の入力 */
  scanf("%s", dayotWeek);
  if("SUN" == dayotWeek){
    day_count_util_sudday = 0;
  }else if("MON" == dayotWeek){
    day_count_util_sudday = 6;
  }else if("TUE" == dayotWeek){
    day_count_util_sudday = 5;
  }else if("WED" == dayotWeek){
    day_count_util_sudday = 4;
  }else if("THU" == dayotWeek){
    day_count_util_sudday = 3;
  }else if("FRI" == dayotWeek){
    day_count_util_sudday = 2;
  }else if("SAT" == dayotWeek){
    day_count_util_sudday = 1;
  }else{
    printf("入力された文字は無効です");
    return 0;
  }
  /* 文字列の出力 */
  printf("%d\n", day_count_util_sudday);
  return 0;
}
//  [c]
#include <stdio.h>
 
int main(void)
{
  /* 変数の定義 */
  char dayotWeek[1000];
  int day_count_util_sudday;
 
  /* 文字列の入力 */
  scanf("%[xyz]", dayotWeek);
  if("SUN" == dayotWeek){
    day_count_util_sudday = 0;
  }else if("MON" == dayotWeek){
    day_count_util_sudday = 6;
  }else if("TUE" == dayotWeek){
    day_count_util_sudday = 5;
  }else if("WED" == dayotWeek){
    day_count_util_sudday = 4;
  }else if("THU" == dayotWeek){
    day_count_util_sudday = 3;
  }else if("FRI" == dayotWeek){
    day_count_util_sudday = 2;
  }else if("SAT" == dayotWeek){
    day_count_util_sudday = 1;
  }else{
    printf("入力された文字は無効です");
    return 0;
  }
  /* 文字列の出力 */
  printf("%d\n", day_count_util_sudday);
  return 0;
}
//  [javascript]
// inputに入力データ全体が入る
function Main(input) {
	// 1行目がinput[0], 2行目がinput[1], …に入る
	input = input.split("\n");

    var a = input[0];
   
 // SUN,MON,TUE,WED,THU,FRI,SAT
    if (a == 'SUN'){console.log('7');}
    else if(a == 'MON'){console.log('6');}
    else if(a == 'TUE'){console.log('5');}
    else if(a =='WED'){console.log('4');}
    else if(a == 'THU'){console.log('3');}
    else if (a == 'FRI'){console.log('2');}
    else if (a == 'SAT'){console.log('1');}
    
	
	
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function main(arg) {
	arg = arg.trim();
	var day = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT'];
  	var out = day.indexOf(arg);
  	out = 7- out;
  console.log(out)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
function main(input){
    const args=input.split('\n');
    var array=['SAT','FRI','THU','WED','TUE','MON','SUN'];
    var ans=array.indexOf(args[0])+1;
    console.log(ans);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
/*
問題文
今日の曜日を表す文字列 S が与えられます。
S は SUN,MON,TUE,WED,THU,FRI,SAT のいずれかであり、
それぞれ日曜日、月曜日、火曜日、水曜日、木曜日、金曜日、土曜日を表します。

次の日曜日 (あす以降) が何日後か求めてください。

制約
S は SUN,MON,TUE,WED,THU,FRI,SAT のいずれか

*/

function Main(input) {
    var S = input.split('\n')
    
    var map = {
        "SUN":7,
        "MON":6,
        "TUE":5,
        "WED":4,
        "THU":3,
        "FRI":2,
        "SAT":1,
    }
	console.log(map.S);
}
 
//*編集不可。標準入出力から一度に読み込み、Mainを呼び出す
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
/*
問題文
今日の曜日を表す文字列 S が与えられます。
S は SUN,MON,TUE,WED,THU,FRI,SAT のいずれかであり、
それぞれ日曜日、月曜日、火曜日、水曜日、木曜日、金曜日、土曜日を表します。

次の日曜日 (あす以降) が何日後か求めてください。

制約
S は SUN,MON,TUE,WED,THU,FRI,SAT のいずれか

*/

function Main(input) {
    var S = input.split('\n')
    
    var map = {
        "SUN":7,
        "MON":6,
        "TUE":5,
        "WED":4,
        "THU":3,
        "FRI":2,
        "SAT":1,
    }
	console.log(map[S]);
}
 
//*編集不可。標準入出力から一度に読み込み、Mainを呼び出す
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function main(arg) {
	arg = arg.trim().split(/\n/);
  	var num = Number(arg[0]),
        word = arg[1],
        long = arg[1].length;
  	
  	if (num != 0) {
      	var words = [],
            ary_new = [],
            out,
            out_parts,
            abc = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ';

      	for (var i = 0; i < long; i ++) {
			words.push(word[i]);
        }
        for (var i = 0; i < num; i++) {
            ary_new.push(words[i]);
            out = ary_new.reduce((all, n) => all + n)
        }
      	console.log(words[num] + abc.substr(num + 1, num) + words[num + num + 1] + out)
    } else {
      	console.log(words)
    }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
)

func main() {
	r := bufio.NewReader(os.Stdin)
	var s string
	fmt.Fscan(r, &s)

	mp := map[string]int{
		"SUN": 7,
		"MON": 6,
		"TUE": 5,
		"WED": 4,
		"THU": 3,
		"FRI": 2,
		"SAT": 1,
	}
	fmt.Println(mp[s])
}
//  [go]
package main

import (
	"fmt"
	"os"
)

func main() {
	var s string
	fmt.Scanf("%s", &s)

	days := []string{"SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"}
	for i, d := range days {
		if s == d {
			fmt.Printf("%d\n", 7-i)
			os.Exit(0)
		}
	}
}
//  [go]
package main

import "fmt"

func main() {
	week := []string{"SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"}
	var s string
	fmt.Scan(&s)
	for i := 0; i < len(week); i++ {
		if s == week[i] {
			fmt.Println(len(week) - i)
			return
		}
	}
}
//  [ruby]
st = gets.chomp

case st
when "SUN" then
  puts 7
when "MON" then
  puts 6
when "TUE" then
  puts 5
when "WED" then
  puts 4
when "THU" then
  puts 3
when "FRI" then
  puts 2
else
  puts 1
end
//  [ruby]
day = ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"]
puts 7 - day.find_index(gets.chomp)
//  [ruby]
S = gets.chomp
a = [0, "SAT", "FRI", "THU", "WED", "TUE", "MON", "SUN"]

print a.index(S)
//  [ruby]
a=[:SAT,:FRI,:THU,:WED,:TUE,:MON,:SUN]
p a.index(gets.to_sym)+1
//  [ruby]
week = {"SUN":7,"MON":6,"TUE":5,"WED":4,"THU":3,"FRI":2,"SAT":1}
puts week[gets.chomp]
//  [ruby]
h = {"SUN"=>7,"MON"=>6,"TUE"=>5,"WED"=>4,"THU"=>3,"FRI"=>2,"SAT"=>1}
s = gets
p h[s]
//  [rust]
fn main() {
    let s: String = read_line_as_value();
    let ans = match &*s {
        "SUN" => 7,
        "MON" => 6,
        "TUE" => 5,
        "WED" => 4,
        "THU" => 3,
        "FRI" => 2,
        "SAT" => 1,
        _ => -1
    };
    println!("{}", ans);
}

fn read_line_as_value<T: std::str::FromStr>() -> T {
    let mut input = String::new();
    let res = std::io::stdin().read_line(&mut input);
    if let Err(error) = res {
        panic!("io error at stdin.read_line: {}", error);
    };
    match input.trim().parse() {
        Ok(val) => val,
        _ => panic!("error while parsing input: {}", input)
    }
}
//  [rust]
use std::io::*;
fn main() {
    let mut s: String = String::new();
    std::io::stdin().read_to_string(&mut s).ok();
    let mut itr = s.trim().split_whitespace();
    let s = itr.next().unwrap();
    println!(
        "{}",
        match s {
            "SUN" => 7,
            "MON" => 6,
            "TUE" => 5,
            "WED" => 4,
            "THU" => 3,
            "FRI" => 2,
            _ => 1,
        }
    );
}
//  [rust]
use std::io::Read;

fn main() {
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();

    let answer = solve(&buf);

    println!("{}", answer);
}

fn solve(input: &str) -> String {
    let mut iterator = input.split_whitespace();

    let s: &str = iterator.next().unwrap();

    let ans = match s {
        "SUN" => 7,
        "MON" => 6,
        "TUE" => 5,
        "WED" => 4,
        "THU" => 3,
        "FRI" => 2,
        "SAT" => 1,
        _ => 0,
    };

    return ans.to_string();
}
//  [rust]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
    	s:chars
    }
    let ss = s.into_iter().collect::<String>();
    println!("{}",
             match ss.trim() {
                 "SUN" => "MON",
                 "MON" => "TUE",
                 "TUE" => "WED",
                 "WED" => "THU",
                 "THU" => "FRI",
                 "FRI" => "SAT",
                 "SAT" => "SUN",
                 _ => "MON"
             });
}
//  [rust]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
    	s:chars
    }
    let ss: str = s.into_iter().collect::<String>();
    println!("{}", 
    match &ss {
    "SUN" => "MON",
    "MON" => "TUE",
    "TUE" => "WED",
    "WED" => "THU",
    "THU" => "FRI",
    "FRI" => "SAT",
    "SAT" => "SUN",
    _ => "MON"
    });
}
//  [rust]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
    	s:chars
    }
    let ss = s.into_iter().collect::<String>();
    println!("{}", 
    match &ss {
    "SUN".to_string() => "MON",
    "MON" => "TUE",
    "TUE" => "WED",
    "WED" => "THU",
    "THU" => "FRI",
    "FRI" => "SAT",
    "SAT" => "SUN",
    _ => "MON"
    });
}
//  [swift]
var week: [String: Int]
week = [:]
week["SUN"] = 7
week["MON"] = 6
week["TUE"] = 5
week["WED"] = 4
week["THU"] = 3
week["FRI"] = 2
week["SAT"] = 1

let s = readLine()!
print(week[s]!)
//  [swift]
func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}
 
let ans=readLine()!
let week=["SUN","MON","TUE","WED","THU","FRI","SAT"]
var num=0
for s in week{
  if(ans==s){print(7-num)}
  num+=1
}
//  [swift]
func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

func main() {
    let ans = [
        "SUN": 7,
        "MON": 6,
        "TUE": 5,
        "WED": 4,
        "THU": 3,
        "FRI": 2,
        "SAT": 1,
    ]
    let s = readLine()!
    print(ans[s]!)
}

main()
//  [swift]
let a = readLine()!
let jour = ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"]
var b = 0
for c in jour {
  if(a==c) {
    print(7-b)
  b += 1
  }
}
//  [swift]
let date=["SUN","MON","TUE","WED","THU","FRI","SAT"]
let s=readLine()!
let indexs=date.index(of: s)
print(7-indexs)
//  [swift]
let date=["SUN","MON","TUE","WED","THU","FRI","SAT"]
let s=readLine()!
indexs=Int(date.index(of: s))
print(7-indexs)
//  [typescript]
import * as fs from "fs";

const input = (fs.readFileSync("/dev/stdin", "utf8") as string).split("\n");
//const n = +input[0];
//const a = [];
//for(let i=0;i<n;i++){
//	a.push(input[i+1].split(" ").map((x:string):number=>+x));
//}

//const [n, m] = input[0].split(" ").map((x: string): number => +x);
//const a = input[1].split(" ").map((x: string): number => +x);

function compareFunc(a, b){
    return a-b;
}

const s: string = input[0];
const li: string[] = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT'];

for(let i = 0; i < 7; i++){
    if (li[i] === s){
        console.log(7-i)
    }
}
//  [typescript]
'use strict'
function Main(input) {
  const lines = input.split('\n');
  const day = lines[0];
  const days = ['SUN','MON','TUE','WED','THU','FRI','SAT'];

  console.log(7 - days.indexOf(day));
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [typescript]
'use strict'
function Main(input) {
  	const lines = input.split('\n');
  	const day = lines.shift();
	const days = ['SUN','MON','TUE','WED','THU','FRI','SAT'];

	console.log(7 - days.indexOf(day));
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [typescript]
export class Main {
  main(input: string) {
    const tmp: string[] = input.split("\n");
    const s: string = tmp.shift();

    switch (s) {
      case 'SUN':
        return 0;
      case 'MON':
        return 6;
      case 'TUE':
        return 5;
      case 'WED':
        return 4;
      case 'THU':
        return 3;
      case 'FRI':
        return 2;
      case 'SAT':
        return 1;
    }
  }
}

console.log(new Main().main(require("fs").readFileSync("/dev/stdin", "utf8")));
//  [typescript]
function Main(input: string) {
  const lines: string[] = input.split('\n');
  const params1 = lines[0].split(' ');

  const a = parseInt(params1[0]);
  const b = parseInt(params1[1]);
  const x = parseInt(params1[2]);

  const cost = (n: number) => a * n + (b * digit(n));
  
  let biggest = 0;
  if (cost(1) > x) {
    biggest = 0;
  } else if (cost(x) <= x) {
    biggest = x;
  } else {
    let low = 1;
    let high = x;
    while (high - low >= 2) {
      const mid = Math.floor((low + high) / 2);
      if (cost(mid) <= x) {
        low = mid;
      } else {
        high = mid;
      }
    }
    biggest = low;
  }

  console.log(biggest);
}

function digit(n: number): number {
  let cnt = 1;
  for (let i = 10; i <= n; i *= 10) cnt++;
  return cnt
}

Main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [typescript]
function main(input){
    const args=input.split(' ');
    var array=['SAT','FRI','THU','WED','TUE','MON','SUN'];
    var ans=array.indexOf(args[0])+1;
    console.log(ans);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [python]
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

A, B = map(int, input().split())

if A%3 is 0 or B%3 is 0 or (A+B)%3 is 0:
    print('Possible')
else:
    print('Impossible')
//  [python]
a, b = map(int, input().split())

if a%3==0 or b%3==0 or (a+b)%3 == 0:
    print("Possible")
else:
    print("Impossible")
//  [python]
a,b = map(int,input().split())

if a % 3 == 0 or b % 3 == 0 or (a+b) % 3 == 0:
    print('Possible')
else:
    print('Impossible')
//  [python]
a,b = map(int,input().split())

if a % 3 == 0 or b % 3 == 0 or (a+b) % 3 == 0:
  print('Possible')
else:
  pritn('Impossible')
//  [python]
a,b = map(int,input().split())

if a % 3 == 0 or b % 3 == 0 or (a + b) % 3 == 0:
    print('Possible')
else:
    print('Impossibble')
//  [python]
a,b = map(int,input().split())

if a % 3 == 0 or b % 3 == 0 or (a + b) % 3 == 0:
    print('Possible')
else:
    print('Imposibble')
//  [java]
import java.io.*;

public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    
    String[] data = br.readLine().split(" ");
    int a = Integer.parseInt(data[0]);
    int b = Integer.parseInt(data[1]);
    
    if (a%3 != 0 && b%3 != 0 && (a+b)%3 != 0){
      System.out.println("Impossible");
    } else {
      System.out.println("Possible");
    }
  }
}
//  [java]
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
 
public class Main {
    public static void main(String[] args) {
        try {
            // 標準入力
            InputStreamReader isr = new InputStreamReader(System.in);
            BufferedReader br = new BufferedReader(isr);
            String str[] = br.readLine().split(" ");
            int a = Integer.parseInt(str[0]);
            int b = Integer.parseInt(str[1]);
            if (a % 3 == 0 || b % 3 == 0 || (a + b) % 3 == 0) {
                System.out.println("Possible");
            } else {
                System.out.println("Impossible");
            }
        } catch (IOException e) {
            e.printStackTrace();
           }
    }
}
//  [java]
import java.io.*;
import java.util.*;

public class Main {

	final static long MOD = 1000000007;
	public static String[] Ws = null;
	public static int wsIndx = 0;
	public static BufferedReader in = null;
	public static void main(String[] args) throws Exception {
		solution(args);
		if(in!=null){
			in.close();
		}
	}

	public static void solution(String[] args) throws Exception{

		int A = nextInt();
		int B = nextInt();

		String ans = "Impossible";
		if(A%3==0||B%3==0||(A+B)%3==0)
			ans="Possible";
		System.out.println(ans);

	}

	public static boolean isPalindromicStr(String s) {
		int h = 0;
		int t = s.length() - 1;
		while (h <= t) {
			if (s.charAt(h) != s.charAt(t)) {
				break;
			}
			h++;
			t--;
		}
		if (h > t) {
			return true;
		}
		return false;
	}
	public static String[] toStringArray(String s) {
		String[] tmp = new String[s.length()];
		char[] c = s.toCharArray();
		for (int i = 0; i < tmp.length; i++) {
			tmp[i] = String.valueOf(c[i]);
		}
		return tmp;
	}

	public static void check() throws Exception{
		if(in == null){
			in = new BufferedReader(new InputStreamReader(System.in));
		}
		if(Ws==null || Ws.length<=wsIndx){
			Ws = in.readLine().split(" ");
			wsIndx=0;
		}
	}
	public static int nextInt()throws Exception{
		check();
		return Integer.parseInt(Ws[wsIndx++]);
	}

	public static long nextLong()throws Exception{
		check();
		return Long.parseLong(Ws[wsIndx++]);
	}

	public static String nextString()throws Exception{
		check();
		return Ws[wsIndx++];
	}

	public static int[] nextInts()throws Exception{
		check();
		int[] tmp = new int[Ws.length];
		for(int i=0;i<tmp.length;i++){
			tmp[i]=Integer.parseInt(Ws[i]);
		}
		wsIndx=Ws.length;
		return tmp;
	}

	public static long[] nextLongs()throws Exception{
		check();
		long[] tmp = new long[Ws.length];
		for(int i=0;i<tmp.length;i++){
			tmp[i]=Long.parseLong(Ws[i]);
		}
		wsIndx=Ws.length;
		return tmp;
	}

	public static String[] nextStrings()throws Exception{
		check();
		wsIndx=Ws.length;
		return Ws;
	}


}
//  [java]
import java.util.*;
// warm-up
public class Main {

	static void solve() {
		Scanner sc = new Scanner(System.in);
		System.out.println((sc.nextInt()+sc.nextInt())%3==0 ? "Possible" : "Impossible");
		sc.close();		
	}

	public static void main(String args[]) {
		solve();
	}

}
//  [java]

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {


    public static void main(String[] args) throws IOException {
        Scanner s = new Scanner(System.in);
        System.out.println((s.nextInt()+s.nextInt())%3==0?"Possible":"Impossible");
    }


}


class Scanner
{
    StringTokenizer st;
    BufferedReader br;

    public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}

    public String next() throws IOException
    {
        while (st == null || !st.hasMoreTokens())
            st = new StringTokenizer(br.readLine());
        return st.nextToken();
    }

    public int nextInt() throws IOException {return Integer.parseInt(next());}

    public long nextLong() throws IOException {return Long.parseLong(next());}

    public String nextLine() throws IOException {return br.readLine();}

    public double nextDouble() throws IOException
    {
        String x = next();
        StringBuilder sb = new StringBuilder("0");
        double res = 0, f = 1;
        boolean dec = false, neg = false;
        int start = 0;
        if(x.charAt(0) == '-')
        {
            neg = true;
            start++;
        }
        for(int i = start; i < x.length(); i++)
            if(x.charAt(i) == '.')
            {
                res = Long.parseLong(sb.toString());
                sb = new StringBuilder("0");
                dec = true;
            }
            else
            {
                sb.append(x.charAt(i));
                if(dec)
                    f *= 10;
            }
        res += Long.parseLong(sb.toString()) / f;
        return res * (neg?-1:1);
    }

    public boolean ready() throws IOException {return br.ready();}


}
//  [cpp]
#include<cstdio>
#include<cstring>
#include<algorithm>
int a,b;
template<class T>
inline void read(T&a){
	char c=getchar();
	for(a=0;c<'0'||c>'9';c=getchar());
	for(;c>='0'&&c<='9';c=getchar())a=a*10+c-'0';
}
int main(){
	read(a),read(b);
	if(a%3==0||b%3==0||(a+b)%3==0)puts("Possible");
	else puts("Impossible");
	return 0;
}
//  [cpp]
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <ctype.h>
#include <limits.h>	
using namespace std;
int in(void){
	int i;scanf("%d",&i);
	return i;
}
int main(void){
	int a=in(),b=in();
	if(a%3==0||b%3==0||(a+b)%3==0){
		puts("Possible");
	}
	else{
		puts("Impossible");
	}
	return 0;
}
//  [cpp]
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <ctype.h>
#include <limits.h>	
#define inf (INT_MAX-1)
#define INF 9223372036854775807
#define sq(n) ((n)*(n))
#define rep(i,n) for(i=0;i<n;i++)
#define rev(i,n) for(i=n-1;i>=0;i--)
const int mod=(int)1e09+7;
 
int in(void){
	int i;scanf("%d",&i);
	return i;
}
long long llin(void){
	long long i;scanf("%lld",&i);
	return i;
}
double din(void){
	double i;scanf("%lf",&i);
	return i;
}
void chin(char s[]){
	scanf("%s",s);
}
void print(int a){
	printf("%d\n",a);
}
void llprint(long long a){
	printf("%lld\n",a);
}
void dprint(double a){
	printf("%.10f\n",a);
}
void print2(int a,int b){
	printf("%d %d\n",a,b);
}
long long max(long long a,long long b){
	return a>b?a:b;
}
long long min(long long a,long long b){
	return a<b?a:b;
}
double dmax(double a,double b){
	return a>b?a:b;
}
int cmp(const void *a,const void *b){
	return *(long long *)a-*(long long *)b;
}
 
int main(void){
	int a=in(),b=in();
	if(a%3==0||b%3==0||(a+b)%3==0){
		puts("Possible");
	}
	else{
		puts("Impossible");
	}
	return 0;
}
//  [cpp]
 #include <iostream>
 #include <math.h>
 #include <bits/stdc++.h>
  using namespace std;

 int main()
     {
    int t,n,ones=0,res=0;
    cin>>t;
    for(int i=0;i<t;i++)
    {
        cin>>n;
        for(int j=0;n>0;j++)
        {
            if(n%2!=0)
            ones++;
               n=n/2;
        }
        for(int g=0;g<ones;g++)
        {
            res+=pow(2,g);
        }
        cout<<res<<endl;
        res=0;
        ones=0;
    }
   return 0;
     }
//  [cpp]
 #include <iostream>
 #include <math.h>
 #include <bits/stdc++.h>
  using namespace std;

 int main()
     {
 int a,b;
 cin>>a>>b;
 int sum=a+b;

 if(sum%3==0)
    cout<<"Possible";
 else cout<<"Impossible";
   return 0;
     }
//  [cpp]
 #include <iostream>
 #include <math.h>
 #include <bits/stdc++.h>
  using namespace std;

 int main()
     {
 int a,b;
 cin>>a>>b;
 if((a+b)>=3)
    cout<<"Possible";
 else cout<<"Impossible";
   return 0;
     }
//  [c]
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <ctype.h>
#include <limits.h>	
#define inf (INT_MAX-1)
#define INF 9223372036854775807
#define sq(n) ((n)*(n))
#define rep(i,n) for(i=0;i<n;i++)
#define rev(i,n) for(i=n-1;i>=0;i--)
const int mod=(int)1e09+7;

int in(void){
	int i;scanf("%d",&i);
	return i;
}
long long llin(void){
	long long i;scanf("%lld",&i);
	return i;
}
double din(void){
	double i;scanf("%lf",&i);
	return i;
}
void chin(char s[]){
	scanf("%s",s);
}
void print(int a){
	printf("%d\n",a);
}
void llprint(long long a){
	printf("%lld\n",a);
}
void dprint(double a){
	printf("%.10f\n",a);
}
void print2(int a,int b){
	printf("%d %d\n",a,b);
}
long long max(long long a,long long b){
	return a>b?a:b;
}
long long min(long long a,long long b){
	return a<b?a:b;
}
double dmax(double a,double b){
	return a>b?a:b;
}
int cmp(const void *a,const void *b){
	return *(long long *)a-*(long long *)b;
}

int main(void){
	int a=in(),b=in();
	if(a%3==0||b%3==0||(a+b)%3==0){
		puts("Possible");
	}
	else{
		puts("Impossible");
	}
	return 0;
}
//  [c]
#include <stdio.h>

int main(void)
{
  int a, b;
  scanf("%d %d", &a, &b);
  if ( a % 3 == 0 || b % 3 == 0 || (a+b) % 3 == 0 ) {
    puts("Possible");
  } else {
    puts("Impossible");
  }
  return 0;
}
//  [c]
#include<stdio.h>
int main(void){
    int a,b,ab;
    scanf("%d %d",&a,&b);
    ab=a+b;
    if(a%3==0||b%3==0||ab%3==0){
        printf("Possible\n");
    }else{
        printf("Impossible\n");
    }
    return 0;
}
//  [c]
#include <stdio.h>

int main(void) {
		int a,b;
		scanf("%d %d",&a,&b);
		if(a%3==0)
			printf("Possible");
		if(b%3==0)
			printf("Possible");
		if((a+b)%3==0)
			printf("Possible");
		else
			printf("Impossible");
	
	return 0;
}
//  [c]
#include <stdio.h>

int main(void) {
		int a,b;
		scanf("%d %d",&a,&b);
		if((a+b)%3==0)
			printf("Possible");
		else
			printf("Impossible");
	
	return 0;
}
//  [c]
#include<stdio.h>
int main()
{
    int a,b,n;
    scanf("%d%d",&a,&b);
    n=a+b;
    if(n%3!=0){
        printf("Impossible\n");
    }
    else{
        printf("Possible\n");
    }
    return 0;
}
//  [javascript]
'use strict'

function main(s) {

  s = s.split('\n')[0].split(' ').map(n => Number(n));
  const a = s[0];
  const b = s[1];

  const ans = a % 3 === 0 || b % 3 === 0 || (a + b) % 3 === 0;

  console.log(ans ? 'Possible' : 'Impossible');
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function main (s) {
    s=s.split(" ");
	for(var i=0;i<2;i++)s[i]=parseInt(s[i]);
	if(s[0]%3==0||s[1]%3==0||(s[0]+s[1])%3==0)console.log("Possible\n");
	else console.log("Impossible\n");
}
 
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
'use strict';

function Main(INPUT) {
    const input = INPUT.split("\n")[0].split(" ");
    const A = parseInt(input[0], 10);
    const B = parseInt(input[1], 10);

    if (A % 3 == 0 || B % 3 == 0 || (A + B) % 3 == 0) {
        console.log("Possible");
    } else {
        console.log("Impossible");
    }
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function main(input) {
  input = input.trim();
  const [a,b] = input.split(" ").map(Number);

  if((a+b)%3==0){
    console.log("Possible");
  }else{
    console.log("Impossible");
  }
}
main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main(input) {
  const numbers = input.split(' ').map(n => Number(n));
  const a = numbers[0];
  const b = numbers[1];
  if(a % 3 === 0 || b % 3 === 0 || a + b % 3 === 0) {
    console.log('Possible');
  } else {
    console.log('Impossible')
  }
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
const Main = (input) => {
	var xs = input.trim().split(' ').map(v=>parseInt(v,10));
    var ans = xs[0] + xs[1];
    //console.log(xs);
    if(ans % 3 === 0){
    	console.log('Possible');
    }else if(ans % 3 !== 0){
    	console.log('Impossible');
    }
    
}
Main(require('fs').readFileSync('/dev/stdin','utf8'));
//  [go]
package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
)

type contest struct {
	in  io.Reader
	out io.Writer
}

func (con *contest) Scan(a ...interface{}) (int, error) {
	return fmt.Fscan(con.in, a...)
}
func (con *contest) Scanln(a ...interface{}) (int, error) {
	return fmt.Fscanln(con.in, a...)
}
func (con *contest) Scanf(f string, a ...interface{}) (int, error) {
	return fmt.Fscanf(con.in, f, a...)
}
func (con *contest) Print(a ...interface{}) (int, error) {
	return fmt.Fprint(con.out, a...)
}
func (con *contest) Println(a ...interface{}) (int, error) {
	return fmt.Fprintln(con.out, a...)
}
func (con *contest) Printf(f string, a ...interface{}) (int, error) {
	return fmt.Fprintf(con.out, f, a...)
}
func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	con := &contest{in: in, out: out}
	con.main()
}

func (con *contest) main() error {
	var a, b int
	con.Scan(&a, &b)
	if a%3 == 0 || b%3 == 0 || (a+b)%3 == 0 {
		con.Println("Possible")
	} else {
		con.Println("Impossible")
	}
	return nil
}
//  [go]
package main

import (
	"fmt"
)

func main() {
	var a, b int
	fmt.Scan(&a, &b)

	if (a+b)%3 == 0 || a%3 == 0 || b%3 == 0 {
		fmt.Println("Possible")
	} else {
		fmt.Println("Impossible")
	}
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
	"strconv"
)

func out(x ...interface{}) {
	fmt.Println(x...)
}

var sc = bufio.NewScanner(os.Stdin)

func getInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func getString() string {
	sc.Scan()
	return sc.Text()
}

// min, max, asub, absなど基本関数
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func asub(a, b int) int {
	if a > b {
		return a - b
	}
	return b - a
}

func abs(a int) int {
	if a >= 0 {
		return a
	}
	return -a
}

func lowerBound(a []int, x int) int {
	idx := sort.Search(len(a), func(i int) bool {
		return a[i] >= x
	})
	return idx
}

func upperBound(a []int, x int) int {
	idx := sort.Search(len(a), func(i int) bool {
		return a[i] > x
	})
	return idx
}

func main() {
	sc.Split(bufio.ScanWords)
	A, B := getInt(), getInt()

	if A%3 == 0 || B%3 == 0 || (A+B)%3 == 0 {
		out("Possible")
	} else {
		out("Impossible")
	}
}
//  [go]
package main

import (
	"fmt"
)

func main() {
	var A, B int
	var ans string
	fmt.Scan(&A, &B)

	if (A+B)%3 == 0 {
		ans = "Possible"
	} else {
		ans = "Impossible"
	}

	fmt.Println(ans)
}
//  [go]
package main

import "fmt"

func main(){
  var a, b int
  fmt.Scan(&a, &b)
  if a%3 == 0 || b%3 == 0 || (a+b)%3 == 0{
    fmt.Println("Possible")
  }else{
    fmt.Println"(Impossible")
  }
}
//  [go]
package main

import "fmt"

func main() {
	var a, b int
	fmt.Scan(&a, &b)
	if (a + b) % 3 == 0 {
		fmt.Println("Possible")
	} else {
		fmt.Println("Impossible")
	}
}
//  [ruby]
a, b = gets.chomp.split(" ").map(&:to_i)
if a % 3 == 0 || b % 3 == 0 then
    puts "Possible"
elsif (a + b) % 3 == 0 then
    puts "Possible"
else
    puts "Impossible"
end
//  [ruby]
a, b = gets.split(" ").map(&:to_i)
puts a * b * (a + b) % 3 == 0 ? :Possible : :Impossible
//  [ruby]
a, b = gets.chomp.split(" ").map(&:to_i)
ans = a % 3 == 0 || b % 3 == 0 || (a+b) % 3 == 0
puts ans ? "Possible" : "Impossible"
//  [ruby]
a,b = gets.chop.split.map(&:to_i)
[a,b,a+b].each do |x|
    if x%3 == 0
        puts 'Possible'
        exit!
    end
end
puts 'Impossible'
//  [ruby]
a = gets.to_i
b = gets.to_i
while a<1 or 100<b
  a = gets.to_i
  b = gets.to_i
end
if a+b <= 2 then
  puts("Impossible")
if a+b % 3 == 0 then
	puts("Possible")
elsif a % 3 == 0 then
    puts("Possible")
elsif b % 3 == 0 then
	puts("Possible")
else
  puts("Impossible")
end
//  [ruby]
a = gets.to_i
b = gets.to_i
while a<1 or 100<b
  a = gets.to_i
  b = gets.to_i
end
if a+b % 3 == 0 then
	puts("Possible")
elsif a % 3 == 0 then
    puts("Possible")
elsif b % 3 == 0 then
	puts("Possible")
else
  puts("Impossible")
end
//  [rust]
//! ----------------------------------------------
//! Framework <https://github.com/vain0x/procon>
//!
//! See the bottom of file for solution.
//! ----------------------------------------------

#![allow(unused_imports)]
#![allow(non_snake_case)]

use std::cell::RefCell;
use std::cmp::{max, min, Ordering};
use std::collections::*;
use std::fmt::{Debug, Display, Formatter, Write as FmtWrite};
use std::io::{stderr, stdin, BufRead, Write};
use std::mem::{replace, swap};
use std::ops::*;
use std::rc::Rc;

/// Print values to standard error if debug mode.
#[allow(unused_macros)]
macro_rules! debug {
    ($($e:expr),*) => {
        #[cfg(debug_assertions)]
        $({
            let (e, mut err) = (stringify!($e), stderr());
            writeln!(err, "\x1B[33m{}\x1B[0m = {:?}", e, $e).unwrap()
        })*
    };
}

/// Read from standard input and parse each word.
/// - `read!(T, U, ..)` parses a line as a tuple of words.
/// - `read![[T]]` parses a line as an array of words.
/// - `read![..; N]` parses `N` lines, using `read!(..)` repeatedly.
#[allow(unused_macros)]
macro_rules! read {
    ([$t:ty] ; $n:expr) =>
        ((0..$n).map(|_| read!([$t])).collect::<Vec<_>>());
    ($($t:ty),+ ; $n:expr) =>
        ((0..$n).map(|_| read!($($t),+)).collect::<Vec<_>>());
    ([$t:ty]) =>
        (rl().split_whitespace().map(|w| w.parse().unwrap()).collect::<Vec<$t>>());
    ($($t:ty),*) => {{
        let buf = rl();
        let mut w = buf.split_whitespace();
        ($(w.next().unwrap().parse::<$t>().unwrap()),*)
    }};
}

/// Read a line from standard input.
#[allow(dead_code)]
fn rl() -> String {
    let mut buf = String::new();
    stdin().read_line(&mut buf).unwrap();

    #[allow(deprecated)]
    buf.trim_right().to_owned()
}

// -----------------------------------------------
// Solution
// -----------------------------------------------

fn main() {
    let (A, B) = read!(u32, u32);
    let ok = A % 3 == 0 || B % 3 == 0 || (A + B) % 3 == 0;

    println!("{}", if ok { "Possible" } else { "Impossible" })
}
//  [rust]
use std::io::*;

fn main() {
    let mut s: String = String::new();
    stdin().read_to_string(&mut s).ok();
    let mut itr = s.trim().split_whitespace();
    let a: usize = itr.next().unwrap().parse().unwrap();
    let b: usize = itr.next().unwrap().parse().unwrap();
    if a % 3 == 0 || b % 3 == 0 || (a + b) % 3 == 0 {
        println!("Possible");
    } else {
        println!("Impossible");
    }
}
//  [rust]
macro_rules ! input { ( source = $ s : expr , $ ( $ r : tt ) * ) => { let mut iter = $ s . split_whitespace ( ) ; input_inner ! { iter , $ ( $ r ) * } } ; ( $ ( $ r : tt ) * ) => { let s = { use std :: io :: Read ; let mut s = String :: new ( ) ; std :: io :: stdin ( ) . read_to_string ( & mut s ) . unwrap ( ) ; s } ; let mut iter = s . split_whitespace ( ) ; input_inner ! { iter , $ ( $ r ) * } } ; }
macro_rules ! input_inner { ( $ iter : expr ) => { } ; ( $ iter : expr , ) => { } ; ( $ iter : expr , mut $ var : ident : $ t : tt $ ( $ r : tt ) * ) => { let mut $ var = read_value ! ( $ iter , $ t ) ; input_inner ! { $ iter $ ( $ r ) * } } ; ( $ iter : expr , mut $ var : ident $ ( $ r : tt ) * ) => { let mut $ var = $ iter . next ( ) . unwrap ( ) . parse ::< usize > ( ) . unwrap ( ) ; input_inner ! { $ iter $ ( $ r ) * } } ; ( $ iter : expr , $ var : ident : $ t : tt $ ( $ r : tt ) * ) => { let $ var = read_value ! ( $ iter , $ t ) ; input_inner ! { $ iter $ ( $ r ) * } } ; ( $ iter : expr , $ var : ident $ ( $ r : tt ) * ) => { let $ var = $ iter . next ( ) . unwrap ( ) . parse ::< usize > ( ) . unwrap ( ) ; input_inner ! { $ iter $ ( $ r ) * } } ; }
macro_rules ! read_value { ( $ iter : expr , ( $ ( $ t : tt ) ,* ) ) => { ( $ ( read_value ! ( $ iter , $ t ) ) ,* ) } ; ( $ iter : expr , [ $ t : tt ; $ len : expr ] ) => { ( 0 ..$ len ) . map ( | _ | read_value ! ( $ iter , $ t ) ) . collect ::< Vec < _ >> ( ) } ; ( $ iter : expr , chars ) => { read_value ! ( $ iter , String ) . chars ( ) . collect ::< Vec < char >> ( ) } ; ( $ iter : expr , usize1 ) => { read_value ! ( $ iter , usize ) - 1 } ; ( $ iter : expr , $ t : ty ) => { $ iter . next ( ) . unwrap ( ) . parse ::<$ t > ( ) . unwrap ( ) } ; }
fn main() {
    input! { a, b };
    if a % 3 == 0 || b % 3 == 0 || (a + b) % 3 == 0 {
        println!("Possible");
    } else {
        println!("Impossible");
    }
}
//  [rust]
use std::io;

fn procon_read<T: std::str::FromStr>() ->  Vec<T> {
	let mut buf = String::new();
	io::stdin().read_line(&mut buf).expect("");
	let iter = buf.split_whitespace();
	let mut v: Vec<T> = Vec::new();
	for i in iter {
		v.push(i.parse().ok().unwrap());
	}
	v
}

fn main() {
	let v:Vec<i32> = procon_read();
	let a = v[0];
	let b = v[1];
	if a%3 == 0 || b%3 == 0 || a+b%3 == 0 {
		println!("Possible");
	}else{
		println!("Impossible");
	}
}
//  [rust]
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;

int main() {
  int a, b;
  cin >> a >> b;

  if(a % 3 == 0 && b % 3 == 0 && (a + b) % 3 == 0)
    cout << "Possible" << endl;
  else cout << "Impossible" << endl;
}
//  [rust]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};
    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };
    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };
    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };
    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };
    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        a: u32,
        b: u32,
    }
    println!("{}", if (a + b) % 3 == 0 {"Possible"} else {"Impossible"});
}
//  [swift]
extension String:CollectionType{};let i=readLine()!.split(" ").map{Int($0)!%3};print((i[0]>0&&i[1]>0&&i[0]==i[1] ?"Imp":"P")+"ossible")
//  [swift]
let i=readLine()!.characters.split(" ").map{Int(String($0))!%3};print((i[0]>0&&i[1]>0&&i[0]==i[1] ?"Imp":"P")+"ossible")
//  [swift]
let i=readLine()!.characters.split(" ").map{Int(String($0))!%3};print(i[0]>0&&i[1]>0&&i[0]==i[1] ?"Impossible":"Possible")
//  [swift]
let i=readLine()!.characters.split(" ").map{Int(String($0))!%3};print(i[0]>0&&i[1]>0&&i[0]+i[1] !=3 ?"Impossible":"Possible")
//  [swift]
let i=readLine()!.characters.split(" ").map{Int(String($0))!%3};print(i[0]>0&&i[1]>0&&i[0]+i[1]!=3 ?"Impossible":"Possible")
//  [swift]
let i=readLine()!.characters.split(" ").map{Int(String($0))!};print(i[0]%3>0&&i[1]%3>0&&i[0]+i[1]%3>0 ?"Impossible":"Possible")