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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.y: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: B = None
        self.z: F = None
        self.t: F = None
        self.s: D = None
        self.u: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.r: B = None
        self.y: D = None
        self.t: C = None
        self.w: D = None
        self.txt = txt

b = A("b")
h = B("h")
g = C("g")
e = D("e")
m = E("m")
d = F("d")

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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.y: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: B = None
        self.z: F = None
        self.t: F = None
        self.s: D = None
        self.u: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.r: B = None
        self.y: D = None
        self.t: C = None
        self.w: D = None
        self.txt = txt

b = A("b")
h = B("h")
g = C("g")
e = D("e")
m = E("m")
d = F("d")

b.v = e
b.z = m
b.o = m
h.v = b
h.y = g
g.y = m
g.r = h
g.z = d
g.t = d
g.s = e
g.u = e
e.o = d
m.w = b
m.q = b
m.z = b
m.x = e
m.t = e
m.r = g
d.o = g
d.t = g
d.r = h
d.y = e
d.w = e
assert d.y.o.r.y.t.txt == "d"