class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: C = None
        self.r: F = None
        self.w: C = None
        self.z: F = None
        self.t: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.v: D = None
        self.o: B = None
        self.r: D = None
        self.s: C = None
        self.txt = txt

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

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

e.v = d
e.o = m
e.w = m
e.r = l
e.z = j
e.t = n
b.z = a
b.q = a
b.s = d
b.u = d
b.v = n
m.t = n
d.w = g
n.t = d
n.v = d
n.r = d
n.o = b
n.s = m
l.t = a
g.w = d
j.t = a
a.z = b
a.q = b
a.s = g
a.u = d
a.v = n
assert m.t.v.w.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: C = None
        self.r: F = None
        self.w: C = None
        self.z: F = None
        self.t: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.v: D = None
        self.o: B = None
        self.r: D = None
        self.s: C = None
        self.txt = txt

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

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

e.v = d
e.o = m
e.w = m
e.r = l
e.z = j
e.t = n
b.z = a
b.q = a
b.s = d
b.u = d
b.v = n
m.t = n
d.w = g
n.t = d
n.v = d
n.r = d
n.o = b
n.s = m
l.t = a
g.w = d
j.t = a
a.z = b
a.q = b
a.s = g
a.u = d
a.v = n
assert m.t.v.w.txt == "g"