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

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.v: A = None
        self.w: F = None
        self.z: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: B = None
        self.z: A = None
        self.v: A = None
        self.txt = txt

e = A("e")
c = B("c")
a = C("a")
j = D("j")
d = E("d")
f = F("f")

e.w = a
c.x = d
c.v = e
c.w = f
c.z = a
a.u = d
a.t = f
j.s = a
d.o = f
d.q = f
f.y = j
f.q = c
f.z = e
f.v = e
assert c.z.u.o.y.s.u.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.v: A = None
        self.w: F = None
        self.z: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: B = None
        self.z: A = None
        self.v: A = None
        self.txt = txt

e = A("e")
c = B("c")
a = C("a")
j = D("j")
d = E("d")
f = F("f")

e.w = a
c.x = d
c.v = e
c.w = f
c.z = a
a.u = d
a.t = f
j.s = a
d.o = f
d.q = f
f.y = j
f.q = c
f.z = e
f.v = e
assert c.z.u.o.y.s.u.txt == "d"