word = input()
for i in range(0, 26):
    try:
        print (word.index(chr(97+i)), end = ' ')
    except:
        print (-1, end = ' ')
import sys
from collections import deque

stack = deque()
input = sys.stdin.readline
N = int(input())

for _ in range(N):
    N = int(input())

    if N != 0:
        stack.append(N)
    
    if N == 0:
        stack.pop()

print (sum(stack))
print (sum(map(int, input().split())))
import sys

input = sys.stdin.readline
N = int(input())

for _ in range(N):
    ps = input()
    _sum = 0

    for i in ps:
        if i == "(":
            _sum +=1
        elif i == ")":
            _sum -=1
        
        if _sum < 0:
            break
    
    if _sum == 0:
        print ("YES")

    else:
        print ("NO")
# -*- coding:utf-8 -*-
import sys
from collections import deque

def breadth_first_seach() -> list:
    while queue:
        z, x, y = queue.popleft()

        for i in range(6):
            a = z + dz[i]
            b = x  +dx[i]
            c = y + dy[i]

            if 0<=a<H and 0<=b<N and 0<=c<M and graph[a][b][c] == 0:
                queue.append([a, b, c])
                graph[a][b][c] = graph[z][x][y] + 1

    return graph


if __name__ == "__main__":

    # N = 행, M = 열, H = 높이
    M, N, H = list(map(int, sys.stdin.readline().split()))
    queue = deque()
    graph = [[[0 for i in range(M)] for j in range(N)] for k in range(H)]

    dx = [-1, 1, 0, 0, 0, 0]
    dy = [0, 0, 1, -1, 0, 0]
    dz = [0, 0, 0, 0, 1, -1]

    for z in range(H):
        for x in range(N): # 행
            graph[z][x] = list(map(int, sys.stdin.readline().split()))
            for y in range(M): # 열
                if graph[z][x][y] == 1:
                    queue.append([z, x, y])

    graph = breadth_first_seach()    
    
    day = 0
    for i in graph:
        for j in i:
            for k in j:
                if k == 0:
                    print (-1)
                    exit(0)
            day = max(day, max(j))
    print (day-1)
print (124)
print ("roytravel")
import sys
from itertools import combinations

def dfs(start):
    if len(picked) == 6:
        print (*picked)
        return

    for i in range(start, len(test_case)):
        picked.append(test_case[i])
        dfs(i+1)
        picked.pop()

if __name__ == "__main__":
    # 1. manual dfs algorithm for combination
    input = sys.stdin.readline

    while True:
        test_case = list(map(int, input().split()))
        if len(test_case) == 1:
            break

        del test_case[0]
        picked = []
        dfs(0)
        print()

    # 2. using library for combination algorithm
    # while True:
    #     test_case = list(map(int, input().split()))
    #     del test_case[0]

    #     combination = combinations(test_case, 6)
    #     for element in combination:
    #         print (*element)

    #     print ()

    #     if not test_case:
    #         break
import sys
input = sys.stdin.readline

word = input()
dial = {1: "", 2:"ABC", 3:"DEF", 4:"GHI", 5:"JKL", 6:"MNO", 7:"PQRS", 8:"TUV", 9:"WXYZ", 0:""}
time = 0
for i in word:
    for key, value in dial.items():    
        if i in value:
            time += key + 1
print (time)
price = int(input())
coins = [500, 100, 50, 10, 5, 1]
change = (1000 - price)
count = 0
for coin in coins:
    Q, R = divmod(change, coin)
    count = count + Q
    change = R
    if R == 0:
        break
print (count)

 

#include <iostream>

#define N 10001
using namespace std;

int solution(int n)
{
	int sum = n;
	
	while(true)
	{
		if (n==0)
			break;
		
		sum = sum + (n % 10); // get the remainder
		n = n / 10; // divide by 10 to get next remainder;
	}
	
	return sum;
}


int main(void)
{
	bool Array[N] = {0, };
	int idx = 0;
	
	for (int i=1; i<N; i++)
	{
		idx = solution(i);
		
		if (idx <= N) // Why always idx is smaller or equal than N?
			Array[idx] = 1; // constructor = 1
	}
	
	for (int j=1; j<N; j++)
	{
		if (!Array[j])
			cout << j << endl;
	}
	
	return 0;
}

+ Recent posts