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

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

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

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

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

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

c.v = i
c.w = i
c.t = j
c.s = f
f.y = c
f.u = c
f.v = j
e.z = i
e.w = i
e.t = d
d.q = c
d.t = c
d.v = e
i.z = c
i.r = c
i.p = d
j.y = c
j.u = c
j.v = f
assert f.v.y.s.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.t: B = None
        self.w: E = None
        self.s: B = None
        self.txt = txt

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

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

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

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

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

c.v = i
c.w = i
c.t = j
c.s = f
f.y = c
f.u = c
f.v = j
e.z = i
e.w = i
e.t = d
d.q = c
d.t = c
d.v = e
i.z = c
i.r = c
i.p = d
j.y = c
j.u = c
j.v = f
assert f.v.y.s.v.txt == "j"