Problem:


Score : 300 points

Problem Statement

E869120 found a chest which is likely to contain treasure.

However, the chest is locked. In order to open it, he needs to enter a string S consisting of lowercase English letters.

He also found a string S', which turns out to be the string S with some of its letters (possibly all or none) replaced with ?.  

One more thing he found is a sheet of paper with the following facts written on it:  

Condition 1: The string S contains a string T as a contiguous substring.

Condition 2: S is the lexicographically smallest string among the ones that satisfy Condition 1.

Print the string S.

If such a string does not exist, print UNRESTORABLE.  

Constraints

1 \leq |S'|, |T| \leq 50

S' consists of lowercase English letters and ?.

T consists of lowercase English letters.

Input

Input is given from Standard Input in the following format:

S
T'

Output

Print the string S.

If such a string does not exist, print UNRESTORABLE instead.  

Sample Input 1

?tc????
coder

Sample Output 1

atcoder

There are 26 strings that satisfy Condition 1: atcoder, btcoder, ctcoder,..., ztcoder.
Among them, the lexicographically smallest is atcoder, so we can say S = atcoder.

Sample Input 2

??p??d??
abc

Sample Output 2

UNRESTORABLE

There is no string that satisfies Condition 1, so the string S does not exist.



Sample input:
?tc????
coder


Sample output:
atcoder

Submission status: Wrong Answer

Solution code:
""" dubious document """
import re

S_IN = input()
T = input()
U = 'UNRESTORABLE'

def repl_func(match):
    """
    repl
    """
   
    str = match.group(0)
    # print("str -> {0}".format(str))
    q_regex = re.compile('^\?+$')
    if q_regex.match(str):
        new_str = re.sub(r'.', 'a', str)
    else:
        new_str = T
    # print("new_str -> {0}".format(new_str))
    return new_str

def main():
    """
    main func
    """

    regex = r''
    for char in T:
        regex += r'[\?|' + re.escape(char) + r']'

    repl = re.sub(regex, repl_func, S_IN)
    if repl != S_IN:
        repl = repl.replace('?', 'a')

    if T in repl:
        print(repl)
    else:
        print(U)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import re

S_IN = input()
T = input()
U = 'UNRESTORABLE'

def main():
    regex = r''
    for char in T:
        regex += r'[\?|' + re.escape(char) + r']'
    # print(regex)

    repl = re.sub(regex, T, S_IN, count=1)
    if repl != S_IN:
        # print(repl)
        repl = repl.replace('?', 'a')
        print(repl)
    else:
        print(U)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
#coding: utf-8
SS = input()
T = input()
f = 0

if len(SS) < len(T):
    print('UNRESTORABLE')

else:
    for i in range(0, len(SS)-len(T)+1):
        pSS = SS[i:len(T)+i]

        Tt = ''
        for j in range(0,len(T)):

            if pSS[j] == T[j]:
                Tt += T[j]

            elif pSS[j] == '?':
                Tt += T[j]

        if Tt == T:
            f = 1
            SS = SS.replace(SS[i:len(T)+i], Tt)
            ans = SS.replace('?','a')
     
    if f == 1:
        print(ans)
    else:
        print('UNRESTORABLE')

Submission status: Wrong Answer

Solution code:
#coding: utf-8
SS = input()
T = input()
f = 0

if len(SS) < len(T):
    print('UNRESTORABLE')

else:
    for i in range(0, len(SS)-len(T)+1):
        pSS = SS[i:len(T)+i]

        Tt = ''
        for j in range(0,len(T)):

            if pSS[j] == T[j]:
                Tt += T[j]

            elif pSS[j] == '?':
                Tt += T[j]
            else:
                continue

        if Tt == T:
            f = 1
            SS = SS.replace(SS[i:len(T)+i], Tt)
            ans = SS.replace('?','a')
            break
        else:
            f = 0

    if f == 1:
        print(ans)
    else:
        print('UNRESTORABLE')

Submission status: Wrong Answer

Solution code:
#coding: utf-8
SS = input()
T = input()
f = 0

if len(SS) < len(T):
    print('UNRESTORABLE')

