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

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

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

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

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

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

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

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

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

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

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