class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: G = None
        self.q: B = None
        self.w: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.q: D = None
        self.u: B = None
        self.r: I = None
        self.y: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.r: F = None
        self.o: E = None
        self.q: A = None
        self.u: E = None
        self.z: F = None
        self.y: G = None
        self.p: A = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.q: F = None
        self.y: D = None
        self.w: I = None
        self.o: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: G = None
        self.u: C = None
        self.txt = txt

j = A("j")
d = B("d")
f = C("f")
e = D("e")
n = E("n")
i = F("i")
l = G("l")
b = H("b")
m = I("m")

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

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

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.q: D = None
        self.u: B = None
        self.r: I = None
        self.y: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.r: F = None
        self.o: E = None
        self.q: A = None
        self.u: E = None
        self.z: F = None
        self.y: G = None
        self.p: A = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.q: F = None
        self.y: D = None
        self.w: I = None
        self.o: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: G = None
        self.u: C = None
        self.txt = txt

j = A("j")
d = B("d")
f = C("f")
e = D("e")
n = E("n")
i = F("i")
l = G("l")
b = H("b")
m = I("m")

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