else:
    for i in range(0, len(SS)-len(T)+1):
        pSS = SS[i:len(T)+i]
       
        Tt = ''
       
        for j in range(0,len(T)):

            if pSS[j] == T[j]:
                Tt += T[j]

            elif pSS[j] == '?':
                Tt += T[j]
            else:
                break

        if Tt == T:
            f = 1
            SS = SS.replace(SS[i:len(T)+i], Tt)
            ans = SS.replace('?','a')
            break
        else:
            f = 0

    if f == 1:
        print(ans)
    else:
        print('UNRESTORABLE')

Submission status: Wrong Answer

Solution code:
#coding: utf-8
SS = input()
T = input()
f = 0

if len(SS) < len(T):
    print('UNRESTORABLE')

else:
    for i in range(0, len(SS)-len(T)+1):
        pSS = SS[i:len(T)+i]
        Tt = ''
        for j in range(0,len(T)):

            if pSS[j] == T[j]:
                Tt += T[j]

            elif pSS[j] == '?':
                Tt += T[j]
            else:
                break

        if Tt == T:
            f += 1
            SS = SS.replace(SS[i:len(T)+i], Tt)
            ans = SS.replace('?','a')
            break
        else:
            f += 0

    if f == 1:
        print(ans)
    else:
        print('UNRESTORABLE')

Submission status: Wrong Answer

Solution code:
#coding: utf-8

SS = input()
T = input()

f = 0

for i in range(0, len(SS)-len(T)+1):
    pSS = SS[i:len(T)+i]
    Tt = ''
    for j in range(0,len(T)):

        if pSS[j] == T[j]:
            Tt += T[j]

        elif pSS[j] == '?':
            Tt += T[j]
        else:
            break

    if Tt == T:
        f += 1
        SS = SS.replace(SS[i:len(T)+i], Tt)
        ans = SS.replace('?','a')
        break
    else:
        f += 0

if f == 1:
    print(ans)
else:
    print('UNRESTORABLE')

Submission status: Wrong Answer

Solution code:
#coding: utf-8

SS = input()
T = input()

f = 0

for i in range(0, len(SS)-len(T)+1):
    pSS = SS[i:len(T)+i]
        
    Tt = ''
        
    for j in range(0,len(T)):

        if pSS[j] == T[j]:
            Tt += T[j]

        elif pSS[j] == '?':
            Tt += T[j]
        else:
            break

    if Tt == T:
        f += 1
        SS = SS.replace(SS[i:len(T)+i], Tt)
        ans = SS.replace('?','a')
        break
    else:
        f += 0

if f == 1:
    print(ans)
else:
    print("UNRESTORABLE")

Submission status: Wrong Answer

Solution code:
#coding: utf-8

SS = input()
T = input()

f = 0

for i in range(0, len(SS)-len(T)+1):
    pSS = SS[i:len(T)+i]
       
    Tt = ''
       
    for j in range(0,len(T)):
        if pSS[j] == T[j]:
            Tt += T[j]

        elif pSS[j] == '?':
            Tt += T[j]
        else:
            break

    if Tt == T:
        f += 1
        SS = SS.replace(SS[i:len(T)+i], Tt)
        ans = SS.replace('?','a')
            #break
    else:
        f += 0

if f == 1:
    print(ans)
else:
    print("UNRESTORABLE")

Submission status: Wrong Answer

Solution code:
import sys


def main():

    # Get Args
    args = _input_args()  # get arguments as an array from console/script parameters.

    # Call main Logic
    result = _main(args)

    # Output a result in a correct way.
    _output_result(result)


def _main(args):
    """Write Main Logic here for the contest.

    :param args: arguments
    :type args: list
    :return: result
    :rtype: depends on your logic.
    """
    # Extract arguments.
    Sd = args[0]
    T = args[1]

    # Write main logic here.
    result = _fit_partial_strings(Sd, T)

    # Return something.
    return result


def _fit_partial_strings(Sd, T):

    replaced = False
    for i in range(len(Sd)):
        for j in range(len(T)):
            if Sd[i] == T[j]:
                if len(Sd) - i >= len(T) - j:  # enough space available?
                    offset = i - j
                    Sd_list = list(Sd)  # convert str to list for operation

                    passed = True
                    for k in range(len(T)):
                        if Sd_list[k + offset] == '?' or Sd_list[k + offset] == T[k]:
                            pass  # patch T to Sd
                        elif Sd_list[k + offset] != T[k]:
                            passed = False

                    if passed == True:
                        for k in range(len(T)):
                            Sd_list[k + offset] = T[k]
                        replaced = True

                    Sd = "".join(Sd_list)  # convert list to str
                else:
                    pass
    if replaced:
        Sd = Sd.replace('?', 'a')
        return Sd
    else:
        return 'UNRESTORABLE'


