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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.v: F = None
        self.x: A = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.u: A = None
        self.o: D = None
        self.w: F = None
        self.v: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: H = None
        self.y: C = None
        self.x: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.r: A = None
        self.x: A = None
        self.z: C = None
        self.w: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.u: H = 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.y: F = None
        self.q: G = None
        self.s: D = None
        self.w: C = None
        self.v: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.v: F = None
        self.x: A = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.u: A = None
        self.o: D = None
        self.w: F = None
        self.v: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: H = None
        self.y: C = None
        self.x: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.r: A = None
        self.x: A = None
        self.z: C = None
        self.w: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.u: H = 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.y: F = None
        self.q: G = None
        self.s: D = None
        self.w: C = None
        self.v: C = None
        self.txt = txt

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

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