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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.u: D = None
        self.r: A = None
        self.y: D = None
        self.p: E = None
        self.z: E = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.u: D = None
        self.r: A = None
        self.y: D = None
        self.p: E = None
        self.z: E = None
        self.txt = txt

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

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

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

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

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

m.v = n
m.o = n
m.w = d
m.t = d
h.o = d
h.u = d
h.y = d
h.r = m
h.p = e
h.z = e
n.w = h
n.x = m
n.r = d
d.v = h
e.w = m
b.t = n
b.w = e
assert h.u.v.u.txt == "d"