#!/usr/bin/env python
# -*- coding: utf-8 -*-

__author__ = 'Marco Torreggiani'
import sys

def substr(x1,x2,n=0):
    contr=False
    for sf in xrange(n,len(x1)-len(x2)+1,+1):
        for c in xrange(len(x2)):
            contr=True
            if x2[c]!=x1[c+sf]:
                contr=False
                break
        if contr:
            return sf
    return -1




if __name__=='__main__':
    fil = open(sys.argv[1], 'r')
    for row in fil.readlines():
        stringa,expr=row.split(',')
        expr=expr[:len(expr)-1]

        mod=True
        expr=expr.split('*')
        app=[]
        for i in expr:
            if i!='':
                app.append(i)
        expr=app
        while(mod==True):
            mod=False
            app=[]
            i=0
            while i<len(expr):
                if expr[i][-1]=='\\':
                    if i==len(expr)-1:
                        app.append(expr[i][:-1]+'*')
                    else:
                        app.append(expr[i][:-1]+'*'+expr[i+1])
                    i=i+2
                    mod=True
                else:
                    app.append(expr[i])
                    i=i+1
            expr=app
        del app
        p=[]
        for i in xrange(len(expr)):
            if i==0:
                p.append(substr(stringa,expr[i],0))
            else:
                p.append(substr(stringa,expr[i],p[i-1]+len(expr[i-1])))
            if p[i]==-1:
                print 'false'
                break
        if -1 not in p:
            print 'true'



