class A:
    def __init__(self, txt: str):
        self.s: G = None
        self.x: D = None
        self.w: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: H = None
        self.v: D = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: H = None
        self.v: D = None
        self.txt = txt

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

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

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

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