def _input_args():
    # Comment-out appropriate pattern depends on subject.

    # arguments = sys.argv[1:]  # ptn1: get args from script parameters.
    # arguments = _input().split()  # ptn2: get args from 1 line console prompt with space separated.

    # for multi-line console input, use this.
    arguments = _get_args_from_multiple_lines(end_of_lines_char=[''], limit=2)

    # Cast elements If you need.
    # arguments = list(map(int, arguments))  # cast elements to int for example.

    return arguments  # This will be array.


def _input():
    # If Subject requires interactive input, use this and patch mock in unittest.
    return input()  # Change if necessary.


def _get_args_from_multiple_lines(end_of_lines_char=[''], limit=2):
    """Get arguments from multiple lines standard input.

    :param end_of_lines_char: Strings that indicate the end of lines.
    :type end_of_lines_char: list of str
    :param limit: If a number of the input line are certain, you can use this param to close prompt immediately.
    :type limit: int
    :return: args
    :rtype list of str
    """
    args = []
    for i in range(limit):
        try:
            arg = _input()
            if arg in end_of_lines_char:
                break
            args.append(arg)
        except EOFError:  # Supports EOF Style. (Very Rare case)
            break
    return args


def _output_result(result):
    # Comment-out appropriate output pattern depends on subject.

    # sys.stdout.write(result)  # No Line Feed, and an result must be string (not useful). for single value output.
    # print(result)  # The result will cast to strings. Line feed will be appended to the end. for single value output.
    # print(result, end='')  # Same as above except Line Feed won't be appended. for single value output.
    # print(','.join(map(str, result)))  # Print array elements as comma separated strings. for multi-value.
    print('{}'.format(str(result)))  # Same as above, but more versatile.


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys


def main():

    # Get Args
    args = _input_args()  # get arguments as an array from console/script parameters.

    # Call main Logic
    result = _main(args)

    # Output a result in a correct way.
    _output_result(result)


def _main(args):
    """Write Main Logic here for the contest.

    :param args: arguments
    :type args: list
    :return: result
    :rtype: depends on your logic.
    """
    # Extract arguments.
    Sd = args[0]
    T = args[1]

    # Write main logic here.
    result = _fit_partial_strings(Sd, T)

    # Return something.
    return result


def _fit_partial_strings(Sd, T):

    replaced = False
    for i in range(len(Sd)):
        for j in range(len(T)):
            if Sd[i] == T[j]:
                if len(Sd) - i >= len(T) - j:  # enough space available?
                    offset = i - j
                    Sd_list = list(Sd)  # convert str to list for operation

                    passed = True
                    for k in range(len(T)):
                        if Sd_list[k + offset] == '?' or Sd_list[k + offset] == T[k]:
                            pass  # patch T to Sd
                        elif Sd_list[k + offset] != T[k]:
                            passed = False

                    if passed == True:
                        for k in range(len(T)):
                            Sd_list[k + offset] = T[k]

                        Sd = "".join(Sd_list)  # convert list to str
                        replaced = True
                else:
                    pass
    if replaced:
        Sd = Sd.replace('?', 'a')
        return Sd
    else:
        return 'UNRESTORABLE'


def _input_args():
    # Comment-out appropriate pattern depends on subject.

    # arguments = sys.argv[1:]  # ptn1: get args from script parameters.
    # arguments = _input().split()  # ptn2: get args from 1 line console prompt with space separated.

    # for multi-line console input, use this.
    arguments = _get_args_from_multiple_lines(end_of_lines_char=[''], limit=2)

    # Cast elements If you need.
    # arguments = list(map(int, arguments))  # cast elements to int for example.

    return arguments  # This will be array.


def _input():
    # If Subject requires interactive input, use this and patch mock in unittest.
    return input()  # Change if necessary.


def _get_args_from_multiple_lines(end_of_lines_char=[''], limit=2):
    """Get arguments from multiple lines standard input.

    :param end_of_lines_char: Strings that indicate the end of lines.
    :type end_of_lines_char: list of str
    :param limit: If a number of the input line are certain, you can use this param to close prompt immediately.
    :type limit: int
    :return: args
    :rtype list of str
    """
    args = []
    for i in range(limit):
        try:
            arg = _input()
            if arg in end_of_lines_char:
                break
            args.append(arg)
        except EOFError:  # Supports EOF Style. (Very Rare case)
            break
    return args


