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

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

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: H = None
        self.p: H = None
        self.v: F = None
        self.r: D = None
        self.q: D = None
        self.x: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: C = None
        self.t: C = None
        self.p: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: H = None
        self.p: H = None
        self.y: A = None
        self.v: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.t: D = None
        self.z: G = None
        self.x: A = None
        self.o: E = None
        self.q: A = None
        self.s: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.u: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: G = None
        self.y: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: H = None
        self.p: H = None
        self.v: F = None
        self.r: D = None
        self.q: D = None
        self.x: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: C = None
        self.t: C = None
        self.p: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: H = None
        self.p: H = None
        self.y: A = None
        self.v: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.t: D = None
        self.z: G = None
        self.x: A = None
        self.o: E = None
        self.q: A = None
        self.s: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.u: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: G = None
        self.y: D = None
        self.txt = txt

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

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