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

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.r: D = None
        self.o: F = None
        self.q: H = None
        self.z: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.o: G = None
        self.s: E = None
        self.x: G = None
        self.w: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.s: C = None
        self.x: C = None
        self.v: A = None
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: H = None
        self.u: A = None
        self.y: B = None
        self.z: B = None
        self.q: E = None
        self.t: D = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.r: D = None
        self.o: F = None
        self.q: H = None
        self.z: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.o: G = None
        self.s: E = None
        self.x: G = None
        self.w: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.s: C = None
        self.x: C = None
        self.v: A = None
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: H = None
        self.u: A = None
        self.y: B = None
        self.z: B = None
        self.q: E = None
        self.t: D = None
        self.txt = txt

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

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

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

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