def _output_result(result):
    # Comment-out appropriate output pattern depends on subject.

    # sys.stdout.write(result)  # No Line Feed, and an result must be string (not useful). for single value output.
    # print(result)  # The result will cast to strings. Line feed will be appended to the end. for single value output.
    # print(result, end='')  # Same as above except Line Feed won't be appended. for single value output.
    # print(','.join(map(str, result)))  # Print array elements as comma separated strings. for multi-value.
    print('{}'.format(str(result)))  # Same as above, but more versatile.


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys


def main():

    # Get Args
    args = _input_args()  # get arguments as an array from console/script parameters.

    # Call main Logic
    result = _main(args)

    # Output a result in a correct way.
    _output_result(result)


def _main(args):
    """Write Main Logic here for the contest.

    :param args: arguments
    :type args: list
    :return: result
    :rtype: depends on your logic.
    """
    # Extract arguments.
    Sd = args[0]
    T = args[1]

    # Write main logic here.
    result = _fit_partial_strings(Sd, T)

    # Return something.
    return result


def _fit_partial_strings(Sd, T):

    for i in range(len(Sd)):
        for j in range(len(T)):
            if Sd[i] == T[j]:
                if len(Sd) - i >= len(T) - j:  # enough space available?
                    offset = i - j
                    Sd_list = list(Sd)  # convert str to list for operation

                    passed = True
                    for k in range(len(T)):
                        if Sd_list[k + offset] == '?' or Sd_list[k + offset] == T[k]:
                            pass  # patch T to Sd
                        elif Sd_list[k + offset] != T[k]:
                            passed = False

                    if passed:
                        for k in range(len(T)):
                            Sd_list[k + offset] = T[k]

                        Sd = "".join(Sd_list)  # convert list to str
                        Sd = Sd.replace('?', 'a')
                else:
                    pass

    if Sd.count('?') == 0:
        return Sd
    else:
        return 'UNRESTORABLE'


def _input_args():
    # Comment-out appropriate pattern depends on subject.

    # arguments = sys.argv[1:]  # ptn1: get args from script parameters.
    # arguments = _input().split()  # ptn2: get args from 1 line console prompt with space separated.

    # for multi-line console input, use this.
    arguments = _get_args_from_multiple_lines(end_of_lines_char=[''], limit=2)

    # Cast elements If you need.
    # arguments = list(map(int, arguments))  # cast elements to int for example.

    return arguments  # This will be array.


def _input():
    # If Subject requires interactive input, use this and patch mock in unittest.
    return input()  # Change if necessary.


def _get_args_from_multiple_lines(end_of_lines_char=[''], limit=2):
    """Get arguments from multiple lines standard input.

    :param end_of_lines_char: Strings that indicate the end of lines.
    :type end_of_lines_char: list of str
    :param limit: If a number of the input line are certain, you can use this param to close prompt immediately.
    :type limit: int
    :return: args
    :rtype list of str
    """
    args = []
    for i in range(limit):
        try:
            arg = _input()
            if arg in end_of_lines_char:
                break
            args.append(arg)
        except EOFError:  # Supports EOF Style. (Very Rare case)
            break
    return args


def _output_result(result):
    # Comment-out appropriate output pattern depends on subject.

    # sys.stdout.write(result)  # No Line Feed, and an result must be string (not useful). for single value output.
    # print(result)  # The result will cast to strings. Line feed will be appended to the end. for single value output.
    # print(result, end='')  # Same as above except Line Feed won't be appended. for single value output.
    # print(','.join(map(str, result)))  # Print array elements as comma separated strings. for multi-value.
    print('{}'.format(str(result)))  # Same as above, but more versatile.


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys


def main():

    # Get Args
    args = _input_args()  # get arguments as an array from console/script parameters.

    # Call main Logic
    result = _main(args)

    # Output a result in a correct way.
    _output_result(result)


def _main(args):
    """Write Main Logic here for the contest.

    :param args: arguments
    :type args: list
    :return: result
    :rtype: depends on your logic.
    """
    # Extract arguments.
    Sd = args[0]
    T = args[1]

    # Write main logic here.
    result = _fit_partial_strings(Sd, T)

    # Return something.
    return result


