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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.q: B = None
        self.o: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: A = None
        self.o: E = None
        self.v: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: C = None
        self.s: A = None
        self.w: E = None
        self.v: D = None
        self.txt = txt

b = A("b")
k = B("k")
d = C("d")
a = D("a")
e = E("e")
j = A("j")
f = D("f")
m = B("m")
h = E("h")
g = A("g")

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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.q: B = None
        self.o: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: A = None
        self.o: E = None
        self.v: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: C = None
        self.s: A = None
        self.w: E = None
        self.v: D = None
        self.txt = txt

b = A("b")
k = B("k")
d = C("d")
a = D("a")
e = E("e")
j = A("j")
f = D("f")
m = B("m")
h = E("h")
g = A("g")

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