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

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

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.q: E = None
        self.txt = txt

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

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.q: E = None
        self.txt = txt

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

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

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

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

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

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

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