def _fit_partial_strings(Sd, T):

    for i in range(len(Sd)):
        for j in range(len(T)):
            if Sd[i] == T[j]:
                if len(Sd) - i >= len(T) - j:  # enough space available?
                    offset = i - j
                    Sd_list = list(Sd)  # convert str to list for operation

                    passed = True
                    for k in range(len(T)):
                        if Sd_list[k + offset] == '?' or Sd_list[k + offset] == T[k]:
                            pass  # patch T to Sd
                        elif Sd_list[k + offset] != T[k]:
                            passed = False

                    if passed:
                        for k in range(len(T)):
                            Sd_list[k + offset] = T[k]

                        Sd = "".join(Sd_list)  # convert list to str
                        Sd = Sd.replace('?', 'a')
                        return Sd
                else:
                    return 'UNRESTORABLE'

    return 'UNRESTORABLE'


def _input_args():
    # Comment-out appropriate pattern depends on subject.

    # arguments = sys.argv[1:]  # ptn1: get args from script parameters.
    # arguments = _input().split()  # ptn2: get args from 1 line console prompt with space separated.

    # for multi-line console input, use this.
    arguments = _get_args_from_multiple_lines(end_of_lines_char=[''], limit=2)

    # Cast elements If you need.
    # arguments = list(map(int, arguments))  # cast elements to int for example.

    return arguments  # This will be array.


def _input():
    # If Subject requires interactive input, use this and patch mock in unittest.
    return input()  # Change if necessary.


def _get_args_from_multiple_lines(end_of_lines_char=[''], limit=2):
    """Get arguments from multiple lines standard input.

    :param end_of_lines_char: Strings that indicate the end of lines.
    :type end_of_lines_char: list of str
    :param limit: If a number of the input line are certain, you can use this param to close prompt immediately.
    :type limit: int
    :return: args
    :rtype list of str
    """
    args = []
    for i in range(limit):
        try:
            arg = _input()
            if arg in end_of_lines_char:
                break
            args.append(arg)
        except EOFError:  # Supports EOF Style. (Very Rare case)
            break
    return args


def _output_result(result):
    # Comment-out appropriate output pattern depends on subject.

    # sys.stdout.write(result)  # No Line Feed, and an result must be string (not useful). for single value output.
    # print(result)  # The result will cast to strings. Line feed will be appended to the end. for single value output.
    # print(result, end='')  # Same as above except Line Feed won't be appended. for single value output.
    # print(','.join(map(str, result)))  # Print array elements as comma separated strings. for multi-value.
    print('{}'.format(str(result)))  # Same as above, but more versatile.


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys


def main():

    # Get Args
    args = _input_args()  # get arguments as an array from console/script parameters.

    # Call main Logic
    result = _main(args)

    # Output a result in a correct way.
    _output_result(result)


def _main(args):
    """Write Main Logic here for the contest.

    :param args: arguments
    :type args: list
    :return: result
    :rtype: depends on your logic.
    """
    # Extract arguments.
    Sd = args[0]
    T = args[1]

    # Write main logic here.
    result = _fit_partial_strings(Sd, T)

    # Return something.
    return result


def _fit_partial_strings(Sd, T):

    for i in range(len(Sd)):
        for j in range(len(T)):
            if Sd[i] == T[j]:
                try:
                    offset = i - j
                    Sd_list = list(Sd)  # convert str to list for operation
                    for k in range(len(T)):

                        if Sd_list[k + offset] == '?':
                            Sd_list[k + offset] = T[k]  # patch T to Sd
                        if Sd_list[k + offset] != T[k]:
                            return 'UNRESTORABLE'

                    Sd = "".join(Sd_list)  # convert list to str
                    Sd = Sd.replace('?', 'a')
                    return Sd
                except IndexError:
                    return 'UNRESTORABLE'

    return 'UNRESTORABLE'


def _input_args():
    # Comment-out appropriate pattern depends on subject.

    # arguments = sys.argv[1:]  # ptn1: get args from script parameters.
    # arguments = _input().split()  # ptn2: get args from 1 line console prompt with space separated.

    # for multi-line console input, use this.
    arguments = _get_args_from_multiple_lines(end_of_lines_char=[''], limit=2)

    # Cast elements If you need.
    # arguments = list(map(int, arguments))  # cast elements to int for example.

    return arguments  # This will be array.


