class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: D = None
        self.y: G = None
        self.v: A = None
        self.z: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: H = None
        self.z: C = None
        self.s: E = None
        self.u: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.z: G = None
        self.v: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: E = None
        self.o: B = None
        self.r: A = None
        self.txt = txt

b = A("b")
h = B("h")
n = C("n")
j = D("j")
d = E("d")
e = F("e")
i = G("i")
c = H("c")
l = G("l")

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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: D = None
        self.y: G = None
        self.v: A = None
        self.z: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: H = None
        self.z: C = None
        self.s: E = None
        self.u: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.z: G = None
        self.v: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: E = None
        self.o: B = None
        self.r: A = None
        self.txt = txt

b = A("b")
h = B("h")
n = C("n")
j = D("j")
d = E("d")
e = F("e")
i = G("i")
c = H("c")
l = G("l")

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