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

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.y: E = None
        self.z: D = None
        self.w: E = None
        self.t: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.q: B = None
        self.y: C = None
        self.o: B = None
        self.r: F = None
        self.z: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: B = None
        self.txt = txt

d = A("d")
m = B("m")
c = C("c")
i = D("i")
j = E("j")
f = F("f")
a = E("a")
l = F("l")

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

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.y: E = None
        self.z: D = None
        self.w: E = None
        self.t: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.q: B = None
        self.y: C = None
        self.o: B = None
        self.r: F = None
        self.z: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: B = None
        self.txt = txt

d = A("d")
m = B("m")
c = C("c")
i = D("i")
j = E("j")
f = F("f")
a = E("a")
l = F("l")

d.q = i
d.y = i
d.u = c
d.p = c
d.o = a
d.s = j
m.x = f
m.y = j
m.w = j
m.z = i
m.t = l
c.u = d
c.v = i
c.z = j
i.r = l
i.u = m
j.w = i
j.q = m
j.o = m
j.y = c
j.r = l
j.z = a
f.p = l
f.s = m
a.w = i
a.q = m
a.o = m
a.y = c
a.r = f
a.z = j
l.p = f
l.s = m
assert j.w.u.z.u.w.q.z.u.txt == "m"