class A:
    def __init__(self, txt: str):
        self.z: H = None
        self.v: C = None
        self.q: E = None
        self.t: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.s: F = None
        self.u: B = None
        self.t: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: H = None
        self.r: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.u: F = None
        self.q: C = None
        self.t: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.s: F = None
        self.u: B = None
        self.t: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: H = None
        self.r: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.u: F = None
        self.q: C = None
        self.t: A = None
        self.txt = txt

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

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