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

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

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.v: G = None
        self.q: B = None
        self.w: E = None
        self.y: E = None
        self.x: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: A = None
        self.t: G = None
        self.v: G = None
        self.o: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.s: F = None
        self.y: C = None
        self.r: D = None
        self.txt = txt

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

m = A("m")
c = B("c")
i = C("i")
a = D("a")
f = E("f")
h = F("h")
e = G("e")
j = H("j")

m.z = h
m.v = h
c.z = f
c.s = j
c.u = j
c.t = a
c.y = a
c.v = i
i.y = c
i.v = c
i.t = a
i.u = h
a.o = f
a.w = f
a.y = f
a.v = e
a.q = c
a.x = i
f.z = a
f.y = e
h.z = m
h.x = m
h.o = m
h.t = e
h.v = e
e.x = a
e.r = a
e.s = h
e.y = i
j.p = a
assert h.t.s.x.v.txt == "
class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.v: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.v: G = None
        self.q: B = None
        self.w: E = None
        self.y: E = None
        self.x: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: A = None
        self.t: G = None
        self.v: G = None
        self.o: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.s: F = None
        self.y: C = None
        self.r: D = None
        self.txt = txt

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

m = A("m")
c = B("c")
i = C("i")
a = D("a")
f = E("f")
h = F("h")
e = G("e")
j = H("j")

m.z = h
m.v = h
c.z = f
c.s = j
c.u = j
c.t = a
c.y = a
c.v = i
i.y = c
i.v = c
i.t = a
i.u = h
a.o = f
a.w = f
a.y = f
a.v = e
a.q = c
a.x = i
f.z = a
f.y = e
h.z = m
h.x = m
h.o = m
h.t = e
h.v = e
e.x = a
e.r = a
e.s = h
e.y = i
j.p = a
assert h.t.s.x.v.txt == "h"