class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: H = None
        self.txt = txt

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.s: D = None
        self.o: C = None
        self.w: B = None
        self.t: D = None
        self.x: D = None
        self.q: D = None
        self.p: F = None
        self.txt = txt

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

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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.s: D = None
        self.o: C = None
        self.w: B = None
        self.t: D = None
        self.x: D = None
        self.q: D = None
        self.p: F = None
        self.txt = txt

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

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