class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: H = None
        self.u: C = None
        self.p: C = None
        self.s: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: H = None
        self.p: E = None
        self.o: B = None
        self.r: B = None
        self.x: D = None
        self.z: A = None
        self.w: A = None
        self.t: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.y: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.s: C = None
        self.u: H = None
        self.p: I = None
        self.q: E = None
        self.v: H = None
        self.y: C = None
        self.o: D = None
        self.w: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.x: A = None
        self.s: H = None
        self.o: D = None
        self.z: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: G = None
        self.r: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

e = A("e")
b = B("b")
d = C("d")
c = D("c")
g = E("g")
j = F("j")
k = G("k")
h = H("h")
m = I("m")
f = E("f")

e.q = d
e.u = d
e.p = d
e.o = h
e.s = h
b.r = c
d.v = h
d.t = h
d.p = f
d.o = b
d.r = b
d.x = c
d.z = e
d.w = e
c.s = e
c.y = d
g.z = d
g.s = d
g.y = d
g.u = h
g.v = h
g.w = h
g.p = m
g.q = f
g.o = c
j.v = c
j.o = c
j.x = e
j.s = h
j.z = h
k.r = e
k.q = f
h.u = e
h.r = e
h.w = k
m.q = c
f.z = d
f.s = d
f.y = d
f.u = h
f.v = h
f.w = h
f.p = m
f.q = g
f.o = c
assert c.y.w.o.w.q.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: H = None
        self.u: C = None
        self.p: C = None
        self.s: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: H = None
        self.p: E = None
        self.o: B = None
        self.r: B = None
        self.x: D = None
        self.z: A = None
        self.w: A = None
        self.t: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.y: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.s: C = None
        self.u: H = None
        self.p: I = None
        self.q: E = None
        self.v: H = None
        self.y: C = None
        self.o: D = None
        self.w: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.x: A = None
        self.s: H = None
        self.o: D = None
        self.z: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: G = None
        self.r: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

e = A("e")
b = B("b")
d = C("d")
c = D("c")
g = E("g")
j = F("j")
k = G("k")
h = H("h")
m = I("m")
f = E("f")

e.q = d
e.u = d
e.p = d
e.o = h
e.s = h
b.r = c
d.v = h
d.t = h
d.p = f
d.o = b
d.r = b
d.x = c
d.z = e
d.w = e
c.s = e
c.y = d
g.z = d
g.s = d
g.y = d
g.u = h
g.v = h
g.w = h
g.p = m
g.q = f
g.o = c
j.v = c
j.o = c
j.x = e
j.s = h
j.z = h
k.r = e
k.q = f
h.u = e
h.r = e
h.w = k
m.q = c
f.z = d
f.s = d
f.y = d
f.u = h
f.v = h
f.w = h
f.p = m
f.q = g
f.o = c
assert c.y.w.o.w.q.txt == "f"