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

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: A = None
        self.y: E = None
        self.p: C = None
        self.s: B = None
        self.txt = txt

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

l = A("l")
e = B("e")
b = C("b")
m = D("m")
a = E("a")
j = E("j")
f = D("f")

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

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: A = None
        self.y: E = None
        self.p: C = None
        self.s: B = None
        self.txt = txt

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

l = A("l")
e = B("e")
b = C("b")
m = D("m")
a = E("a")
j = E("j")
f = D("f")

l.s = a
l.t = m
l.x = m
e.u = l
e.p = l
e.q = f
b.z = l
m.o = e
m.s = e
m.u = l
m.y = a
m.p = b
a.v = j
a.w = j
a.s = j
a.z = b
j.v = a
j.w = a
j.s = a
j.z = b
f.o = e
f.s = e
f.u = l
f.y = j
f.p = b
assert e.u.x.y.v.z.z.x.txt == "m"