class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.x: H = None
        self.z: H = None
        self.q: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.z: G = None
        self.t: B = None
        self.r: G = None
        self.v: E = None
        self.u: H = None
        self.s: G = None
        self.p: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.x: H = None
        self.t: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: D = None
        self.p: A = None
        self.v: E = None
        self.q: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.z: G = None
        self.t: B = None
        self.r: G = None
        self.v: E = None
        self.u: H = None
        self.s: G = None
        self.p: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.x: H = None
        self.t: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: D = None
        self.p: A = None
        self.v: E = None
        self.q: A = None
        self.txt = txt

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

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