class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.u: C = None
        self.s: D = None
        self.q: D = 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.t: E = None
        self.p: A = None
        self.v: A = None
        self.z: C = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

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

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