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

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.s: E = None
        self.y: A = None
        self.u: F = None
        self.r: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.u: C = None
        self.q: E = None
        self.w: D = None
        self.r: A = None
        self.txt = txt

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

e.z = g
e.u = d
m.v = c
a.v = e
a.y = e
a.s = g
a.u = c
a.r = c
d.t = a
d.w = a
d.x = a
d.z = m
d.s = m
d.q = c
g.t = d
g.r = d
c.y = g
c.q = g
c.u = a
c.w = d
c.r = e
n.t = a
n.w = a
n.x = a
n.z = m
n.s = m
n.q = c
assert m.v.r.z.r.q.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.u: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.s: E = None
        self.y: A = None
        self.u: F = None
        self.r: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.u: C = None
        self.q: E = None
        self.w: D = None
        self.r: A = None
        self.txt = txt

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

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