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

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

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

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

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

c = A("c")
d = B("d")
f = C("f")
j = D("j")
k = E("k")

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

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

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

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

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

c = A("c")
d = B("d")
f = C("f")
j = D("j")
k = E("k")

c.v = d
c.z = f
c.o = f
d.w = k
d.t = f
d.o = c
d.s = c
d.v = c
f.y = d
j.o = d
j.s = f
k.u = j
k.v = j
k.o = d
k.s = f
assert f.y.w.s.txt == "f"