def _input():
    # If Subject requires interactive input, use this and patch mock in unittest.
    return input()  # Change if necessary.


def _get_args_from_multiple_lines(end_of_lines_char=[''], limit=2):
    """Get arguments from multiple lines standard input.

    :param end_of_lines_char: Strings that indicate the end of lines.
    :type end_of_lines_char: list of str
    :param limit: If a number of the input line are certain, you can use this param to close prompt immediately.
    :type limit: int
    :return: args
    :rtype list of str
    """
    args = []
    for i in range(limit):
        try:
            arg = _input()
            if arg in end_of_lines_char:
                break
            args.append(arg)
        except EOFError:  # Supports EOF Style. (Very Rare case)
            break
    return args


def _output_result(result):
    # Comment-out appropriate output pattern depends on subject.

    # sys.stdout.write(result)  # No Line Feed, and an result must be string (not useful). for single value output.
    # print(result)  # The result will cast to strings. Line feed will be appended to the end. for single value output.
    # print(result, end='')  # Same as above except Line Feed won't be appended. for single value output.
    # print(','.join(map(str, result)))  # Print array elements as comma separated strings. for multi-value.
    print('{}'.format(str(result)))  # Same as above, but more versatile.


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys


def main():

    # Get Args
    args = _input_args()  # get arguments as an array from console/script parameters.

    # Call main Logic
    result = _main(args)

    # Output a result in a correct way.
    _output_result(result)


def _main(args):
    """Write Main Logic here for the contest.

    :param args: arguments
    :type args: list
    :return: result
    :rtype: depends on your logic.
    """
    # Extract arguments.
    Sd = args[0]
    T = args[1]

    # Write main logic here.
    result = _fit_partial_strings(Sd, T)

    # Return something.
    return result


def _fit_partial_strings(Sd, T):

    for i in range(len(Sd)):
        for j in range(len(T)):
            if Sd[i] == T[j]:
                if len(Sd) - i >= len(T) - j:  # enough space available?
                    offset = i - j
                    Sd_list = list(Sd)  # convert str to list for operation
                    for k in range(len(T)):

                        if Sd_list[k + offset] == '?':
                            Sd_list[k + offset] = T[k]  # patch T to Sd
                        if Sd_list[k + offset] != T[k]:
                            return 'UNRESTORABLE'

                    Sd = "".join(Sd_list)  # convert list to str
                    Sd = Sd.replace('?', 'a')
                    return Sd
                else:
                    return 'UNRESTORABLE'

    return 'UNRESTORABLE'


def _input_args():
    # Comment-out appropriate pattern depends on subject.

    # arguments = sys.argv[1:]  # ptn1: get args from script parameters.
    # arguments = _input().split()  # ptn2: get args from 1 line console prompt with space separated.

    # for multi-line console input, use this.
    arguments = _get_args_from_multiple_lines(end_of_lines_char=[''], limit=2)

    # Cast elements If you need.
    # arguments = list(map(int, arguments))  # cast elements to int for example.

    return arguments  # This will be array.


def _input():
    # If Subject requires interactive input, use this and patch mock in unittest.
    return input()  # Change if necessary.


def _get_args_from_multiple_lines(end_of_lines_char=[''], limit=2):
    """Get arguments from multiple lines standard input.

    :param end_of_lines_char: Strings that indicate the end of lines.
    :type end_of_lines_char: list of str
    :param limit: If a number of the input line are certain, you can use this param to close prompt immediately.
    :type limit: int
    :return: args
    :rtype list of str
    """
    args = []
    for i in range(limit):
        try:
            arg = _input()
            if arg in end_of_lines_char:
                break
            args.append(arg)
        except EOFError:  # Supports EOF Style. (Very Rare case)
            break
    return args


def _output_result(result):
    # Comment-out appropriate output pattern depends on subject.

    # sys.stdout.write(result)  # No Line Feed, and an result must be string (not useful). for single value output.
    # print(result)  # The result will cast to strings. Line feed will be appended to the end. for single value output.
    # print(result, end='')  # Same as above except Line Feed won't be appended. for single value output.
    # print(','.join(map(str, result)))  # Print array elements as comma separated strings. for multi-value.
    print('{}'.format(str(result)))  # Same as above, but more versatile.


if __name__ == '__main__':
    main()