class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: C = None
        self.o: C = None
        self.r: C = None
        self.t: 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.x: B = None
        self.w: H = None
        self.o: B = None
        self.t: G = None
        self.z: D = None
        self.q: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: F = None
        self.o: B = None
        self.r: G = None
        self.v: D = None
        self.p: H = None
        self.t: D = None
        self.y: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: H = None
        self.y: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: B = None
        self.o: D = None
        self.q: F = None
        self.x: E = None
        self.z: A = None
        self.p: G = None
        self.txt = txt

d = A("d")
k = B("k")
h = C("h")
m = D("m")
e = E("e")
a = F("a")
i = G("i")
j = H("j")

d.u = k
d.q = h
d.o = h
d.r = h
d.t = j
k.r = m
h.x = k
h.o = k
h.q = k
h.w = j
h.t = i
h.z = m
m.t = k
e.u = m
e.v = m
e.t = m
e.w = a
e.o = k
e.r = i
e.p = j
e.y = h
a.q = j
a.y = d
i.u = e
j.r = k
j.o = m
j.q = a
j.x = e
j.z = d
j.p = i
assert j.x.y.w.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: C = None
        self.o: C = None
        self.r: C = None
        self.t: 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.x: B = None
        self.w: H = None
        self.o: B = None
        self.t: G = None
        self.z: D = None
        self.q: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: F = None
        self.o: B = None
        self.r: G = None
        self.v: D = None
        self.p: H = None
        self.t: D = None
        self.y: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: H = None
        self.y: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: B = None
        self.o: D = None
        self.q: F = None
        self.x: E = None
        self.z: A = None
        self.p: G = None
        self.txt = txt

d = A("d")
k = B("k")
h = C("h")
m = D("m")
e = E("e")
a = F("a")
i = G("i")
j = H("j")

d.u = k
d.q = h
d.o = h
d.r = h
d.t = j
k.r = m
h.x = k
h.o = k
h.q = k
h.w = j
h.t = i
h.z = m
m.t = k
e.u = m
e.v = m
e.t = m
e.w = a
e.o = k
e.r = i
e.p = j
e.y = h
a.q = j
a.y = d
i.u = e
j.r = k
j.o = m
j.q = a
j.x = e
j.z = d
j.p = i
assert j.x.y.w.txt == "j"